Commit efed272f authored by rockyl's avatar rockyl

更新tiny-image库

parent c1a8fe24
...@@ -2,10 +2,10 @@ var __extends;var __assign;var __rest;var __decorate;var __param;var __metadata; ...@@ -2,10 +2,10 @@ var __extends;var __assign;var __rest;var __decorate;var __param;var __metadata;
}};__exportStar=function(m,exports){for(var p in m){if(!exports.hasOwnProperty(p)){exports[p]=m[p]}}};__values=function(o){var m=typeof Symbol==="function"&&o[Symbol.iterator],i=0;if(m){return m.call(o)}return{next:function(){if(o&&i>=o.length){o=void 0}return{value:o&&o[i++],done:!o}}}};__read=function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m){return o}var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-->0)&&!(r=i.next()).done){ar.push(r.value)}}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"])){m.call(i)}}finally{if(e){throw e.error}}}return ar};__spread=function(){for(var ar=[],i=0;i<arguments.length;i++){ar=ar.concat(__read(arguments[i]))}return ar};__spreadArrays=function(){for(var s=0,i=0,il=arguments.length;i<il;i++){s+=arguments[i].length}for(var r=Array(s),k=0,i=0;i<il;i++){for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++){r[k]=a[j]}}return r};__await=function(v){return this instanceof __await?(this.v=v,this):new __await(v)};__asyncGenerator=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){if(g[n]){i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})}}}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){if(f(v),q.shift(),q.length){resume(q[0][0],q[0][1])}}};__asyncDelegator=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:n==="return"}:f?f(v):v}:f}};__asyncValues=function(o){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values==="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v){resolve({value:v,done:d})},reject)}};__makeTemplateObject=function(cooked,raw){if(Object.defineProperty){Object.defineProperty(cooked,"raw",{value:raw})}else{cooked.raw=raw}return cooked};__importStar=function(mod){if(mod&&mod.__esModule){return mod}var result={};if(mod!=null){for(var k in mod){if(Object.hasOwnProperty.call(mod,k)){result[k]=mod[k]}}}result["default"]=mod;return result};__importDefault=function(mod){return(mod&&mod.__esModule)?mod:{"default":mod}};exporter("__extends",__extends);exporter("__assign",__assign);exporter("__rest",__rest);exporter("__decorate",__decorate);exporter("__param",__param);exporter("__metadata",__metadata);exporter("__awaiter",__awaiter);exporter("__generator",__generator);exporter("__exportStar",__exportStar);exporter("__values",__values);exporter("__read",__read);exporter("__spread",__spread);exporter("__spreadArrays",__spreadArrays);exporter("__await",__await);exporter("__asyncGenerator",__asyncGenerator);exporter("__asyncDelegator",__asyncDelegator);exporter("__asyncValues",__asyncValues);exporter("__makeTemplateObject",__makeTemplateObject);exporter("__importStar",__importStar);exporter("__importDefault",__importDefault)}); }};__exportStar=function(m,exports){for(var p in m){if(!exports.hasOwnProperty(p)){exports[p]=m[p]}}};__values=function(o){var m=typeof Symbol==="function"&&o[Symbol.iterator],i=0;if(m){return m.call(o)}return{next:function(){if(o&&i>=o.length){o=void 0}return{value:o&&o[i++],done:!o}}}};__read=function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m){return o}var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-->0)&&!(r=i.next()).done){ar.push(r.value)}}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"])){m.call(i)}}finally{if(e){throw e.error}}}return ar};__spread=function(){for(var ar=[],i=0;i<arguments.length;i++){ar=ar.concat(__read(arguments[i]))}return ar};__spreadArrays=function(){for(var s=0,i=0,il=arguments.length;i<il;i++){s+=arguments[i].length}for(var r=Array(s),k=0,i=0;i<il;i++){for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++){r[k]=a[j]}}return r};__await=function(v){return this instanceof __await?(this.v=v,this):new __await(v)};__asyncGenerator=function(thisArg,_arguments,generator){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var g=generator.apply(thisArg,_arguments||[]),i,q=[];return i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i;function verb(n){if(g[n]){i[n]=function(v){return new Promise(function(a,b){q.push([n,v,a,b])>1||resume(n,v)})}}}function resume(n,v){try{step(g[n](v))}catch(e){settle(q[0][3],e)}}function step(r){r.value instanceof __await?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r)}function fulfill(value){resume("next",value)}function reject(value){resume("throw",value)}function settle(f,v){if(f(v),q.shift(),q.length){resume(q[0][0],q[0][1])}}};__asyncDelegator=function(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e}),verb("return"),i[Symbol.iterator]=function(){return this},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:n==="return"}:f?f(v):v}:f}};__asyncValues=function(o){if(!Symbol.asyncIterator){throw new TypeError("Symbol.asyncIterator is not defined.")}var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values==="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value)})}}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v){resolve({value:v,done:d})},reject)}};__makeTemplateObject=function(cooked,raw){if(Object.defineProperty){Object.defineProperty(cooked,"raw",{value:raw})}else{cooked.raw=raw}return cooked};__importStar=function(mod){if(mod&&mod.__esModule){return mod}var result={};if(mod!=null){for(var k in mod){if(Object.hasOwnProperty.call(mod,k)){result[k]=mod[k]}}}result["default"]=mod;return result};__importDefault=function(mod){return(mod&&mod.__esModule)?mod:{"default":mod}};exporter("__extends",__extends);exporter("__assign",__assign);exporter("__rest",__rest);exporter("__decorate",__decorate);exporter("__param",__param);exporter("__metadata",__metadata);exporter("__awaiter",__awaiter);exporter("__generator",__generator);exporter("__exportStar",__exportStar);exporter("__values",__values);exporter("__read",__read);exporter("__spread",__spread);exporter("__spreadArrays",__spreadArrays);exporter("__await",__await);exporter("__asyncGenerator",__asyncGenerator);exporter("__asyncDelegator",__asyncDelegator);exporter("__asyncValues",__asyncValues);exporter("__makeTemplateObject",__makeTemplateObject);exporter("__importStar",__importStar);exporter("__importDefault",__importDefault)});
var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: __decorate,__param: __param,__metadata: __metadata,__awaiter: __awaiter,__generator: __generator,__exportStar: __exportStar,__values: __values,__read: __read,__spread: __spread,__spreadArrays: __spreadArrays,__await: __await,__asyncGenerator: __asyncGenerator,__asyncDelegator: __asyncDelegator,__asyncValues: __asyncValues,__makeTemplateObject: __makeTemplateObject,__importStar: __importStar,__importDefault: __importDefault}; var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: __decorate,__param: __param,__metadata: __metadata,__awaiter: __awaiter,__generator: __generator,__exportStar: __exportStar,__values: __values,__read: __read,__spread: __spread,__spreadArrays: __spreadArrays,__await: __await,__asyncGenerator: __asyncGenerator,__asyncDelegator: __asyncDelegator,__asyncValues: __asyncValues,__makeTemplateObject: __makeTemplateObject,__importStar: __importStar,__importDefault: __importDefault};
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib')) : typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('props-compute')) :
typeof define === 'function' && define.amd ? define(['exports', 'tslib'], factory) : typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'props-compute'], factory) :
(global = global || self, factory(global.engine = {}, global.tslib)); (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.engine = {}, global.tslib, global.propsCompute));
}(this, function (exports, tslib_1) { 'use strict'; }(this, (function (exports, tslib_1, propsCompute) { 'use strict';
var HashObject = (function () { var HashObject = (function () {
function HashObject() { function HashObject() {
...@@ -1413,6 +1413,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1413,6 +1413,9 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}); });
Object.defineProperty(DisplayObject.prototype, "scale", { Object.defineProperty(DisplayObject.prototype, "scale", {
get: function () { get: function () {
if (this.destroyed) {
return 1;
}
return this.transform.scale; return this.transform.scale;
}, },
set: function (value) { set: function (value) {
...@@ -1934,13 +1937,20 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -1934,13 +1937,20 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
var _this = this; var _this = this;
var list = this.alignList; var list = this.alignList;
list.forEach(function (v) { list.forEach(function (v) {
if (v.destroyed) {
return;
}
_this.autoSize(v); _this.autoSize(v);
_this.align(v); _this.align(v);
}); });
list.forEach(function (v) { list.forEach(function (v) {
if (v.destroyed) {
return;
}
if (v.alignMode === ALIGN_MODE.ONCE) { if (v.alignMode === ALIGN_MODE.ONCE) {
v.alignEnabled = false; v.alignEnabled = false;
} }
v.onLayoutComplete && v.onLayoutComplete();
}); });
list.length = 0; list.length = 0;
}; };
...@@ -3257,11 +3267,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3257,11 +3267,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
}; };
Container.prototype.attachVisibility = function () { Container.prototype.attachVisibility = function () {
return; return;
this.dispatchEvent(this.worldVisible ? Event.VISIBLE : Event.HIDDEN);
for (var i = 0, li = this.children.length; i < li; i++) {
var child = this.children[i];
child.attachVisibility();
}
}; };
Container.prototype.addChild = function (child) { Container.prototype.addChild = function (child) {
this.addChildAt(child, this.children.length); this.addChildAt(child, this.children.length);
...@@ -3831,11 +3836,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3831,11 +3836,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
_this._transformID = -1; _this._transformID = -1;
return _this; return _this;
} }
FloatDisplay.prototype.addHtmlElement = function () { FloatDisplay.prototype.addHtmlElement = function (el) {
var s = this; var s = this;
if (!s.stage) {
return;
}
if (!container) { if (!container) {
container = document.createElement('div'); container = document.createElement('div');
container.style.position = "absolute"; container.style.position = "absolute";
...@@ -3846,24 +3848,33 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3846,24 +3848,33 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
s.stage.rootDiv.appendChild(container); s.stage.rootDiv.appendChild(container);
} }
if (s._htmlElement) { if (s._htmlElement) {
var style = s._htmlElement.style; try {
container.removeChild(s._htmlElement);
}
catch (e) {
}
}
if (el) {
s._htmlElement = el;
}
container.appendChild(s._htmlElement);
if (!s._isAdded) { if (!s._isAdded) {
s._isAdded = true; s._isAdded = true;
container.appendChild(s._htmlElement);
s.stage["_floatDisplayList"].push(s); s.stage["_floatDisplayList"].push(s);
} }
else { else {
if (s._htmlElement && s.visible) { if (s._htmlElement && s.visible) {
var style = s._htmlElement.style;
style.display = "block"; style.display = "block";
} }
} }
}
}; };
Object.defineProperty(FloatDisplay.prototype, "htmlElement", { Object.defineProperty(FloatDisplay.prototype, "htmlElement", {
get: function () { get: function () {
return this._htmlElement; return this._htmlElement;
}, },
set: function (v) { set: function (v) {
this._shouldUpdateStyle = true;
this.init(v); this.init(v);
this.updateStyle(); this.updateStyle();
}, },
...@@ -3904,8 +3915,11 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3904,8 +3915,11 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
s._localBoundsSelf.width = w; s._localBoundsSelf.width = w;
s._localBoundsSelf.height = h; s._localBoundsSelf.height = h;
if (!s.stage) {
s._htmlElement = she; s._htmlElement = she;
this.addHtmlElement(); return;
}
this.addHtmlElement(she);
}; };
FloatDisplay.prototype.getStyle = function (elem, cssName) { FloatDisplay.prototype.getStyle = function (elem, cssName) {
if (elem.style[cssName]) { if (elem.style[cssName]) {
...@@ -3943,7 +3957,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -3943,7 +3957,8 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
style.display = show; style.display = show;
} }
if (visible) { if (visible) {
if (this._transformID != this.transform._worldID) { if (this._shouldUpdateStyle || this._transformID != this.transform._worldID) {
this._shouldUpdateStyle = false;
this._transformID = this.transform._worldID; this._transformID = this.transform._worldID;
var mtx = s.transform.worldMatrix; var mtx = s.transform.worldMatrix;
var d = devicePixelRatio; var d = devicePixelRatio;
...@@ -4870,7 +4885,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -4870,7 +4885,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
} }
function determineCrossOrigin(url, loc) { function determineCrossOrigin(url, loc) {
if (loc === void 0) { loc = window.location; }
if (url.indexOf('data:') === 0) { if (url.indexOf('data:') === 0) {
return ''; return '';
} }
...@@ -5600,7 +5614,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -5600,7 +5614,7 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return color; return color;
} }
function inputFeildIosEnable() { function inputFeildIosEnable() {
var u = navigator.userAgent, app = navigator.appVersion; var u = navigator.userAgent;
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
if (isIOS) { if (isIOS) {
setTimeout(function () { setTimeout(function () {
...@@ -16011,1052 +16025,1060 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -16011,1052 +16025,1060 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return EditableText; return EditableText;
}(TextField)); }(TextField));
var ScrollViewBase = (function (_super) { var Tween = (function () {
tslib_1.__extends(ScrollViewBase, _super); function Tween(target, props, pluginData) {
function ScrollViewBase(maxDistance, isFull) { this._target = null;
if (isFull === void 0) { isFull = false; } this._useTicks = false;
var _this = _super.call(this) || this; this.ignoreGlobalPause = false;
_this.distance = 0; this.loop = false;
_this.minDis = 0; this.pluginData = null;
_this.maskObj = new Graphics(); this._steps = null;
_this.viewPort = new Container(); this.paused = false;
_this.lastValue = 0; this.duration = 0;
_this.speed = 0; this._prevPos = -1;
_this.addSpeed = 0; this.position = null;
_this.isStop = true; this._prevPosition = 0;
_this.maxSpeed = 100; this._stepPosition = 0;
_this.fSpeed = 20; this.passive = false;
_this.paramXY = "y"; this.initialize(target, props, pluginData);
_this.paramSize = "height";
_this.stopTimes = -1;
_this.isMouseDownState = 0;
_this.autoScroll = false;
_this.isSpringBack = true;
var s = _this;
s._instanceType = "ScrollContainer";
_super.prototype.addChild.call(_this, s.maskObj);
_super.prototype.addChild.call(_this, s.viewPort);
if (!isFull) {
s.viewPort.mask = s.maskObj;
s.maskObj.isUsedToMask = false;
} }
s.maskObj.alpha = 0; Tween.get = function (target, props, pluginData, override) {
s.updateViewRect(); if (pluginData === void 0) { pluginData = null; }
s.direction = exports.SCROLL_DIRECTION.VERTICAL; if (override === void 0) { override = false; }
s.addEventListener(Event.ADDED_TO_STAGE, function (e) { if (override) {
s.stage.addEventListener(MouseEvent.MOUSE_UP, s.onMouseEvent, s); Tween.removeTweens(target);
s.stage.addEventListener(MouseEvent.MOUSE_MOVE, s.onMouseEvent, s);
});
s.addEventListener(Event.REMOVED_FROM_STAGE, function (e) {
s.stage.removeEventListener(MouseEvent.MOUSE_UP, s.onMouseEvent, s);
s.stage.removeEventListener(MouseEvent.MOUSE_MOVE, s.onMouseEvent, s);
});
s.addEventListener(MouseEvent.MOUSE_DOWN, s.onMouseEvent, s, false);
s.addEventListener(Event.ENTER_FRAME, function () {
var view = s.viewPort;
if (s.autoScroll)
return;
if (!s.isSpringBack) {
if (view[s.paramXY] > 0) {
s.addSpeed = 0;
s.speed = 0;
s.isStop = true;
view[s.paramXY] = 0;
return;
} }
else if (view[s.paramXY] < s.distance - s.maxDistance) { return new Tween(target, props, pluginData);
s.addSpeed = 0; };
s.speed = 0; Tween.removeTweens = function (target) {
s.isStop = true; if (!target.tween_count) {
view[s.paramXY] = Math.min(0, s.distance - s.maxDistance);
return; return;
} }
var tweens = Tween._tweens;
for (var i = tweens.length - 1; i >= 0; i--) {
if (tweens[i]._target == target) {
tweens[i].paused = true;
tweens.splice(i, 1);
} }
if (!s.isStop) {
if (Math.abs(s.speed) > 0) {
view[s.paramXY] += s.speed;
if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) {
s.speed += s.addSpeed * s.fSpeed;
} }
else { target.tween_count = 0;
s.speed += s.addSpeed; };
Tween.pauseTweens = function (target) {
if (!target.tween_count) {
return;
} }
if (s.speed * s.addSpeed > 0) { var tweens = Tween._tweens;
s.dispatchEvent(Event.ON_SCROLL_STOP); for (var i = tweens.length - 1; i >= 0; i--) {
s.speed = 0; if (tweens[i]._target == target) {
tweens[i].paused = true;
} }
} }
else { };
if (s.addSpeed != 0) { Tween.resumeTweens = function (target) {
if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) { if (!target.tween_count) {
var tarP = 0; return;
if (view[s.paramXY] < s.distance - s.maxDistance) {
if (s.distance < s.maxDistance) {
tarP = s.distance - s.maxDistance;
} }
var tweens = Tween._tweens;
for (var i = tweens.length - 1; i >= 0; i--) {
if (tweens[i]._target == target) {
tweens[i].paused = false;
} }
view[s.paramXY] += 0.4 * (tarP - view[s.paramXY]);
if (Math.abs(tarP - view[s.paramXY]) < 0.1) {
s.isStop = true;
if (s.addSpeed > 0) {
s.dispatchEvent(Event.ON_SCROLL_TO_END);
} }
else { };
s.dispatchEvent(Event.ON_SCROLL_TO_HEAD); Tween.tick = function (timeStamp, paused) {
if (paused === void 0) { paused = false; }
var delta = timeStamp - Tween._lastTime;
Tween._lastTime = timeStamp;
var tweens = Tween._tweens.concat();
for (var i = tweens.length - 1; i >= 0; i--) {
var tween = tweens[i];
if ((paused && !tween.ignoreGlobalPause) || tween.paused) {
continue;
} }
tween.$tick(tween._useTicks ? 1 : delta);
} }
return false;
};
Tween.flush = function () {
var timeStamp = Date.now();
var delta = Tween._lastTime ? (timeStamp - Tween._lastTime) : 16.67;
Tween._lastTime = timeStamp;
var tweens = Tween._tweens.concat();
for (var i = tweens.length - 1; i >= 0; i--) {
var tween = tweens[i];
if (tween.paused) {
continue;
} }
tween.$tick(tween._useTicks ? 1 : delta);
} }
else { };
s.isStop = true; Tween._register = function (tween, value) {
var target = tween._target;
var tweens = Tween._tweens;
if (value) {
if (target) {
target.tween_count = target.tween_count > 0 ? target.tween_count + 1 : 1;
} }
tweens.push(tween);
if (!Tween._inited) {
Tween._inited = true;
} }
} }
else { else {
if (s.stopTimes >= 0) { if (target) {
if (s.stopTimes >= 15) { target.tween_count--;
s.speed = 0;
if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) {
s.isStop = false;
s.stopTimes = -1;
} }
var i = tweens.length;
while (i--) {
if (tweens[i] == tween) {
tweens.splice(i, 1);
return;
} }
} }
} }
}); };
s.addEventListener(Event.RESIZE, _this.updateViewRect, s); Tween.removeAllTweens = function () {
return _this; var tweens = Tween._tweens;
for (var i = 0, l = tweens.length; i < l; i++) {
var tween = tweens[i];
tween.paused = true;
tween._target.tween_count = 0;
} }
Object.defineProperty(ScrollViewBase.prototype, "maxDistance", { tweens.length = 0;
get: function () {
return this.calMaxDistance();
},
enumerable: true,
configurable: true
});
ScrollViewBase.prototype.calMaxDistance = function () {
return this.viewPort[this.paramSize] + this.viewPort.getLocalBounds()[this.paramXY];
}; };
Object.defineProperty(ScrollViewBase.prototype, "direction", { Tween.prototype.initialize = function (target, props, pluginData) {
get: function () { this._target = target;
return this._direction; if (props) {
}, this._useTicks = props.useTicks;
set: function (value) { this.ignoreGlobalPause = props.ignoreGlobalPause;
this._direction = value; this.loop = props.loop;
this.updateDirection(); if (props.onChange) {
}, this.onChange = props.onChange.bind(props.onChangeObj);
enumerable: true,
configurable: true
});
ScrollViewBase.prototype.updateDirection = function () {
var s = this;
if (this._direction === exports.SCROLL_DIRECTION.VERTICAL) {
s.distance = s.height;
s.paramXY = "y";
s.paramSize = 'height';
} }
else { else {
s.distance = s.width; this.onChange = null;
s.paramXY = "x";
s.paramSize = 'width';
} }
}; if (props.override) {
ScrollViewBase.prototype.updateViewRect = function () { Tween.removeTweens(target);
var s = this;
s.maskObj.clear();
s.maskObj.beginFill("#000000");
s.maskObj.drawRect(0, 0, s.width, s.height);
s.maskObj.endFill();
this.updateDirection();
};
ScrollViewBase.prototype.cancelScroll = function () {
this.isMouseDownState = 0;
};
ScrollViewBase.prototype.onMouseEvent = function (e) {
var s = this;
var view = s.viewPort;
if (e.type == MouseEvent.MOUSE_DOWN) {
e.stopPropagation();
if (!s.isStop) {
s.isStop = true;
} }
if (s.autoScroll) {
s.autoScroll = false;
} }
if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) { this.pluginData = pluginData || {};
s.lastValue = e.stageY; this._curQueueProps = {};
this._initQueueProps = {};
this._steps = [];
if (props && props.paused) {
this.paused = true;
} }
else { else {
s.lastValue = e.stageX; Tween._register(this, true);
} }
s.speed = 0; if (props && props.position != null) {
s.isMouseDownState = 1; this.setPosition(props.position, Tween.NONE);
} }
else if (e.type == MouseEvent.MOUSE_MOVE) { };
if (s.isMouseDownState == 0) Tween.prototype.setPosition = function (value, actionsMode) {
return; if (actionsMode === void 0) { actionsMode = 1; }
if (s.isMouseDownState == 1) { if (value < 0) {
s.dispatchEvent(Event.ON_SCROLL_START); value = 0;
} }
s.isMouseDownState = 2; var t = value;
var currentValue = void 0; var end = false;
if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) { if (t >= this.duration) {
currentValue = e.stageY; if (this.loop) {
var newTime = t % this.duration;
if (t > 0 && newTime === 0) {
t = this.duration;
} }
else { else {
currentValue = e.stageX; t = newTime;
}
s.speed = currentValue - s.lastValue;
if (s.speed > s.minDis) {
s.addSpeed = -2;
if (s.speed > s.maxSpeed) {
s.speed = s.maxSpeed;
}
}
else if (s.speed < -s.minDis) {
if (s.speed < -s.maxSpeed) {
s.speed = -s.maxSpeed;
} }
s.addSpeed = 2;
} }
else { else {
s.speed = 0; t = this.duration;
end = true;
} }
if (s.speed != 0) {
var speedPer = 1;
if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) {
speedPer = 0.2;
} }
view[s.paramXY] += (currentValue - s.lastValue) * speedPer; if (t == this._prevPos) {
return end;
} }
s.lastValue = currentValue; if (end) {
s.stopTimes = 0; this.setPaused(true);
} }
else { var prevPos = this._prevPos;
s.isStop = false; this.position = this._prevPos = t;
s.stopTimes = -1; this._prevPosition = value;
if (s.speed == 0 && s.isMouseDownState == 2) { if (this._target) {
s.dispatchEvent(Event.ON_SCROLL_STOP); if (this._steps.length > 0) {
var l = this._steps.length;
var stepIndex = -1;
for (var i = 0; i < l; i++) {
if (this._steps[i].type == "step") {
stepIndex = i;
if (this._steps[i].t <= t && this._steps[i].t + this._steps[i].d >= t) {
break;
} }
s.isMouseDownState = 0;
} }
};
ScrollViewBase.prototype.scrollTo = function (dis, time) {
var s = this;
var newDis = s.paramXY == "x" ? s.width : s.height;
if (dis < 0) {
dis = 0;
} }
else if (dis > s.maxDistance - newDis) { for (var i = 0; i < l; i++) {
dis = s.maxDistance - newDis; if (this._steps[i].type == "action") {
if (actionsMode != 0) {
if (this._useTicks) {
this._runAction(this._steps[i], t, t);
} }
if (Math.abs(s.viewPort[s.paramXY] + dis) > 2) { else if (actionsMode == 1 && t < prevPos) {
s.isStop = true; if (prevPos != this.duration) {
s.isMouseDownState = 0; this._runAction(this._steps[i], prevPos, this.duration);
s.viewPort[s.paramXY] = -dis;
} }
}; this._runAction(this._steps[i], 0, t, true);
ScrollViewBase.prototype.destroy = function () {
var s = this;
s.maskObj.destroy();
s.viewPort.destroy();
s.maskObj = null;
s.viewPort = null;
_super.prototype.destroy.call(this);
};
return ScrollViewBase;
}(Container));
function fieldChanged(onModify) {
return function (target, key) {
var privateKey = '_' + key;
Object.defineProperty(target, key, {
enumerable: true,
get: function () {
return this[privateKey];
},
set: function (v) {
var oldValue = this[privateKey];
if (oldValue !== v) {
this[privateKey] = v;
onModify.apply(this, [v, key, oldValue]);
} }
else {
this._runAction(this._steps[i], prevPos, t);
} }
});
};
} }
var dirtyFieldDetector = fieldChanged(function (value, key, oldValue) {
this['__fieldDirty'] = true;
});
var deepDirtyFieldDetector = fieldChanged(function (value, key, oldValue) {
var scope = this;
scope['__fieldDirty'] = true;
if (typeof value === 'object') {
value['onModify'] = function () {
scope['__fieldDirty'] = true;
};
} }
}); else if (this._steps[i].type == "step") {
var dirtyFieldTrigger = fieldChanged(function (value, key, oldValue) { if (stepIndex == i) {
this['onModify'] && this['onModify'](value, key, oldValue); var step = this._steps[stepIndex];
}); this._updateTargetProps(step, Math.min((this._stepPosition = t - step.t) / step.d, 1));
var deepDirtyFieldTrigger = fieldChanged(function (value, key, oldValue) {
if (this['onModify']) {
this['onModify'](value, key, oldValue);
if (typeof value === 'object') {
value['onModify'] = this['onModify'];
} }
} }
});
var ScrollListItemBase = (function (_super) {
tslib_1.__extends(ScrollListItemBase, _super);
function ScrollListItemBase() {
return _super !== null && _super.apply(this, arguments) || this;
} }
ScrollListItemBase.prototype._initData = function (id, data) {
this.id = id;
this.data = data;
if (id >= 0) {
this.updateData(data);
} }
};
return ScrollListItemBase;
}(Container));
var ScrollListBase = (function (_super) {
tslib_1.__extends(ScrollListBase, _super);
function ScrollListBase() {
var _this = _super.call(this) || this;
_this._items = null;
_this._isInit = 0;
_this.data = [];
_this.downL = null;
_this._lastFirstId = -1;
_this._updateId = -1;
_this.itemWidth = 0;
_this.itemHeight = 0;
_this.cols = 1;
var s = _this;
s._instanceType = "ScrollList";
s._items = [];
s._itemCount = 0;
s.once(Event.ENTER_FRAME, s.onNextFrame, s);
s.addEventListener(Event.ENTER_FRAME, s.flushData.bind(s));
return _this;
} }
Object.defineProperty(ScrollListBase.prototype, "loadingView", { this.onChange && this.onChange();
get: function () { return end;
return this.downL;
},
enumerable: true,
configurable: true
});
ScrollListBase.prototype.onNextFrame = function (event) {
this.updateViewRect();
};
ScrollListBase.prototype.onModify = function (value, key) {
};
ScrollListBase.prototype.calMaxDistance = function () {
var key = 'item' + this.paramSize.substr(0, 1).toUpperCase() + this.paramSize.substr(1);
return this[key] * Math.ceil(this.data.length / this.cols);
}; };
ScrollListBase.prototype.updateData = function (data, isReset) { Tween.prototype._runAction = function (action, startPos, endPos, includeStart) {
if (isReset === void 0) { isReset = true; } if (includeStart === void 0) { includeStart = false; }
var s = this; var sPos = startPos;
if (!s._isInit || isReset) { var ePos = endPos;
s.data = data; if (startPos > endPos) {
sPos = endPos;
ePos = startPos;
} }
else { var pos = action.t;
s.data = s.data.concat(data); if (pos == ePos || (pos > sPos && pos < ePos) || (includeStart && pos == startPos)) {
action.f.apply(action.o, action.p);
} }
s._isInit = 1;
s._lastFirstId = -1;
}; };
ScrollListBase.prototype.flushData = function () { Tween.prototype._updateTargetProps = function (step, ratio) {
var s = this; var p0, p1, v, v0, v1, arr;
var items = s._items; if (!step && ratio == 1) {
if (items.length <= 0) { this.passive = false;
p0 = p1 = this._curQueueProps;
}
else {
this.passive = !!step.v;
if (this.passive) {
return; return;
} }
if (s._isInit > 0) { if (step.e) {
if (s._updateId != s.viewPort.transform._localID) { ratio = step.e(ratio, 0, 1, 1);
var id = s.viewPort[s.paramXY] > 0 ? 0 : (Math.abs(Math.floor(s.viewPort[s.paramXY] / s._itemRow)) - 1) * s.cols;
id = id < 0 ? 0 : id;
if (id != s._lastFirstId) {
s._lastFirstId = id;
if (id != items[0].id) {
for (var r = 0; r < s.cols; r++) {
if (s.speed > 0) {
items.unshift(items.pop());
}
else {
items.push(items.shift());
} }
p0 = step.p0;
p1 = step.p1;
} }
for (var n in this._initQueueProps) {
if ((v0 = p0[n]) == null) {
p0[n] = v0 = this._initQueueProps[n];
} }
if ((v1 = p1[n]) == null) {
p1[n] = v1 = v0;
} }
for (var i = 0; i < s._itemCount; i++) { if (v0 == v1 || ratio == 0 || ratio == 1 || (typeof (v0) != "number")) {
var item = items[i]; v = ratio == 1 ? v1 : v0;
if (s._isInit == 1) {
item.sli_id = -1;
} }
if (item.sli_id != id) { else {
if (s.data[id]) { v = v0 + (v1 - v0) * ratio;
item._initData(s.data[id] ? id : -1, s.data[id]);
} }
item[s.paramXY] = Math.floor(id / s.cols) * s._itemRow; var ignore = false;
item[s._disParam] = (id % s.cols) * s._itemCol; if (arr = Tween._plugins[n]) {
if (s.data[id]) { for (var i = 0, l = arr.length; i < l; i++) {
item.sli_id = id; var v2 = arr[i].tween(this, n, v, p0, p1, ratio, !!step && p0 == p1, !step);
item.visible = true; if (v2 == Tween.IGNORE) {
ignore = true;
} }
else { else {
item.sli_id = -1; v = v2;
item.visible = false;
} }
} }
id++;
} }
s._isInit = 2; if (!ignore) {
this._target[n] = v;
} }
} }
}; };
ScrollListBase.prototype.updateViewRect = function () { Tween.prototype.setPaused = function (value) {
_super.prototype.updateViewRect.call(this); if (this.paused == value) {
var s = this; return this;
if (s.itemWidth && s.itemHeight) {
s._updateViewRect();
} }
this.paused = value;
Tween._register(this, !value);
return this;
}; };
ScrollListBase.prototype._updateViewRect = function () { Tween.prototype._cloneProps = function (props) {
var s = this; var o = {};
if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) { for (var n in props) {
if (s.itemHeight <= 0) { o[n] = props[n];
return;
}
s._disParam = "x";
s._itemRow = s.itemHeight;
s._itemCol = s.itemWidth;
} }
else { return o;
if (s.itemWidth <= 0) { };
return; Tween.prototype._addStep = function (o) {
if (o.d > 0) {
o.type = "step";
this._steps.push(o);
o.t = this.duration;
this.duration += o.d;
} }
s._disParam = "y"; return this;
s._itemRow = s.itemWidth; };
s._itemCol = s.itemHeight; Tween.prototype._appendQueueProps = function (o) {
var arr, oldValue, i, l, injectProps;
for (var n in o) {
if (this._initQueueProps[n] === undefined) {
oldValue = this._target[n];
if (arr = Tween._plugins[n]) {
for (i = 0, l = arr.length; i < l; i++) {
oldValue = arr[i].init(this, n, oldValue);
} }
var newCount = (Math.ceil(s.distance / s._itemRow) + 1) * s.cols;
if (newCount != s._itemCount) {
if (newCount > s._itemCount) {
for (var i = s._itemCount; i < newCount; i++) {
var item = s.createItem();
item.id = -1;
item.data = null;
s._items.push(item);
s.viewPort.addChild(item);
} }
this._initQueueProps[n] = this._curQueueProps[n] = (oldValue === undefined) ? null : oldValue;
} }
else { else {
for (var i = 0; i < s._itemCount - newCount; i++) { oldValue = this._curQueueProps[n];
s.viewPort.removeChild(s._items.pop());
} }
} }
s._itemCount = newCount; for (var n in o) {
s._lastFirstId = -1; oldValue = this._curQueueProps[n];
if (arr = Tween._plugins[n]) {
injectProps = injectProps || {};
for (i = 0, l = arr.length; i < l; i++) {
if (arr[i].step) {
arr[i].step(this, n, oldValue, o[n], injectProps);
} }
};
ScrollListBase.prototype.createItem = function () {
return new this.itemClass();
};
ScrollListBase.prototype.setLoading = function (downLoading) {
var s = this;
if (s.downL) {
s.viewPort.removeChild(s.downL);
s.downL = null;
} }
if (downLoading) {
s.downL = downLoading;
s.viewPort.addChild(downLoading);
s.downL[s.paramXY] = Math.max(s.distance, s.maxDistance);
} }
else { this._curQueueProps[n] = o[n];
s.isStop = false;
} }
if (injectProps) {
this._appendQueueProps(injectProps);
}
return this._curQueueProps;
}; };
ScrollListBase.prototype.destroy = function () { Tween.prototype._addAction = function (o) {
var s = this; o.t = this.duration;
s._items = null; o.type = "action";
s.itemClass = null; this._steps.push(o);
s.data = null; return this;
s.downL = null;
_super.prototype.destroy.call(this);
}; };
tslib_1.__decorate([ Tween.prototype._set = function (props, o) {
dirtyFieldTrigger for (var n in props) {
], ScrollListBase.prototype, "itemWidth", void 0); o[n] = props[n];
tslib_1.__decorate([
dirtyFieldTrigger
], ScrollListBase.prototype, "itemHeight", void 0);
tslib_1.__decorate([
dirtyFieldTrigger
], ScrollListBase.prototype, "cols", void 0);
tslib_1.__decorate([
dirtyFieldTrigger
], ScrollListBase.prototype, "itemClass", void 0);
return ScrollListBase;
}(ScrollViewBase));
var Tween = (function () {
function Tween(target, props, pluginData) {
this._target = null;
this._useTicks = false;
this.ignoreGlobalPause = false;
this.loop = false;
this.pluginData = null;
this._steps = null;
this.paused = false;
this.duration = 0;
this._prevPos = -1;
this.position = null;
this._prevPosition = 0;
this._stepPosition = 0;
this.passive = false;
this.initialize(target, props, pluginData);
}
Tween.get = function (target, props, pluginData, override) {
if (pluginData === void 0) { pluginData = null; }
if (override === void 0) { override = false; }
if (override) {
Tween.removeTweens(target);
} }
return new Tween(target, props, pluginData);
}; };
Tween.removeTweens = function (target) { Tween.prototype.wait = function (duration, passive) {
if (!target.tween_count) { if (duration == null || duration <= 0) {
return; return this;
}
var tweens = Tween._tweens;
for (var i = tweens.length - 1; i >= 0; i--) {
if (tweens[i]._target == target) {
tweens[i].paused = true;
tweens.splice(i, 1);
}
} }
target.tween_count = 0; var o = this._cloneProps(this._curQueueProps);
return this._addStep({ d: duration, p0: o, p1: o, v: passive });
}; };
Tween.pauseTweens = function (target) { Tween.prototype.to = function (props, duration, ease) {
if (!target.tween_count) { if (ease === void 0) { ease = undefined; }
return; if (isNaN(duration) || duration < 0) {
duration = 0;
} }
var tweens = Tween._tweens; this._addStep({ d: duration || 0, p0: this._cloneProps(this._curQueueProps), e: ease, p1: this._cloneProps(this._appendQueueProps(props)) });
for (var i = tweens.length - 1; i >= 0; i--) { return this.set(props);
if (tweens[i]._target == target) { };
tweens[i].paused = true; Tween.prototype.call = function (callback, thisObj, params) {
if (thisObj === void 0) { thisObj = undefined; }
if (params === void 0) { params = undefined; }
return this._addAction({ f: callback, p: params ? params : [], o: thisObj ? thisObj : this._target });
};
Tween.prototype.set = function (props, target) {
if (target === void 0) { target = null; }
this._appendQueueProps(props);
return this._addAction({ f: this._set, o: this, p: [props, target ? target : this._target] });
};
Tween.prototype.play = function (tween) {
if (!tween) {
tween = this;
} }
return this.call(tween.setPaused, tween, [false]);
};
Tween.prototype.pause = function (tween) {
if (!tween) {
tween = this;
} }
return this.call(tween.setPaused, tween, [true]);
}; };
Tween.resumeTweens = function (target) { Tween.prototype.$tick = function (delta) {
if (!target.tween_count) { if (this.paused) {
return; return;
} }
var tweens = Tween._tweens; this.setPosition(this._prevPosition + delta);
for (var i = tweens.length - 1; i >= 0; i--) {
if (tweens[i]._target == target) {
tweens[i].paused = false;
}
}
}; };
Tween.tick = function (timeStamp, paused) { Tween.NONE = 0;
if (paused === void 0) { paused = false; } Tween.LOOP = 1;
var delta = timeStamp - Tween._lastTime; Tween.REVERSE = 2;
Tween._lastTime = timeStamp; Tween._tweens = [];
var tweens = Tween._tweens.concat(); Tween.IGNORE = {};
for (var i = tweens.length - 1; i >= 0; i--) { Tween._plugins = {};
var tween = tweens[i]; Tween._inited = false;
if ((paused && !tween.ignoreGlobalPause) || tween.paused) { Tween._lastTime = 0;
continue; return Tween;
}());
var Ease = (function () {
function Ease() {
} }
tween.$tick(tween._useTicks ? 1 : delta); Ease.get = function (amount) {
if (amount < -1) {
amount = -1;
} }
return false; if (amount > 1) {
}; amount = 1;
Tween.flush = function () {
var timeStamp = Date.now();
var delta = Tween._lastTime ? (timeStamp - Tween._lastTime) : 16.67;
Tween._lastTime = timeStamp;
var tweens = Tween._tweens.concat();
for (var i = tweens.length - 1; i >= 0; i--) {
var tween = tweens[i];
if (tween.paused) {
continue;
} }
tween.$tick(tween._useTicks ? 1 : delta); return function (t) {
if (amount == 0) {
return t;
} }
if (amount < 0) {
return t * (t * -amount + 1 + amount);
}
return t * ((2 - t) * amount + (1 - amount));
}; };
Tween._register = function (tween, value) { };
var target = tween._target; Ease.getPowIn = function (pow) {
var tweens = Tween._tweens; return function (t) {
if (value) { return Math.pow(t, pow);
if (target) { };
target.tween_count = target.tween_count > 0 ? target.tween_count + 1 : 1; };
Ease.getPowOut = function (pow) {
return function (t) {
return 1 - Math.pow(1 - t, pow);
};
};
Ease.getPowInOut = function (pow) {
return function (t) {
if ((t *= 2) < 1)
return 0.5 * Math.pow(t, pow);
return 1 - 0.5 * Math.abs(Math.pow(2 - t, pow));
};
};
Ease.sineIn = function (t) {
return 1 - Math.cos(t * Math.PI / 2);
};
Ease.sineOut = function (t) {
return Math.sin(t * Math.PI / 2);
};
Ease.sineInOut = function (t) {
return -0.5 * (Math.cos(Math.PI * t) - 1);
};
Ease.getBackIn = function (amount) {
return function (t) {
return t * t * ((amount + 1) * t - amount);
};
};
Ease.getBackOut = function (amount) {
return function (t) {
return (--t * t * ((amount + 1) * t + amount) + 1);
};
};
Ease.getBackInOut = function (amount) {
amount *= 1.525;
return function (t) {
if ((t *= 2) < 1)
return 0.5 * (t * t * ((amount + 1) * t - amount));
return 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2);
};
};
Ease.circIn = function (t) {
return -(Math.sqrt(1 - t * t) - 1);
};
Ease.circOut = function (t) {
return Math.sqrt(1 - (--t) * t);
};
Ease.circInOut = function (t) {
if ((t *= 2) < 1) {
return -0.5 * (Math.sqrt(1 - t * t) - 1);
} }
tweens.push(tween); return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
if (!Tween._inited) { };
Tween._inited = true; Ease.bounceIn = function (t) {
return 1 - Ease.bounceOut(1 - t);
};
Ease.bounceOut = function (t) {
if (t < 1 / 2.75) {
return (7.5625 * t * t);
}
else if (t < 2 / 2.75) {
return (7.5625 * (t -= 1.5 / 2.75) * t + 0.75);
} }
else if (t < 2.5 / 2.75) {
return (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375);
} }
else { else {
if (target) { return (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);
target.tween_count--;
} }
var i = tweens.length; };
while (i--) { Ease.bounceInOut = function (t) {
if (tweens[i] == tween) { if (t < 0.5)
tweens.splice(i, 1); return Ease.bounceIn(t * 2) * .5;
return; return Ease.bounceOut(t * 2 - 1) * 0.5 + 0.5;
};
Ease.getElasticIn = function (amplitude, period) {
var pi2 = Math.PI * 2;
return function (t) {
if (t == 0 || t == 1)
return t;
var s = period / pi2 * Math.asin(1 / amplitude);
return -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));
};
};
Ease.getElasticOut = function (amplitude, period) {
var pi2 = Math.PI * 2;
return function (t) {
if (t == 0 || t == 1)
return t;
var s = period / pi2 * Math.asin(1 / amplitude);
return (amplitude * Math.pow(2, -10 * t) * Math.sin((t - s) * pi2 / period) + 1);
};
};
Ease.getElasticInOut = function (amplitude, period) {
var pi2 = Math.PI * 2;
return function (t) {
var s = period / pi2 * Math.asin(1 / amplitude);
if ((t *= 2) < 1)
return -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));
return amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * 0.5 + 1;
};
};
Ease.quadIn = Ease.getPowIn(2);
Ease.quadOut = Ease.getPowOut(2);
Ease.quadInOut = Ease.getPowInOut(2);
Ease.cubicIn = Ease.getPowIn(3);
Ease.cubicOut = Ease.getPowOut(3);
Ease.cubicInOut = Ease.getPowInOut(3);
Ease.quartIn = Ease.getPowIn(4);
Ease.quartOut = Ease.getPowOut(4);
Ease.quartInOut = Ease.getPowInOut(4);
Ease.quintIn = Ease.getPowIn(5);
Ease.quintOut = Ease.getPowOut(5);
Ease.quintInOut = Ease.getPowInOut(5);
Ease.backIn = Ease.getBackIn(1.7);
Ease.backOut = Ease.getBackOut(1.7);
Ease.backInOut = Ease.getBackInOut(1.7);
Ease.elasticIn = Ease.getElasticIn(1, 0.3);
Ease.elasticOut = Ease.getElasticOut(1, 0.3);
Ease.elasticInOut = Ease.getElasticInOut(1, 0.3 * 1.5);
return Ease;
}());
var ScrollViewBase = (function (_super) {
tslib_1.__extends(ScrollViewBase, _super);
function ScrollViewBase(maxDistance, isFull) {
if (isFull === void 0) { isFull = false; }
var _this = _super.call(this) || this;
_this.distance = 0;
_this.minDis = 0;
_this.maskObj = new Graphics();
_this.viewPort = new Container();
_this.lastValue = 0;
_this.speed = 0;
_this.addSpeed = 0;
_this.isStop = true;
_this.maxSpeed = 100;
_this.fSpeed = 20;
_this.paramXY = "y";
_this.paramSize = "height";
_this.stopTimes = -1;
_this.isMouseDownState = 0;
_this.autoScroll = false;
_this.isSpringBack = true;
var s = _this;
s._instanceType = "ScrollContainer";
_super.prototype.addChild.call(_this, s.maskObj);
_super.prototype.addChild.call(_this, s.viewPort);
if (!isFull) {
s.viewPort.mask = s.maskObj;
s.maskObj.isUsedToMask = false;
} }
s.maskObj.alpha = 0;
s.updateViewRect();
s.direction = exports.SCROLL_DIRECTION.VERTICAL;
s.addEventListener(Event.ADDED_TO_STAGE, function (e) {
s.stage.addEventListener(MouseEvent.MOUSE_UP, s.onMouseEvent, s);
s.stage.addEventListener(MouseEvent.MOUSE_MOVE, s.onMouseEvent, s);
});
s.addEventListener(Event.REMOVED_FROM_STAGE, function (e) {
s.stage.removeEventListener(MouseEvent.MOUSE_UP, s.onMouseEvent, s);
s.stage.removeEventListener(MouseEvent.MOUSE_MOVE, s.onMouseEvent, s);
});
s.addEventListener(MouseEvent.MOUSE_DOWN, s.onMouseEvent, s, false);
s.addEventListener(Event.ENTER_FRAME, function () {
var view = s.viewPort;
if (s.autoScroll)
return;
if (!s.isSpringBack) {
if (view[s.paramXY] > 0) {
s.addSpeed = 0;
s.speed = 0;
s.isStop = true;
view[s.paramXY] = 0;
return;
} }
else if (view[s.paramXY] < s.distance - s.maxDistance) {
s.addSpeed = 0;
s.speed = 0;
s.isStop = true;
view[s.paramXY] = Math.min(0, s.distance - s.maxDistance);
return;
} }
};
Tween.removeAllTweens = function () {
var tweens = Tween._tweens;
for (var i = 0, l = tweens.length; i < l; i++) {
var tween = tweens[i];
tween.paused = true;
tween._target.tween_count = 0;
} }
tweens.length = 0; if (!s.isStop) {
}; if (Math.abs(s.speed) > 0) {
Tween.prototype.initialize = function (target, props, pluginData) { view[s.paramXY] += s.speed;
this._target = target; if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) {
if (props) { s.speed += s.addSpeed * s.fSpeed;
this._useTicks = props.useTicks;
this.ignoreGlobalPause = props.ignoreGlobalPause;
this.loop = props.loop;
if (props.onChange) {
this.onChange = props.onChange.bind(props.onChangeObj);
} }
else { else {
this.onChange = null; s.speed += s.addSpeed;
} }
if (props.override) { if (s.speed * s.addSpeed > 0) {
Tween.removeTweens(target); s.dispatchEvent(Event.ON_SCROLL_STOP);
s.speed = 0;
} }
} }
this.pluginData = pluginData || {}; else {
this._curQueueProps = {}; if (s.addSpeed != 0) {
this._initQueueProps = {}; if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) {
this._steps = []; var tarP = 0;
if (props && props.paused) { if (view[s.paramXY] < s.distance - s.maxDistance) {
this.paused = true; if (s.distance < s.maxDistance) {
tarP = s.distance - s.maxDistance;
}
}
view[s.paramXY] += 0.4 * (tarP - view[s.paramXY]);
if (Math.abs(tarP - view[s.paramXY]) < 0.1) {
s.isStop = true;
if (s.addSpeed > 0) {
s.dispatchEvent(Event.ON_SCROLL_TO_END);
} }
else { else {
Tween._register(this, true); s.dispatchEvent(Event.ON_SCROLL_TO_HEAD);
} }
if (props && props.position != null) {
this.setPosition(props.position, Tween.NONE);
} }
};
Tween.prototype.setPosition = function (value, actionsMode) {
if (actionsMode === void 0) { actionsMode = 1; }
if (value < 0) {
value = 0;
} }
var t = value;
var end = false;
if (t >= this.duration) {
if (this.loop) {
var newTime = t % this.duration;
if (t > 0 && newTime === 0) {
t = this.duration;
} }
else { else {
t = newTime; s.isStop = true;
}
} }
} }
else { else {
t = this.duration; if (s.stopTimes >= 0) {
end = true; if (s.stopTimes >= 15) {
s.speed = 0;
if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) {
s.isStop = false;
s.stopTimes = -1;
} }
} }
if (t == this._prevPos) {
return end;
} }
if (end) {
this.setPaused(true);
} }
var prevPos = this._prevPos; });
this.position = this._prevPos = t; s.addEventListener(Event.RESIZE, _this.updateViewRect, s);
this._prevPosition = value; return _this;
if (this._target) {
if (this._steps.length > 0) {
var l = this._steps.length;
var stepIndex = -1;
for (var i = 0; i < l; i++) {
if (this._steps[i].type == "step") {
stepIndex = i;
if (this._steps[i].t <= t && this._steps[i].t + this._steps[i].d >= t) {
break;
} }
Object.defineProperty(ScrollViewBase.prototype, "maxDistance", {
get: function () {
return this.calMaxDistance();
},
enumerable: true,
configurable: true
});
ScrollViewBase.prototype.calMaxDistance = function () {
return this.viewPort[this.paramSize] + this.viewPort.getLocalBounds()[this.paramXY];
};
Object.defineProperty(ScrollViewBase.prototype, "direction", {
get: function () {
return this._direction;
},
set: function (value) {
this._direction = value;
this.updateDirection();
},
enumerable: true,
configurable: true
});
ScrollViewBase.prototype.updateDirection = function () {
var s = this;
if (this._direction === exports.SCROLL_DIRECTION.VERTICAL) {
s.distance = s.height;
s.paramXY = "y";
s.paramSize = 'height';
} }
else {
s.distance = s.width;
s.paramXY = "x";
s.paramSize = 'width';
} }
for (var i = 0; i < l; i++) { };
if (this._steps[i].type == "action") { ScrollViewBase.prototype.updateViewRect = function () {
if (actionsMode != 0) { var s = this;
if (this._useTicks) { s.maskObj.clear();
this._runAction(this._steps[i], t, t); s.maskObj.beginFill("#000000");
s.maskObj.drawRect(0, 0, s.width, s.height);
s.maskObj.endFill();
this.updateDirection();
};
ScrollViewBase.prototype.cancelScroll = function () {
this.isMouseDownState = 0;
};
ScrollViewBase.prototype.onMouseEvent = function (e) {
var s = this;
var view = s.viewPort;
if (e.type == MouseEvent.MOUSE_DOWN) {
e.stopPropagation();
if (!s.isStop) {
s.isStop = true;
} }
else if (actionsMode == 1 && t < prevPos) { if (s.autoScroll) {
if (prevPos != this.duration) { s.autoScroll = false;
this._runAction(this._steps[i], prevPos, this.duration);
} }
this._runAction(this._steps[i], 0, t, true); if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) {
s.lastValue = e.stageY;
} }
else { else {
this._runAction(this._steps[i], prevPos, t); s.lastValue = e.stageX;
} }
s.speed = 0;
s.isMouseDownState = 1;
} }
else if (e.type == MouseEvent.MOUSE_MOVE) {
if (s.isMouseDownState == 0)
return;
if (s.isMouseDownState == 1) {
s.dispatchEvent(Event.ON_SCROLL_START);
} }
else if (this._steps[i].type == "step") { s.isMouseDownState = 2;
if (stepIndex == i) { var currentValue = void 0;
var step = this._steps[stepIndex]; if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) {
this._updateTargetProps(step, Math.min((this._stepPosition = t - step.t) / step.d, 1)); currentValue = e.stageY;
} }
else {
currentValue = e.stageX;
} }
s.speed = currentValue - s.lastValue;
if (s.speed > s.minDis) {
s.addSpeed = -2;
if (s.speed > s.maxSpeed) {
s.speed = s.maxSpeed;
} }
} }
else if (s.speed < -s.minDis) {
if (s.speed < -s.maxSpeed) {
s.speed = -s.maxSpeed;
} }
this.onChange && this.onChange(); s.addSpeed = 2;
return end;
};
Tween.prototype._runAction = function (action, startPos, endPos, includeStart) {
if (includeStart === void 0) { includeStart = false; }
var sPos = startPos;
var ePos = endPos;
if (startPos > endPos) {
sPos = endPos;
ePos = startPos;
} }
var pos = action.t; else {
if (pos == ePos || (pos > sPos && pos < ePos) || (includeStart && pos == startPos)) { s.speed = 0;
action.f.apply(action.o, action.p);
} }
}; if (s.speed != 0) {
Tween.prototype._updateTargetProps = function (step, ratio) { var speedPer = 1;
var p0, p1, v, v0, v1, arr; if (view[s.paramXY] > 0 || view[s.paramXY] < s.distance - s.maxDistance) {
if (!step && ratio == 1) { speedPer = 0.2;
this.passive = false; }
p0 = p1 = this._curQueueProps; view[s.paramXY] += (currentValue - s.lastValue) * speedPer;
}
s.lastValue = currentValue;
s.stopTimes = 0;
} }
else { else {
this.passive = !!step.v; s.isStop = false;
if (this.passive) { s.stopTimes = -1;
return; if (s.speed == 0 && s.isMouseDownState == 2) {
s.dispatchEvent(Event.ON_SCROLL_STOP);
}
s.isMouseDownState = 0;
}
};
ScrollViewBase.prototype.scrollTo = function (dis, time) {
if (time === void 0) { time = 0; }
var _a;
var s = this;
var newDis = s.paramXY == "x" ? s.width : s.height;
if (dis < 0) {
dis = 0;
} }
if (step.e) { else if (dis > s.maxDistance - newDis) {
ratio = step.e(ratio, 0, 1, 1); dis = s.maxDistance - newDis;
} }
p0 = step.p0; if (Math.abs(s.viewPort[s.paramXY] + dis) > 2) {
p1 = step.p1; s.isStop = true;
s.isMouseDownState = 0;
if (time > 0) {
Tween.get(s.viewPort, null, null, true)
.to((_a = {}, _a[s.paramXY] = -dis, _a), time, Ease.cubicInOut);
} }
for (var n in this._initQueueProps) { else {
if ((v0 = p0[n]) == null) { s.viewPort[s.paramXY] = -dis;
p0[n] = v0 = this._initQueueProps[n];
} }
if ((v1 = p1[n]) == null) {
p1[n] = v1 = v0;
} }
if (v0 == v1 || ratio == 0 || ratio == 1 || (typeof (v0) != "number")) { };
v = ratio == 1 ? v1 : v0; ScrollViewBase.prototype.destroy = function () {
var s = this;
s.maskObj.destroy();
s.viewPort.destroy();
s.maskObj = null;
s.viewPort = null;
_super.prototype.destroy.call(this);
};
return ScrollViewBase;
}(Container));
function fieldChanged(onModify) {
return function (target, key) {
var privateKey = '_' + key;
Object.defineProperty(target, key, {
enumerable: true,
get: function () {
return this[privateKey];
},
set: function (v) {
var oldValue = this[privateKey];
if (oldValue !== v) {
this[privateKey] = v;
onModify.apply(this, [v, key, oldValue]);
} }
else {
v = v0 + (v1 - v0) * ratio;
} }
var ignore = false; });
if (arr = Tween._plugins[n]) { };
for (var i = 0, l = arr.length; i < l; i++) {
var v2 = arr[i].tween(this, n, v, p0, p1, ratio, !!step && p0 == p1, !step);
if (v2 == Tween.IGNORE) {
ignore = true;
} }
else { var dirtyFieldDetector = fieldChanged(function (value, key, oldValue) {
v = v2; this['__fieldDirty'] = true;
});
var deepDirtyFieldDetector = fieldChanged(function (value, key, oldValue) {
var scope = this;
scope['__fieldDirty'] = true;
if (typeof value === 'object') {
value['onModify'] = function () {
scope['__fieldDirty'] = true;
};
} }
});
var dirtyFieldTrigger = fieldChanged(function (value, key, oldValue) {
this['onModify'] && this['onModify'](value, key, oldValue);
});
var deepDirtyFieldTrigger = fieldChanged(function (value, key, oldValue) {
if (this['onModify']) {
this['onModify'](value, key, oldValue);
if (typeof value === 'object') {
value['onModify'] = this['onModify'];
} }
} }
if (!ignore) { });
this._target[n] = v;
var ScrollListItemBase = (function (_super) {
tslib_1.__extends(ScrollListItemBase, _super);
function ScrollListItemBase() {
return _super !== null && _super.apply(this, arguments) || this;
} }
ScrollListItemBase.prototype._initData = function (id, data) {
this.id = id;
this.data = data;
if (id >= 0) {
this.updateData(data);
} }
}; };
Tween.prototype.setPaused = function (value) { return ScrollListItemBase;
if (this.paused == value) { }(Container));
return this; var ScrollListBase = (function (_super) {
tslib_1.__extends(ScrollListBase, _super);
function ScrollListBase() {
var _this = _super.call(this) || this;
_this._items = null;
_this._isInit = 0;
_this.data = [];
_this.downL = null;
_this._lastFirstId = -1;
_this._updateId = -1;
_this.itemWidth = 0;
_this.itemHeight = 0;
_this.cols = 1;
var s = _this;
s._instanceType = "ScrollList";
s._items = [];
s._itemCount = 0;
s.once(Event.ENTER_FRAME, s.onNextFrame, s);
s.addEventListener(Event.ENTER_FRAME, s.flushData.bind(s));
return _this;
} }
this.paused = value; Object.defineProperty(ScrollListBase.prototype, "loadingView", {
Tween._register(this, !value); get: function () {
return this; return this.downL;
},
enumerable: true,
configurable: true
});
ScrollListBase.prototype.onNextFrame = function (event) {
this.updateViewRect();
}; };
Tween.prototype._cloneProps = function (props) { ScrollListBase.prototype.onModify = function (value, key) {
var o = {};
for (var n in props) {
o[n] = props[n];
}
return o;
}; };
Tween.prototype._addStep = function (o) { ScrollListBase.prototype.calMaxDistance = function () {
if (o.d > 0) { var key = 'item' + this.paramSize.substr(0, 1).toUpperCase() + this.paramSize.substr(1);
o.type = "step"; return this[key] * Math.ceil(this.data.length / this.cols);
this._steps.push(o);
o.t = this.duration;
this.duration += o.d;
}
return this;
}; };
Tween.prototype._appendQueueProps = function (o) { ScrollListBase.prototype.updateData = function (data, isReset) {
var arr, oldValue, i, l, injectProps; if (isReset === void 0) { isReset = true; }
for (var n in o) { var s = this;
if (this._initQueueProps[n] === undefined) { if (!s._isInit || isReset) {
oldValue = this._target[n]; s.data = data;
if (arr = Tween._plugins[n]) {
for (i = 0, l = arr.length; i < l; i++) {
oldValue = arr[i].init(this, n, oldValue);
} }
else {
s.data = s.data.concat(data);
} }
this._initQueueProps[n] = this._curQueueProps[n] = (oldValue === undefined) ? null : oldValue; s._isInit = 1;
s._lastFirstId = -1;
};
ScrollListBase.prototype.flushData = function () {
var s = this;
var items = s._items;
if (items.length <= 0) {
return;
}
if (s._isInit > 0) {
if (s._updateId != s.viewPort.transform._localID) {
var id = s.viewPort[s.paramXY] > 0 ? 0 : (Math.abs(Math.floor(s.viewPort[s.paramXY] / s._itemRow)) - 1) * s.cols;
id = id < 0 ? 0 : id;
if (id != s._lastFirstId) {
s._lastFirstId = id;
if (id != items[0].id) {
for (var r = 0; r < s.cols; r++) {
if (s.speed > 0) {
items.unshift(items.pop());
} }
else { else {
oldValue = this._curQueueProps[n]; items.push(items.shift());
}
} }
} }
for (var n in o) {
oldValue = this._curQueueProps[n];
if (arr = Tween._plugins[n]) {
injectProps = injectProps || {};
for (i = 0, l = arr.length; i < l; i++) {
if (arr[i].step) {
arr[i].step(this, n, oldValue, o[n], injectProps);
} }
for (var i = 0; i < s._itemCount; i++) {
var item = items[i];
if (s._isInit == 1) {
item.sli_id = -1;
} }
if (item.sli_id != id) {
if (s.data[id]) {
item._initData(s.data[id] ? id : -1, s.data[id]);
} }
this._curQueueProps[n] = o[n]; item[s.paramXY] = Math.floor(id / s.cols) * s._itemRow;
item[s._disParam] = (id % s.cols) * s._itemCol;
if (s.data[id]) {
item.sli_id = id;
item.visible = true;
} }
if (injectProps) { else {
this._appendQueueProps(injectProps); item.sli_id = -1;
item.visible = false;
} }
return this._curQueueProps;
};
Tween.prototype._addAction = function (o) {
o.t = this.duration;
o.type = "action";
this._steps.push(o);
return this;
};
Tween.prototype._set = function (props, o) {
for (var n in props) {
o[n] = props[n];
} }
}; id++;
Tween.prototype.wait = function (duration, passive) {
if (duration == null || duration <= 0) {
return this;
} }
var o = this._cloneProps(this._curQueueProps); s._isInit = 2;
return this._addStep({ d: duration, p0: o, p1: o, v: passive });
};
Tween.prototype.to = function (props, duration, ease) {
if (ease === void 0) { ease = undefined; }
if (isNaN(duration) || duration < 0) {
duration = 0;
} }
this._addStep({ d: duration || 0, p0: this._cloneProps(this._curQueueProps), e: ease, p1: this._cloneProps(this._appendQueueProps(props)) });
return this.set(props);
};
Tween.prototype.call = function (callback, thisObj, params) {
if (thisObj === void 0) { thisObj = undefined; }
if (params === void 0) { params = undefined; }
return this._addAction({ f: callback, p: params ? params : [], o: thisObj ? thisObj : this._target });
};
Tween.prototype.set = function (props, target) {
if (target === void 0) { target = null; }
this._appendQueueProps(props);
return this._addAction({ f: this._set, o: this, p: [props, target ? target : this._target] });
};
Tween.prototype.play = function (tween) {
if (!tween) {
tween = this;
} }
return this.call(tween.setPaused, tween, [false]);
}; };
Tween.prototype.pause = function (tween) { ScrollListBase.prototype.updateViewRect = function () {
if (!tween) { _super.prototype.updateViewRect.call(this);
tween = this; var s = this;
if (s.itemWidth && s.itemHeight) {
s._updateViewRect();
} }
return this.call(tween.setPaused, tween, [true]);
}; };
Tween.prototype.$tick = function (delta) { ScrollListBase.prototype._updateViewRect = function () {
if (this.paused) { var s = this;
if (s._direction === exports.SCROLL_DIRECTION.VERTICAL) {
if (s.itemHeight <= 0) {
return; return;
} }
this.setPosition(this._prevPosition + delta); s._disParam = "x";
}; s._itemRow = s.itemHeight;
Tween.NONE = 0; s._itemCol = s.itemWidth;
Tween.LOOP = 1;
Tween.REVERSE = 2;
Tween._tweens = [];
Tween.IGNORE = {};
Tween._plugins = {};
Tween._inited = false;
Tween._lastTime = 0;
return Tween;
}());
var Ease = (function () {
function Ease() {
} }
Ease.get = function (amount) { else {
if (amount < -1) { if (s.itemWidth <= 0) {
amount = -1; return;
} }
if (amount > 1) { s._disParam = "y";
amount = 1; s._itemRow = s.itemWidth;
s._itemCol = s.itemHeight;
} }
return function (t) { var newCount = (Math.ceil(s.distance / s._itemRow) + 1) * s.cols;
if (amount == 0) { if (newCount != s._itemCount) {
return t; if (newCount > s._itemCount) {
for (var i = s._itemCount; i < newCount; i++) {
var item = s.createItem();
item.id = -1;
item.data = null;
s._items.push(item);
s.viewPort.addChild(item);
} }
if (amount < 0) {
return t * (t * -amount + 1 + amount);
} }
return t * ((2 - t) * amount + (1 - amount)); else {
}; for (var i = 0; i < s._itemCount - newCount; i++) {
}; s.viewPort.removeChild(s._items.pop());
Ease.getPowIn = function (pow) { }
return function (t) { }
return Math.pow(t, pow); s._itemCount = newCount;
}; s._lastFirstId = -1;
};
Ease.getPowOut = function (pow) {
return function (t) {
return 1 - Math.pow(1 - t, pow);
};
};
Ease.getPowInOut = function (pow) {
return function (t) {
if ((t *= 2) < 1)
return 0.5 * Math.pow(t, pow);
return 1 - 0.5 * Math.abs(Math.pow(2 - t, pow));
};
};
Ease.sineIn = function (t) {
return 1 - Math.cos(t * Math.PI / 2);
};
Ease.sineOut = function (t) {
return Math.sin(t * Math.PI / 2);
};
Ease.sineInOut = function (t) {
return -0.5 * (Math.cos(Math.PI * t) - 1);
};
Ease.getBackIn = function (amount) {
return function (t) {
return t * t * ((amount + 1) * t - amount);
};
};
Ease.getBackOut = function (amount) {
return function (t) {
return (--t * t * ((amount + 1) * t + amount) + 1);
};
};
Ease.getBackInOut = function (amount) {
amount *= 1.525;
return function (t) {
if ((t *= 2) < 1)
return 0.5 * (t * t * ((amount + 1) * t - amount));
return 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2);
};
};
Ease.circIn = function (t) {
return -(Math.sqrt(1 - t * t) - 1);
};
Ease.circOut = function (t) {
return Math.sqrt(1 - (--t) * t);
};
Ease.circInOut = function (t) {
if ((t *= 2) < 1) {
return -0.5 * (Math.sqrt(1 - t * t) - 1);
} }
return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
}; };
Ease.bounceIn = function (t) { ScrollListBase.prototype.createItem = function () {
return 1 - Ease.bounceOut(1 - t); return new this.itemClass();
}; };
Ease.bounceOut = function (t) { ScrollListBase.prototype.setLoading = function (downLoading) {
if (t < 1 / 2.75) { var s = this;
return (7.5625 * t * t); if (s.downL) {
} s.viewPort.removeChild(s.downL);
else if (t < 2 / 2.75) { s.downL = null;
return (7.5625 * (t -= 1.5 / 2.75) * t + 0.75);
} }
else if (t < 2.5 / 2.75) { if (downLoading) {
return (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375); s.downL = downLoading;
s.viewPort.addChild(downLoading);
s.downL[s.paramXY] = Math.max(s.distance, s.maxDistance);
} }
else { else {
return (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375); s.isStop = false;
} }
}; };
Ease.bounceInOut = function (t) { ScrollListBase.prototype.destroy = function () {
if (t < 0.5) var s = this;
return Ease.bounceIn(t * 2) * .5; s._items = null;
return Ease.bounceOut(t * 2 - 1) * 0.5 + 0.5; s.itemClass = null;
}; s.data = null;
Ease.getElasticIn = function (amplitude, period) { s.downL = null;
var pi2 = Math.PI * 2; _super.prototype.destroy.call(this);
return function (t) {
if (t == 0 || t == 1)
return t;
var s = period / pi2 * Math.asin(1 / amplitude);
return -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));
};
};
Ease.getElasticOut = function (amplitude, period) {
var pi2 = Math.PI * 2;
return function (t) {
if (t == 0 || t == 1)
return t;
var s = period / pi2 * Math.asin(1 / amplitude);
return (amplitude * Math.pow(2, -10 * t) * Math.sin((t - s) * pi2 / period) + 1);
};
};
Ease.getElasticInOut = function (amplitude, period) {
var pi2 = Math.PI * 2;
return function (t) {
var s = period / pi2 * Math.asin(1 / amplitude);
if ((t *= 2) < 1)
return -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));
return amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * 0.5 + 1;
};
}; };
Ease.quadIn = Ease.getPowIn(2); tslib_1.__decorate([
Ease.quadOut = Ease.getPowOut(2); dirtyFieldTrigger
Ease.quadInOut = Ease.getPowInOut(2); ], ScrollListBase.prototype, "itemWidth", void 0);
Ease.cubicIn = Ease.getPowIn(3); tslib_1.__decorate([
Ease.cubicOut = Ease.getPowOut(3); dirtyFieldTrigger
Ease.cubicInOut = Ease.getPowInOut(3); ], ScrollListBase.prototype, "itemHeight", void 0);
Ease.quartIn = Ease.getPowIn(4); tslib_1.__decorate([
Ease.quartOut = Ease.getPowOut(4); dirtyFieldTrigger
Ease.quartInOut = Ease.getPowInOut(4); ], ScrollListBase.prototype, "cols", void 0);
Ease.quintIn = Ease.getPowIn(5); tslib_1.__decorate([
Ease.quintOut = Ease.getPowOut(5); dirtyFieldTrigger
Ease.quintInOut = Ease.getPowInOut(5); ], ScrollListBase.prototype, "itemClass", void 0);
Ease.backIn = Ease.getBackIn(1.7); return ScrollListBase;
Ease.backOut = Ease.getBackOut(1.7); }(ScrollViewBase));
Ease.backInOut = Ease.getBackInOut(1.7);
Ease.elasticIn = Ease.getElasticIn(1, 0.3);
Ease.elasticOut = Ease.getElasticOut(1, 0.3);
Ease.elasticInOut = Ease.getElasticInOut(1, 0.3 * 1.5);
return Ease;
}());
var Node$1 = (function (_super) { var Node$1 = (function (_super) {
tslib_1.__extends(Node, _super); tslib_1.__extends(Node, _super);
...@@ -21747,101 +21769,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21747,101 +21769,14 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
}; };
/**
* Created by rockyl on 2020-01-27.
*/
var genericRegexp = /(\w+)(<(\w+)>)?/;
function compute(props, options) {
var result = props || {};
var _loop_1 = function (key) {
var sourceValue = getValue(result, options, key);
var value = sourceValue;
if (options) {
var option = options[key];
if (option && option.type) {
var _a = parseType(option.type), type = _a.type, generic_1 = _a.generic;
switch (type) {
case 'vector2':
value = parseVector2(sourceValue);
break;
case 'array':
var seps = sourceValue.split(',');
seps = seps.map(function (sep) {
var item;
if (generic_1) {
switch (generic_1) {
case 'number':
item = parseFloat(sep);
break;
case 'boolean':
item = sep === 'true';
break;
default:
item = sep;
break;
}
}
else {
item = sep;
}
return item;
});
value = seps;
break;
}
}
}
result[key] = value;
};
for (var key in options) {
_loop_1(key);
}
return result;
}
function parseType(typeStr) {
var type = typeStr, generic;
var regResult = typeStr.match(genericRegexp);
if (regResult) {
type = regResult[1];
generic = regResult[3];
}
return {
type: type, generic: generic,
};
}
function parseVector2(sourceValue) {
var value = sourceValue;
if (!sourceValue) {
value = { x: undefined, y: undefined };
}
if (typeof sourceValue === 'string') {
var arr = sourceValue.split(',');
value = {
x: arr[0] === '' ? undefined : parseFloat(arr[0]),
y: arr[1] === '' ? undefined : parseFloat(arr[1]),
};
}
else if (Array.isArray(sourceValue)) {
value = {
x: sourceValue[0] === '' ? undefined : parseFloat(sourceValue[0]),
y: sourceValue[1] === '' ? undefined : parseFloat(sourceValue[1]),
};
}
return value;
}
function getValue(props, options, key) {
var value;
if (props.hasOwnProperty(key)) {
value = props[key];
}
else if (options && options[key].hasOwnProperty('default')) {
value = options[key].default;
}
return value;
}
var emojiRegexp = emojiRegex(); var emojiRegexp = emojiRegex();
Object.defineProperty(exports, 'computeProps', {
enumerable: true,
get: function () {
return propsCompute.compute;
}
});
exports.BaseTexture = BaseTexture; exports.BaseTexture = BaseTexture;
exports.BaseTextureCache = BaseTextureCache; exports.BaseTextureCache = BaseTextureCache;
exports.BitmapText = BitmapText; exports.BitmapText = BitmapText;
...@@ -21917,7 +21852,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -21917,7 +21852,6 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
exports.clearTextureCache = clearTextureCache; exports.clearTextureCache = clearTextureCache;
exports.cmdOldPrefix = cmdOldPrefix; exports.cmdOldPrefix = cmdOldPrefix;
exports.cmdPrefix = cmdPrefix; exports.cmdPrefix = cmdPrefix;
exports.computeProps = compute;
exports.copyProp = copyProp; exports.copyProp = copyProp;
exports.cos = cos; exports.cos = cos;
exports.countTrailingZeros = countTrailingZeros; exports.countTrailingZeros = countTrailingZeros;
...@@ -22033,5 +21967,5 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: ...@@ -22033,5 +21967,5 @@ var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate:
Object.defineProperty(exports, '__esModule', { value: true }); Object.defineProperty(exports, '__esModule', { value: true });
})); })));
//# sourceMappingURL=engine.js.map //# sourceMappingURL=engine.js.map
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -33,7 +33,7 @@ function getPxToken(callback) { ...@@ -33,7 +33,7 @@ function getPxToken(callback) {
}; };
xhr.send(); xhr.send();
} else { } else {
callback('need login'); callback('need reload');
} }
function failedCallback() { function failedCallback() {
......
function getPxToken(n){if(window.ohjaiohdf){var o=new XMLHttpRequest;o.open("get","getToken",!0),o.onreadystatechange=function(){if(4===o.readyState&&200===o.status){var e=JSON.parse(o.response);if(e.success)window.eval(e.data),n(null,window.ohjaiohdf());else switch(e.code){case"100001":n("need login");break;case"100024":n("state invalid");break;default:n(e.code)}}},o.onerror=function(e){t()},o.onloadend=function(){404===o.status&&t()},o.send()}else n("need login");function t(){n("net error")}} function getPxToken(n){if(window.ohjaiohdf){var o=new XMLHttpRequest;o.open("get","getToken",!0),o.onreadystatechange=function(){if(4===o.readyState&&200===o.status){var e=JSON.parse(o.response);if(e.success)window.eval(e.data),n(null,window.ohjaiohdf());else switch(e.code){case"100001":n("need login");break;case"100024":n("state invalid");break;default:n(e.code)}}},o.onerror=function(e){t()},o.onloadend=function(){404===o.status&&t()},o.send()}else n("need reload");function t(){n("net error")}}
\ No newline at end of file
import { DisplayObject } from './DisplayObject'; import {DisplayObject} from './DisplayObject';
import { Rectangle } from "../math/Rectangle"; import {Rectangle} from "../math/Rectangle";
import { Point } from '../math/index'; import {Point} from '../math/index';
import CanvasRenderer from '../renderers/CanvasRenderer'; import CanvasRenderer from '../renderers/CanvasRenderer';
import { Event } from "../events/Event" import {Event} from "../events/Event"
import { WebglRenderer } from '../renderers/WebglRenderer'; import {WebglRenderer} from '../renderers/WebglRenderer';
import { applyAutoAdjust } from "../../zeroing/decorators/auto-adjust"; import {applyAutoAdjust} from "../../zeroing/decorators/auto-adjust";
import { applyScript } from "../../zeroing/decorators/scripts"; import {applyScript} from "../../zeroing/decorators/scripts";
import { applyEvents } from "../../zeroing/decorators/events"; import {applyEvents} from "../../zeroing/decorators/events";
import { afterConstructor } from "../../zeroing/decorators/after-constructor"; import {afterConstructor} from "../../zeroing/decorators/after-constructor";
import { injectProperties, instantiateScript, toBoolean } from "../../zeroing/utils/index"; import {injectProperties, instantiateScript, toBoolean} from "../../zeroing/utils/index";
import { isUI } from "../../zeroing/game-warpper/nodes/IUIComponent"; import {isUI} from "../../zeroing/game-warpper/nodes/IUIComponent";
import Transform from "../math/Transform"; import Transform from "../math/Transform";
/** /**
...@@ -784,7 +784,7 @@ export default class Container extends DisplayObject { ...@@ -784,7 +784,7 @@ export default class Container extends DisplayObject {
} }
set x(value: number) { set x(value: number) {
if(this.destroyed){ if (this.destroyed) {
return; return;
} }
if (value == this.transform.position.x) return; if (value == this.transform.position.x) return;
...@@ -798,7 +798,7 @@ export default class Container extends DisplayObject { ...@@ -798,7 +798,7 @@ export default class Container extends DisplayObject {
} }
set y(value: number) { set y(value: number) {
if(this.destroyed){ if (this.destroyed) {
return; return;
} }
if (value == this.transform.position.y) return; if (value == this.transform.position.y) return;
......
...@@ -40,6 +40,11 @@ export class FloatDisplay extends DisplayObject { ...@@ -40,6 +40,11 @@ export class FloatDisplay extends DisplayObject {
*/ */
private _transformID: number; private _transformID: number;
/**
* 记录是否需要修改位置矩阵
*/
private _shouldUpdateStyle: boolean;
/** /**
* 构造函数 * 构造函数
* @method FloatDisplay * @method FloatDisplay
...@@ -89,13 +94,9 @@ export class FloatDisplay extends DisplayObject { ...@@ -89,13 +94,9 @@ export class FloatDisplay extends DisplayObject {
this._transformID = -1; this._transformID = -1;
} }
addHtmlElement() { addHtmlElement(el?) {
let s = this; let s = this;
if(!s.stage){
return;
}
if (!container) { if (!container) {
container = document.createElement('div'); container = document.createElement('div');
container.style.position = "absolute"; container.style.position = "absolute";
...@@ -105,25 +106,36 @@ export class FloatDisplay extends DisplayObject { ...@@ -105,25 +106,36 @@ export class FloatDisplay extends DisplayObject {
container.style.lineHeight = 'normal'; container.style.lineHeight = 'normal';
s.stage.rootDiv.appendChild(container);//, s.stage.rootDiv.childNodes[0] s.stage.rootDiv.appendChild(container);//, s.stage.rootDiv.childNodes[0]
} }
if (s._htmlElement) { if (s._htmlElement) {
let style = s._htmlElement.style; try {
container.removeChild(s._htmlElement);
}catch (e){
}
}
if(el){
s._htmlElement = el;
}
container.appendChild(s._htmlElement);
if (!s._isAdded) { if (!s._isAdded) {
s._isAdded = true; s._isAdded = true;
container.appendChild(s._htmlElement);
s.stage["_floatDisplayList"].push(s); s.stage["_floatDisplayList"].push(s);
} else { } else {
if (s._htmlElement && s.visible) { if (s._htmlElement && s.visible) {
let style = s._htmlElement.style;
style.display = "block"; style.display = "block";
} }
} }
} }
}
get htmlElement() { get htmlElement() {
return this._htmlElement; return this._htmlElement;
} }
set htmlElement(v) { set htmlElement(v) {
this._shouldUpdateStyle = true;
this.init(v); this.init(v);
this.updateStyle(); this.updateStyle();
} }
...@@ -169,9 +181,13 @@ export class FloatDisplay extends DisplayObject { ...@@ -169,9 +181,13 @@ export class FloatDisplay extends DisplayObject {
// s._bounds.height = h; // s._bounds.height = h;
s._localBoundsSelf.width = w; s._localBoundsSelf.width = w;
s._localBoundsSelf.height = h; s._localBoundsSelf.height = h;
if (!s.stage) {
s._htmlElement = she; s._htmlElement = she;
return;
}
this.addHtmlElement(); this.addHtmlElement(she);
} }
/** /**
...@@ -227,7 +243,8 @@ export class FloatDisplay extends DisplayObject { ...@@ -227,7 +243,8 @@ export class FloatDisplay extends DisplayObject {
style.display = show; style.display = show;
} }
if (visible) { if (visible) {
if (this._transformID != this.transform._worldID) { if (this._shouldUpdateStyle || this._transformID != this.transform._worldID) {
this._shouldUpdateStyle = false;
this._transformID = this.transform._worldID this._transformID = this.transform._worldID
let mtx = s.transform.worldMatrix; let mtx = s.transform.worldMatrix;
let d = devicePixelRatio; let d = devicePixelRatio;
......
...@@ -19,7 +19,6 @@ class AlignManager { ...@@ -19,7 +19,6 @@ class AlignManager {
* flash (渲染前) * flash (渲染前)
*/ */
public flush() { public flush() {
const list = this.alignList; const list = this.alignList;
list.forEach((v: Container) => { list.forEach((v: Container) => {
......
...@@ -134,11 +134,11 @@ export class GameStage extends Node { ...@@ -134,11 +134,11 @@ export class GameStage extends Node {
await this.loadPreloadAssets(onPreloadAssetsProgress, onPreloadAssetsComplete); await this.loadPreloadAssets(onPreloadAssetsProgress, onPreloadAssetsComplete);
this.start();
dealPxEnv(); dealPxEnv();
dealPageRemainTime(); dealPageRemainTime();
this.start();
onStart && onStart(); onStart && onStart();
setTimeout(this.lazyLoadAllAssets, setTimeout(this.lazyLoadAllAssets,
......
...@@ -224,8 +224,6 @@ export class TextInput extends Label implements IUIComponent { ...@@ -224,8 +224,6 @@ export class TextInput extends Label implements IUIComponent {
this.fillColor = this._oldFillColor; this.fillColor = this._oldFillColor;
this.strokeColor = this._oldStrokeColor; this.strokeColor = this._oldStrokeColor;
this.dispatchEvent(Event.BLUR);
} }
private onFocus = (e) => { private onFocus = (e) => {
...@@ -235,6 +233,8 @@ export class TextInput extends Label implements IUIComponent { ...@@ -235,6 +233,8 @@ export class TextInput extends Label implements IUIComponent {
private onBlur = (e) => { private onBlur = (e) => {
this.setBlur(); this.setBlur();
this.dispatchEvent(Event.BLUR);
delayScrollTop(); delayScrollTop();
}; };
......
...@@ -4,20 +4,21 @@ ...@@ -4,20 +4,21 @@
const storeKey = 'zlog-switch'; const storeKey = 'zlog-switch';
export enum Logs{ export enum Logs {
PROCESS = 'process', PROCESS = 'process',
} }
let store; let store;
try { try {
store = JSON.parse(localStorage.getItem(storeKey)); let t = localStorage.getItem(storeKey);
store = t ? JSON.parse(t) : null;
store = store === null ? false : store; store = store === null ? false : store;
} catch (e) { } catch (e) {
store = false; store = false;
localStorage.setItem(storeKey, JSON.stringify(store)); localStorage.setItem(storeKey, JSON.stringify(store));
} }
export function getLogSwitch(id):boolean | Array { export function getLogSwitch(id): boolean | Array {
return typeof store === 'object' ? store[id] : !!store; return typeof store === 'object' ? store[id] : !!store;
} }
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
<module type="WEB_MODULE" version="4"> <module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$" />
<excludeFolder url="file://$MODULE_DIR$/dist" /> <orderEntry type="inheritedJdk" />
</content>
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment