targetj 1.0.74 → 1.0.76
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/babel.config.json +17 -0
- package/build/$Dom.js +424 -0
- package/build/App.js +187 -0
- package/build/Bracket.js +157 -0
- package/build/BracketGenerator.js +86 -0
- package/build/Browser.js +105 -0
- package/build/ColorUtil.js +182 -0
- package/build/Dim.js +31 -0
- package/build/Easing.js +59 -0
- package/build/EventListener.js +664 -0
- package/build/LoadingManager.js +366 -0
- package/build/LocationManager.js +211 -0
- package/build/Moves.js +71 -0
- package/build/PageManager.js +113 -0
- package/build/SearchUtil.js +196 -0
- package/build/TModel.js +1000 -0
- package/build/TModelManager.js +605 -0
- package/build/TUtil.js +188 -0
- package/build/TargetExecutor.js +117 -0
- package/build/TargetManager.js +197 -0
- package/build/TargetUtil.js +299 -0
- package/build/Viewport.js +163 -0
- package/package.json +11 -4
- package/webpack.config.js +14 -1
- package/src/$Dom.js +0 -380
- package/src/App.js +0 -224
- package/src/Bracket.js +0 -212
- package/src/Browser.js +0 -122
- package/src/ColorUtil.js +0 -166
- package/src/Dim.js +0 -21
- package/src/Easing.js +0 -41
- package/src/EventListener.js +0 -570
- package/src/LoadingManager.js +0 -368
- package/src/LocationManager.js +0 -236
- package/src/Moves.js +0 -59
- package/src/PageManager.js +0 -87
- package/src/SearchUtil.js +0 -210
- package/src/TModel.js +0 -937
- package/src/TModelManager.js +0 -575
- package/src/TUtil.js +0 -162
- package/src/TargetExecutor.js +0 -113
- package/src/TargetManager.js +0 -191
- package/src/TargetUtil.js +0 -307
- package/src/Viewport.js +0 -180
package/build/Bracket.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Bracket = void 0;
|
|
8
|
+
var _TModel2 = require("./TModel.js");
|
|
9
|
+
var _TUtil = require("./TUtil.js");
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
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
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
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
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
16
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
17
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
19
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
20
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
21
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
22
|
+
var Bracket = exports.Bracket = /*#__PURE__*/function (_TModel) {
|
|
23
|
+
function Bracket(parent) {
|
|
24
|
+
var _this;
|
|
25
|
+
_classCallCheck(this, Bracket);
|
|
26
|
+
_this = _callSuper(this, Bracket, ["BI", {
|
|
27
|
+
canHaveDom: false,
|
|
28
|
+
outerXEast: 0
|
|
29
|
+
}]);
|
|
30
|
+
_this.parent = parent;
|
|
31
|
+
_this.newFlag = true;
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
_inherits(Bracket, _TModel);
|
|
35
|
+
return _createClass(Bracket, [{
|
|
36
|
+
key: "getWidth",
|
|
37
|
+
value: function getWidth() {
|
|
38
|
+
return this.getContentWidth();
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "getHeight",
|
|
42
|
+
value: function getHeight() {
|
|
43
|
+
return this.getContentHeight();
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
key: "getInnerWidth",
|
|
47
|
+
value: function getInnerWidth() {
|
|
48
|
+
return this.innerContentWidth;
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
key: "getInnerXEast",
|
|
52
|
+
value: function getInnerXEast() {
|
|
53
|
+
return _TUtil.TUtil.isDefined(this.getRealParent().val('innerXEast')) ? this.getRealParent().val('innerXEast') : this.getRealParent().absX + this.getRealParent().getWidth();
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "getInnerContentHeight",
|
|
57
|
+
value: function getInnerContentHeight() {
|
|
58
|
+
return this.innerContentHeight;
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "getScrollTop",
|
|
62
|
+
value: function getScrollTop() {
|
|
63
|
+
this.initParents();
|
|
64
|
+
return this.getRealParent().getScrollTop();
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
key: "getScrollLeft",
|
|
68
|
+
value: function getScrollLeft() {
|
|
69
|
+
this.initParents();
|
|
70
|
+
return this.getRealParent().getScrollLeft();
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "getBoundingRect",
|
|
74
|
+
value: function getBoundingRect() {
|
|
75
|
+
this.initParents();
|
|
76
|
+
return _TUtil.TUtil.getBoundingRect(this.getRealParent());
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "calculateAbsolutePosition",
|
|
80
|
+
value: function calculateAbsolutePosition(x, y) {
|
|
81
|
+
var rect = this.getBoundingRect();
|
|
82
|
+
this.absX = rect.left + x;
|
|
83
|
+
this.absY = rect.top + y;
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "isVisible",
|
|
87
|
+
value: function isVisible() {
|
|
88
|
+
return this.visibilityStatus.top && this.visibilityStatus.bottom;
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "addToUpdatingChildren",
|
|
92
|
+
value: function addToUpdatingChildren(child) {
|
|
93
|
+
this.getRealParent().addToUpdatingChildren(child);
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "createViewport",
|
|
97
|
+
value: function createViewport() {
|
|
98
|
+
return this.getRealParent().createViewport.call(this);
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "getRealParent",
|
|
102
|
+
value: function getRealParent() {
|
|
103
|
+
this.initParents();
|
|
104
|
+
return this.realParent;
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "shouldCalculateChildren",
|
|
108
|
+
value: function shouldCalculateChildren() {
|
|
109
|
+
var result = this.isVisible() || this.newFlag;
|
|
110
|
+
this.newFlag = false;
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "getChildren",
|
|
115
|
+
value: function getChildren() {
|
|
116
|
+
return this.actualValues.children;
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "addToParentVisibleList",
|
|
120
|
+
value: function addToParentVisibleList() {}
|
|
121
|
+
}, {
|
|
122
|
+
key: "initParents",
|
|
123
|
+
value: function initParents() {
|
|
124
|
+
if (this.realParent || this.topBracket) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
var topBracket = this;
|
|
128
|
+
var parent = this.bracketParent;
|
|
129
|
+
while (parent) {
|
|
130
|
+
if (parent.type !== 'BI') {
|
|
131
|
+
break;
|
|
132
|
+
} else {
|
|
133
|
+
topBracket = parent;
|
|
134
|
+
parent = parent.bracketParent;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
this.realParent = parent;
|
|
138
|
+
this.topBracket = topBracket;
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "getChildrenOids",
|
|
142
|
+
value: function getChildrenOids() {
|
|
143
|
+
var oids = [];
|
|
144
|
+
var list = this.getChildren();
|
|
145
|
+
for (var i = 0; i < list.length; i++) {
|
|
146
|
+
var item = list[i];
|
|
147
|
+
if (item.type === 'BI') {
|
|
148
|
+
var goids = item.getChildrenOids();
|
|
149
|
+
oids = [].concat(oids, [item.oid], goids);
|
|
150
|
+
} else {
|
|
151
|
+
oids.push(item.oid + ":" + item.getHeight());
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return oids;
|
|
155
|
+
}
|
|
156
|
+
}]);
|
|
157
|
+
}(_TModel2.TModel);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BracketGenerator = void 0;
|
|
7
|
+
var _App = require("./App.js");
|
|
8
|
+
var _Bracket = require("./Bracket.js");
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
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
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); }
|
|
16
|
+
var BracketGenerator = exports.BracketGenerator = /*#__PURE__*/function () {
|
|
17
|
+
function BracketGenerator() {
|
|
18
|
+
_classCallCheck(this, BracketGenerator);
|
|
19
|
+
}
|
|
20
|
+
return _createClass(BracketGenerator, null, [{
|
|
21
|
+
key: "generate",
|
|
22
|
+
value: function generate(page, listOfTModel) {
|
|
23
|
+
var brackets = BracketGenerator.bracketMap[page.oid];
|
|
24
|
+
var maxLastUpdate = Math.max(page.getActualValueLastUpdate('allChildren'), page.getActualValueLastUpdate('width'), page.getActualValueLastUpdate('height'));
|
|
25
|
+
if (brackets && brackets.lastUpdate >= maxLastUpdate) {
|
|
26
|
+
brackets = BracketGenerator.bracketMap[page.oid];
|
|
27
|
+
} else {
|
|
28
|
+
brackets = {
|
|
29
|
+
lastUpdate: maxLastUpdate,
|
|
30
|
+
list: []
|
|
31
|
+
};
|
|
32
|
+
listOfTModel = page.type !== 'BI' && !listOfTModel ? page.getChildren() : listOfTModel;
|
|
33
|
+
var length = listOfTModel.length;
|
|
34
|
+
var bracketSize = Math.max(2, _App.tApp.locationManager.bracketThreshold - 1);
|
|
35
|
+
var needsMoreBracketing = false;
|
|
36
|
+
var consecutiveBrackets = 0;
|
|
37
|
+
var from = 0;
|
|
38
|
+
for (var i = 0; i < length; i++) {
|
|
39
|
+
var index = i - from;
|
|
40
|
+
if (listOfTModel[i].canBeBracketed() && (index === bracketSize || i === length - 1) || !listOfTModel[i].canBeBracketed() && index > 0) {
|
|
41
|
+
var to = !listOfTModel[i].canBeBracketed() ? i : i + 1;
|
|
42
|
+
brackets.list.push(BracketGenerator.createBracket(page, listOfTModel, from, to));
|
|
43
|
+
from = i + 1;
|
|
44
|
+
consecutiveBrackets++;
|
|
45
|
+
}
|
|
46
|
+
if (consecutiveBrackets > bracketSize) {
|
|
47
|
+
needsMoreBracketing = true;
|
|
48
|
+
}
|
|
49
|
+
if (!listOfTModel[i].canBeBracketed()) {
|
|
50
|
+
consecutiveBrackets = 0;
|
|
51
|
+
brackets.list.push(listOfTModel[i]);
|
|
52
|
+
from = i + 1;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (needsMoreBracketing) {
|
|
56
|
+
brackets = BracketGenerator.generate(page, brackets.list);
|
|
57
|
+
} else {
|
|
58
|
+
BracketGenerator.bracketMap[page.oid] = brackets;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return brackets;
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "createBracket",
|
|
65
|
+
value: function createBracket(page, listOfTModel, from, to) {
|
|
66
|
+
var bracketId = "".concat(page.oid, "_").concat(page.getWidth(), "_").concat(page.getHeight(), "_").concat(listOfTModel.slice(from, to).oids('_'));
|
|
67
|
+
var bracket;
|
|
68
|
+
if (BracketGenerator.bracketAllMap[bracketId]) {
|
|
69
|
+
bracket = BracketGenerator.bracketAllMap[bracketId];
|
|
70
|
+
} else {
|
|
71
|
+
bracket = new _Bracket.Bracket(page);
|
|
72
|
+
BracketGenerator.bracketAllMap[bracketId] = bracket;
|
|
73
|
+
bracket.actualValues.children = listOfTModel.slice(from, to);
|
|
74
|
+
if (bracket.actualValues.children[0].type === 'BI') {
|
|
75
|
+
bracket.actualValues.children.forEach(function (b) {
|
|
76
|
+
b.bracketParent = bracket;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
bracket.bracketParent = page;
|
|
80
|
+
}
|
|
81
|
+
return bracket;
|
|
82
|
+
}
|
|
83
|
+
}]);
|
|
84
|
+
}();
|
|
85
|
+
_defineProperty(BracketGenerator, "bracketMap", {});
|
|
86
|
+
_defineProperty(BracketGenerator, "bracketAllMap", {});
|
package/build/Browser.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.browser = void 0;
|
|
7
|
+
var browser = exports.browser = {
|
|
8
|
+
style: undefined,
|
|
9
|
+
delayProcess: {},
|
|
10
|
+
setup: function setup() {
|
|
11
|
+
if (!Array.prototype.oids) {
|
|
12
|
+
Array.prototype.oids = function (separator) {
|
|
13
|
+
return this.map(function (o) {
|
|
14
|
+
return o.oid;
|
|
15
|
+
}).join(separator || " ");
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (!document.getElementsByClassName) {
|
|
19
|
+
var getElementsByClassName = function getElementsByClassName(className, context) {
|
|
20
|
+
var elems;
|
|
21
|
+
if (document.querySelectorAll) {
|
|
22
|
+
elems = context.querySelectorAll(".".concat(className));
|
|
23
|
+
} else {
|
|
24
|
+
var all = context.getElementsByTagName("*");
|
|
25
|
+
elems = [];
|
|
26
|
+
for (var i = 0; i < all.length; i++) {
|
|
27
|
+
if (all[i].className && " ".concat(all[i].className, " ").indexOf(" ".concat(className, " ")) > -1 && elems.indexOf(all[i]) === -1) {
|
|
28
|
+
elems.push(all[i]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return elems;
|
|
33
|
+
};
|
|
34
|
+
document.getElementsByClassName = function (className) {
|
|
35
|
+
return getElementsByClassName(className, document);
|
|
36
|
+
};
|
|
37
|
+
Element.prototype.getElementsByClassName = function (className) {
|
|
38
|
+
return getElementsByClassName(className, this);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
this.style = {
|
|
42
|
+
transform: this.prefixStyle('transform'),
|
|
43
|
+
transitionTimingFunction: this.prefixStyle('transitionTimingFunction'),
|
|
44
|
+
transitionDuration: this.prefixStyle('transitionDuration')
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
log: function log(condition) {
|
|
48
|
+
return condition === true ? console.log : function () {};
|
|
49
|
+
},
|
|
50
|
+
prefixStyle: function prefixStyle(style) {
|
|
51
|
+
var elementStyle = document.createElement('div').style;
|
|
52
|
+
var vendor = '';
|
|
53
|
+
var vendors = ['webkitT', 'MozT', 'msT', 'OT', 't'];
|
|
54
|
+
for (var i = 0; i < vendors.length; i++) {
|
|
55
|
+
var transform = vendors[i] + 'ransform';
|
|
56
|
+
if (transform in elementStyle) {
|
|
57
|
+
vendor = vendors[i].substr(0, vendors[i].length - 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
style = vendor === '' ? style : vendor + style.charAt(0).toUpperCase() + style.substr(1);
|
|
61
|
+
return style;
|
|
62
|
+
},
|
|
63
|
+
now: Date.now || function () {
|
|
64
|
+
return new Date().getTime();
|
|
65
|
+
},
|
|
66
|
+
nowInSeconds: function nowInSeconds() {
|
|
67
|
+
return Math.floor(this.now() / 1000);
|
|
68
|
+
},
|
|
69
|
+
delay: function delay(fn, oid, _delay) {
|
|
70
|
+
var timeStamp = browser.now() + _delay;
|
|
71
|
+
var nextRun;
|
|
72
|
+
if (this.delayProcess.id) {
|
|
73
|
+
if (timeStamp >= this.delayProcess.timeStamp) {
|
|
74
|
+
nextRun = {
|
|
75
|
+
timeStamp: timeStamp,
|
|
76
|
+
oid: oid,
|
|
77
|
+
delay: _delay
|
|
78
|
+
};
|
|
79
|
+
} else if (timeStamp < this.delayProcess.timeStamp) {
|
|
80
|
+
nextRun = {
|
|
81
|
+
timeStamp: this.delayProcess.timeStamp,
|
|
82
|
+
oid: this.delayProcess.oid,
|
|
83
|
+
delay: this.delayProcess.delay
|
|
84
|
+
};
|
|
85
|
+
clearTimeout(this.delayProcess.id);
|
|
86
|
+
this.delayProcess.oid = oid;
|
|
87
|
+
this.delayProcess.timeStamp = timeStamp;
|
|
88
|
+
this.delayProcess.delay = _delay;
|
|
89
|
+
this.delayProcess.id = setTimeout(function () {
|
|
90
|
+
fn();
|
|
91
|
+
browser.delayProcess = {};
|
|
92
|
+
}, _delay);
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
this.delayProcess.oid = oid;
|
|
96
|
+
this.delayProcess.timeStamp = timeStamp;
|
|
97
|
+
this.delayProcess.delay = _delay;
|
|
98
|
+
this.delayProcess.id = setTimeout(function () {
|
|
99
|
+
fn();
|
|
100
|
+
browser.delayProcess = {};
|
|
101
|
+
}, _delay);
|
|
102
|
+
}
|
|
103
|
+
return nextRun;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ColorUtil = void 0;
|
|
7
|
+
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
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
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); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
+
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); }
|
|
14
|
+
var ColorUtil = exports.ColorUtil = /*#__PURE__*/function () {
|
|
15
|
+
function ColorUtil() {
|
|
16
|
+
_classCallCheck(this, ColorUtil);
|
|
17
|
+
}
|
|
18
|
+
return _createClass(ColorUtil, null, [{
|
|
19
|
+
key: "color2Integers",
|
|
20
|
+
value: function color2Integers(color) {
|
|
21
|
+
color = color ? String(color) : '';
|
|
22
|
+
color = ColorUtil.colors[color.toLowerCase()] || color;
|
|
23
|
+
if (!color) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (color.startsWith('#')) {
|
|
27
|
+
color = color.slice(1);
|
|
28
|
+
color = color.length === 3 ? color.split('').map(function (char) {
|
|
29
|
+
return char + char;
|
|
30
|
+
}).join('') : color;
|
|
31
|
+
var bigint = parseInt(color, 16);
|
|
32
|
+
return [bigint >> 16 & 255, bigint >> 8 & 255, bigint & 255];
|
|
33
|
+
} else {
|
|
34
|
+
var rgbArray = color.match(/\d+/g);
|
|
35
|
+
return rgbArray && rgbArray.length === 3 ? rgbArray.map(Number) : undefined;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}]);
|
|
39
|
+
}();
|
|
40
|
+
_defineProperty(ColorUtil, "colors", {
|
|
41
|
+
aliceblue: "#f0f8ff",
|
|
42
|
+
antiquewhite: "#faebd7",
|
|
43
|
+
aqua: "#00ffff",
|
|
44
|
+
aquamarine: "#7fffd4",
|
|
45
|
+
azure: "#f0ffff",
|
|
46
|
+
beige: "#f5f5dc",
|
|
47
|
+
bisque: "#ffe4c4",
|
|
48
|
+
black: "#000000",
|
|
49
|
+
blanchedalmond: "#ffebcd",
|
|
50
|
+
blue: "#0000ff",
|
|
51
|
+
blueviolet: "#8a2be2",
|
|
52
|
+
brown: "#a52a2a",
|
|
53
|
+
burlywood: "#deb887",
|
|
54
|
+
cadetblue: "#5f9ea0",
|
|
55
|
+
chartreuse: "#7fff00",
|
|
56
|
+
chocolate: "#d2691e",
|
|
57
|
+
coral: "#ff7f50",
|
|
58
|
+
cornflowerblue: "#6495ed",
|
|
59
|
+
cornsilk: "#fff8dc",
|
|
60
|
+
crimson: "#dc143c",
|
|
61
|
+
cyan: "#00ffff",
|
|
62
|
+
darkblue: "#00008b",
|
|
63
|
+
darkcyan: "#008b8b",
|
|
64
|
+
darkgoldenrod: "#b8860b",
|
|
65
|
+
darkgray: "#a9a9a9",
|
|
66
|
+
darkgreen: "#006400",
|
|
67
|
+
darkkhaki: "#bdb76b",
|
|
68
|
+
darkmagenta: "#8b008b",
|
|
69
|
+
darkolivegreen: "#556b2f",
|
|
70
|
+
darkorange: "#ff8c00",
|
|
71
|
+
darkorchid: "#9932cc",
|
|
72
|
+
darkred: "#8b0000",
|
|
73
|
+
darksalmon: "#e9967a",
|
|
74
|
+
darkseagreen: "#8fbc8f",
|
|
75
|
+
darkslateblue: "#483d8b",
|
|
76
|
+
darkslategray: "#2f4f4f",
|
|
77
|
+
darkturquoise: "#00ced1",
|
|
78
|
+
darkviolet: "#9400d3",
|
|
79
|
+
deeppink: "#ff1493",
|
|
80
|
+
deepskyblue: "#00bfff",
|
|
81
|
+
dimgray: "#696969",
|
|
82
|
+
dodgerblue: "#1e90ff",
|
|
83
|
+
firebrick: "#b22222",
|
|
84
|
+
floralwhite: "#fffaf0",
|
|
85
|
+
forestgreen: "#228b22",
|
|
86
|
+
fuchsia: "#ff00ff",
|
|
87
|
+
gainsboro: "#dcdcdc",
|
|
88
|
+
ghostwhite: "#f8f8ff",
|
|
89
|
+
gold: "#ffd700",
|
|
90
|
+
goldenrod: "#daa520",
|
|
91
|
+
gray: "#808080",
|
|
92
|
+
green: "#008000",
|
|
93
|
+
greenyellow: "#adff2f",
|
|
94
|
+
honeydew: "#f0fff0",
|
|
95
|
+
hotpink: "#ff69b4",
|
|
96
|
+
indianred: "#cd5c5c",
|
|
97
|
+
indigo: "#4b0082",
|
|
98
|
+
ivory: "#fffff0",
|
|
99
|
+
khaki: "#f0e68c",
|
|
100
|
+
lavender: "#e6e6fa",
|
|
101
|
+
lavenderblush: "#fff0f5",
|
|
102
|
+
lawngreen: "#7cfc00",
|
|
103
|
+
lemonchiffon: "#fffacd",
|
|
104
|
+
lightblue: "#add8e6",
|
|
105
|
+
lightcoral: "#f08080",
|
|
106
|
+
lightcyan: "#e0ffff",
|
|
107
|
+
lightgoldenrodyellow: "#fafad2",
|
|
108
|
+
lightgrey: "#d3d3d3",
|
|
109
|
+
lightgreen: "#90ee90",
|
|
110
|
+
lightpink: "#ffb6c1",
|
|
111
|
+
lightsalmon: "#ffa07a",
|
|
112
|
+
lightseagreen: "#20b2aa",
|
|
113
|
+
lightskyblue: "#87cefa",
|
|
114
|
+
lightslategray: "#778899",
|
|
115
|
+
lightsteelblue: "#b0c4de",
|
|
116
|
+
lightyellow: "#ffffe0",
|
|
117
|
+
lime: "#00ff00",
|
|
118
|
+
limegreen: "#32cd32",
|
|
119
|
+
linen: "#faf0e6",
|
|
120
|
+
magenta: "#ff00ff",
|
|
121
|
+
maroon: "#800000",
|
|
122
|
+
mediumaquamarine: "#66cdaa",
|
|
123
|
+
mediumblue: "#0000cd",
|
|
124
|
+
mediumorchid: "#ba55d3",
|
|
125
|
+
mediumpurple: "#9370d8",
|
|
126
|
+
mediumseagreen: "#3cb371",
|
|
127
|
+
mediumslateblue: "#7b68ee",
|
|
128
|
+
mediumspringgreen: "#00fa9a",
|
|
129
|
+
mediumturquoise: "#48d1cc",
|
|
130
|
+
mediumvioletred: "#c71585",
|
|
131
|
+
midnightblue: "#191970",
|
|
132
|
+
mintcream: "#f5fffa",
|
|
133
|
+
mistyrose: "#ffe4e1",
|
|
134
|
+
moccasin: "#ffe4b5",
|
|
135
|
+
navajowhite: "#ffdead",
|
|
136
|
+
navy: "#000080",
|
|
137
|
+
oldlace: "#fdf5e6",
|
|
138
|
+
olive: "#808000",
|
|
139
|
+
olivedrab: "#6b8e23",
|
|
140
|
+
orange: "#ffa500",
|
|
141
|
+
orangered: "#ff4500",
|
|
142
|
+
orchid: "#da70d6",
|
|
143
|
+
palegoldenrod: "#eee8aa",
|
|
144
|
+
palegreen: "#98fb98",
|
|
145
|
+
paleturquoise: "#afeeee",
|
|
146
|
+
palevioletred: "#d87093",
|
|
147
|
+
papayawhip: "#ffefd5",
|
|
148
|
+
peachpuff: "#ffdab9",
|
|
149
|
+
peru: "#cd853f",
|
|
150
|
+
pink: "#ffc0cb",
|
|
151
|
+
plum: "#dda0dd",
|
|
152
|
+
powderblue: "#b0e0e6",
|
|
153
|
+
purple: "#800080",
|
|
154
|
+
rebeccapurple: "#663399",
|
|
155
|
+
red: "#ff0000",
|
|
156
|
+
rosybrown: "#bc8f8f",
|
|
157
|
+
royalblue: "#4169e1",
|
|
158
|
+
saddlebrown: "#8b4513",
|
|
159
|
+
salmon: "#fa8072",
|
|
160
|
+
sandybrown: "#f4a460",
|
|
161
|
+
seagreen: "#2e8b57",
|
|
162
|
+
seashell: "#fff5ee",
|
|
163
|
+
sienna: "#a0522d",
|
|
164
|
+
silver: "#c0c0c0",
|
|
165
|
+
skyblue: "#87ceeb",
|
|
166
|
+
slateblue: "#6a5acd",
|
|
167
|
+
slategray: "#708090",
|
|
168
|
+
snow: "#fffafa",
|
|
169
|
+
springgreen: "#00ff7f",
|
|
170
|
+
steelblue: "#4682b4",
|
|
171
|
+
tan: "#d2b48c",
|
|
172
|
+
teal: "#008080",
|
|
173
|
+
thistle: "#d8bfd8",
|
|
174
|
+
tomato: "#ff6347",
|
|
175
|
+
turquoise: "#40e0d0",
|
|
176
|
+
violet: "#ee82ee",
|
|
177
|
+
wheat: "#f5deb3",
|
|
178
|
+
white: "#ffffff",
|
|
179
|
+
whitesmoke: "#f5f5f5",
|
|
180
|
+
yellow: "#ffff00",
|
|
181
|
+
yellowgreen: "#9acd32"
|
|
182
|
+
});
|
package/build/Dim.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Dim = void 0;
|
|
7
|
+
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
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
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); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
|
+
var Dim = exports.Dim = /*#__PURE__*/function () {
|
|
14
|
+
function Dim() {
|
|
15
|
+
_classCallCheck(this, Dim);
|
|
16
|
+
this.screen = {
|
|
17
|
+
x: 0,
|
|
18
|
+
y: 0,
|
|
19
|
+
width: 0,
|
|
20
|
+
height: 0
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return _createClass(Dim, [{
|
|
24
|
+
key: "measureScreen",
|
|
25
|
+
value: function measureScreen() {
|
|
26
|
+
this.screen.width = document.documentElement.clientWidth || document.body.clientWidth;
|
|
27
|
+
this.screen.height = document.documentElement.clientHeight || document.body.clientHeight;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
}]);
|
|
31
|
+
}();
|
package/build/Easing.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Easing = void 0;
|
|
7
|
+
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
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
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); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
|
+
var Easing = exports.Easing = /*#__PURE__*/function () {
|
|
14
|
+
function Easing() {
|
|
15
|
+
_classCallCheck(this, Easing);
|
|
16
|
+
}
|
|
17
|
+
return _createClass(Easing, null, [{
|
|
18
|
+
key: "linear",
|
|
19
|
+
value: function linear(t) {
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
key: "inQuad",
|
|
24
|
+
value: function inQuad(t) {
|
|
25
|
+
return t * t;
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
key: "outQuad",
|
|
29
|
+
value: function outQuad(t) {
|
|
30
|
+
return t * (2 - t);
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
key: "outExpo",
|
|
34
|
+
value: function outExpo(t) {
|
|
35
|
+
return 1 - (1 - t) * (1 - t);
|
|
36
|
+
}
|
|
37
|
+
}, {
|
|
38
|
+
key: "circular",
|
|
39
|
+
value: function circular(t) {
|
|
40
|
+
return Math.sqrt(1 - --t * t);
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "inOutQuad",
|
|
44
|
+
value: function inOutQuad(t) {
|
|
45
|
+
return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "inOut",
|
|
49
|
+
value: function inOut(t) {
|
|
50
|
+
return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: "outElastic",
|
|
54
|
+
value: function outElastic(t) {
|
|
55
|
+
var c4 = 2 * Math.PI / 3;
|
|
56
|
+
return t === 0 ? 0 : t === 1 ? 1 : Math.pow(2, -10 * t) * Math.sin((t * 10 - 0.75) * c4) + 1;
|
|
57
|
+
}
|
|
58
|
+
}]);
|
|
59
|
+
}();
|