targetj 1.0.91 → 1.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/$Dom.js CHANGED
@@ -7,12 +7,6 @@ exports.$Dom = void 0;
7
7
  var _TUtil = require("./TUtil.js");
8
8
  var _App = require("./App.js");
9
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); }
10
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
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."); }
12
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
14
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
15
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
16
10
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
17
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); } }
18
12
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -126,28 +120,15 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
126
120
  value: function setStyleByMap(attrMap) {
127
121
  var _this = this;
128
122
  Object.keys(attrMap).forEach(function (key) {
129
- var value = attrMap[key];
130
- switch (key) {
131
- case 'transform':
132
- _this.transform.apply(_this, _toConsumableArray(value));
133
- break;
134
- case 'width':
135
- _this.width(value);
136
- break;
137
- case 'height':
138
- _this.height(value);
139
- break;
140
- default:
141
- _this.style(key, value);
142
- }
123
+ _this.style(key, attrMap[key]);
143
124
  });
144
125
  }
145
126
  }, {
146
127
  key: "style",
147
128
  value: function style(name, value) {
148
- if (_TUtil.TUtil.isDefined(value) && _TUtil.TUtil.isDefined(name)) {
129
+ if (arguments.length === 2) {
149
130
  this.element.style[name] = value;
150
- } else if (_TUtil.TUtil.isDefined(name)) {
131
+ } else if (arguments.length === 1) {
151
132
  return this.element.style[name];
152
133
  } else {
153
134
  return this.element.style;
@@ -295,19 +276,8 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
295
276
  }
296
277
  }, {
297
278
  key: "transform",
298
- value: function transform(x, y, rotate, scale) {
299
- var transformValue = this.createTransformValue(x, y, rotate, scale);
300
- if (transformValue !== this.element.style[(0, _App.getBrowser)().style.transform]) {
301
- this.element.style[(0, _App.getBrowser)().style.transform] = transformValue;
302
- }
303
- }
304
- }, {
305
- key: "createTransformValue",
306
- value: function createTransformValue(x, y, rotate, scale) {
307
- var xy = _TUtil.TUtil.isDefined(x) && _TUtil.TUtil.isDefined(y) ? "translate(".concat(x !== 0 ? "".concat(x, "px") : '0', ",").concat(y !== 0 ? "".concat(y, "px") : '0', ") ") : '';
308
- rotate = _TUtil.TUtil.isDefined(rotate) ? "rotate(".concat(rotate, "deg) ") : '';
309
- scale = _TUtil.TUtil.isDefined(scale) ? "scale(".concat(scale, ")") : '';
310
- return (xy + rotate + scale).trim();
279
+ value: function transform(transformString) {
280
+ this.element.style[(0, _App.getBrowser)().style.transform] = transformString;
311
281
  }
312
282
  }, {
313
283
  key: "animate",
@@ -388,6 +358,11 @@ var $Dom = exports.$Dom = /*#__PURE__*/function () {
388
358
  parent.removeChild(element);
389
359
  }
390
360
  }
361
+ }, {
362
+ key: "hasFocus",
363
+ value: function hasFocus(tmodel) {
364
+ return tmodel.hasDom() && document.activeElement === tmodel.$dom.element;
365
+ }
391
366
  }, {
392
367
  key: "ready",
393
368
  value: function ready(callback) {
package/build/App.js CHANGED
@@ -11,11 +11,12 @@ var _EventListener = require("./EventListener.js");
11
11
  var _LoadingManager = require("./LoadingManager.js");
12
12
  var _LocationManager = require("./LocationManager.js");
13
13
  var _PageManager = require("./PageManager.js");
14
- var _SearchUtil = require("./SearchUtil.js");
15
14
  var _TModelManager = require("./TModelManager.js");
16
15
  var _RunScheduler = require("./RunScheduler.js");
17
- var _TUtil = require("./TUtil.js");
18
16
  var _TargetManager = require("./TargetManager.js");
17
+ var _TUtil = require("./TUtil.js");
18
+ var _SearchUtil = require("./SearchUtil.js");
19
+ var _TargetUtil = require("./TargetUtil.js");
19
20
  var tApp;
20
21
  var AppFn = function AppFn(firstChild) {
21
22
  var my = {};
@@ -105,7 +106,13 @@ var AppFn = function AppFn(firstChild) {
105
106
  };
106
107
  my.reset = function () {
107
108
  my.manager.lists.visible.forEach(function (tmodel) {
108
- return tmodel.domValues = {};
109
+ tmodel.transformMap = {};
110
+ tmodel.styleMap = {};
111
+ Object.keys(_TargetUtil.TargetUtil.styleTargetMap).forEach(function (key) {
112
+ if (_TUtil.TUtil.isDefined(tmodel.val(key))) {
113
+ tmodel.addToStyleTargetList(key);
114
+ }
115
+ });
109
116
  });
110
117
  my.manager.clear();
111
118
  my.locationManager.hasLocationList.length = 0;