Files
esengine/demo/libs/modules/eui/eui.min.js

7 lines
206 KiB
JavaScript
Raw Normal View History

2020-06-08 11:49:45 +08:00
var __reflect=this&&this.__reflect||function(t,e,i){t.__class__=e,i?i.push(e):i=[e],t.__types__=t.__types__?i.concat(t.__types__):i},__extends=this&&this.__extends||function(t,e){function i(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);i.prototype=e.prototype,t.prototype=new i},eui;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.targetLevel=Number.POSITIVE_INFINITY,e.invalidatePropertiesFlag=!1,e.invalidateClientPropertiesFlag=!1,e.invalidatePropertiesQueue=new i,e.invalidateSizeFlag=!1,e.invalidateClientSizeFlag=!1,e.invalidateSizeQueue=new i,e.invalidateDisplayListFlag=!1,e.invalidateDisplayListQueue=new i,e.eventDisplay=new egret.Bitmap,e.listenersAttached=!1,e}return __extends(e,t),e.prototype.invalidateProperties=function(t){this.invalidatePropertiesFlag||(this.invalidatePropertiesFlag=!0,this.listenersAttached||this.attachListeners()),this.targetLevel<=t.$nestLevel&&(this.invalidateClientPropertiesFlag=!0),this.invalidatePropertiesQueue.insert(t)},e.prototype.validateProperties=function(){for(var t=this.invalidatePropertiesQueue,e=t.shift();e;)e.$stage&&e.validateProperties(),e=t.shift();t.isEmpty()&&(this.invalidatePropertiesFlag=!1)},e.prototype.invalidateSize=function(t){this.invalidateSizeFlag||(this.invalidateSizeFlag=!0,this.listenersAttached||this.attachListeners()),this.targetLevel<=t.$nestLevel&&(this.invalidateClientSizeFlag=!0),this.invalidateSizeQueue.insert(t)},e.prototype.validateSize=function(){for(var t=this.invalidateSizeQueue,e=t.pop();e;)e.$stage&&e.validateSize(),e=t.pop();t.isEmpty()&&(this.invalidateSizeFlag=!1)},e.prototype.invalidateDisplayList=function(t){this.invalidateDisplayListFlag||(this.invalidateDisplayListFlag=!0,this.listenersAttached||this.attachListeners()),this.invalidateDisplayListQueue.insert(t)},e.prototype.validateDisplayList=function(){for(var t=this.invalidateDisplayListQueue,e=t.shift();e;)e.$stage&&e.validateDisplayList(),e=t.shift();t.isEmpty()&&(this.invalidateDisplayListFlag=!1)},e.prototype.attachListeners=function(){this.eventDisplay.addEventListener(egret.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this),this.eventDisplay.addEventListener(egret.Event.RENDER,this.doPhasedInstantiationCallBack,this),egret.sys.$invalidateRenderFlag=!0,this.listenersAttached=!0},e.prototype.doPhasedInstantiationCallBack=function(t){this.eventDisplay.removeEventListener(egret.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this),this.eventDisplay.removeEventListener(egret.Event.RENDER,this.doPhasedInstantiationCallBack,this),this.doPhasedInstantiation()},e.prototype.doPhasedInstantiation=function(){this.invalidatePropertiesFlag&&this.validateProperties(),this.invalidateSizeFlag&&this.validateSize(),this.invalidateDisplayListFlag&&this.validateDisplayList(),this.invalidatePropertiesFlag||this.invalidateSizeFlag||this.invalidateDisplayListFlag?this.attachListeners():this.listenersAttached=!1},e.prototype.validateClient=function(t){var e,i=!1,n=this.targetLevel;this.targetLevel===Number.POSITIVE_INFINITY&&(this.targetLevel=t.$nestLevel);for(var r=this.invalidatePropertiesQueue,o=this.invalidateSizeQueue,s=this.invalidateDisplayListQueue;!i;){for(i=!0,e=r.removeSmallestChild(t);e;)e.$stage&&e.validateProperties(),e=r.removeSmallestChild(t);for(r.isEmpty()&&(this.invalidatePropertiesFlag=!1),this.invalidateClientPropertiesFlag=!1,e=o.removeLargestChild(t);e;){if(e.$stage&&e.validateSize(),this.invalidateClientPropertiesFlag&&(e=r.removeSmallestChild(t))){r.insert(e),i=!1;break}e=o.removeLargestChild(t)}for(o.isEmpty()&&(this.invalidateSizeFlag=!1),this.invalidateClientPropertiesFlag=!1,this.invalidateClientSizeFlag=!1,e=s.removeSmallestChild(t);e;){if(e.$stage&&e.validateDisplayList(),this.invalidateClientPropertiesFlag&&(e=r.removeSmallestChild(t))){r.insert(e),i=!1;break}if(this.invalidateClientSizeFlag&&(e=o.removeLargestChild(t))){o.insert(e),i=!1;break}e=s.removeSmallestChild(t)}s.isEmpty()&&(this.invalidateDisplayListFlag=!1)}n===Number.POSITIVE_INFINITY&&(this.targetLevel=Number.POSITIVE_INFINITY)},
(t>s||s>e)&&this.freeRendererByIndex(s)}},i.prototype.getElementAt=function(t){return this.$indexToRenderer[t]},i.prototype.getVirtualElementAt=function(t){if(t=0|+t,0>t||t>=this.$dataProvider.length)return null;var e=this.$indexToRenderer[t];if(!e){var i=this.$dataProvider.getItemAt(t);e=this.createVirtualRenderer(i),this.$indexToRenderer[t]=e,this.updateRenderer(e,t,i);var n=this.$DataGroup;n[4]&&(e.validateNow(),n[4]=!1,this.rendererAdded(e,t,i))}return e},i.prototype.freeRendererByIndex=function(t){var e=this.$indexToRenderer[t];e&&(delete this.$indexToRenderer[t],this.doFreeRenderer(e))},i.prototype.doFreeRenderer=function(t){var e=this.$DataGroup,i=e[2][t.$hashCode],n=i.$hashCode;e[3][n]||(e[3][n]=[]),e[3][n].push(t),t.visible=!1},i.prototype.invalidateSize=function(){this.$DataGroup[4]||e.prototype.invalidateSize.call(this)},i.prototype.createVirtualRenderer=function(t){var e,i=this.itemToRendererClass(t),n=i.$hashCode,r=this.$DataGroup,o=r[3];return o[n]&&o[n].length>0?(e=o[n].pop(),e.visible=!0,this.invalidateDisplayList(),e):(r[4]=!0,this.createOneRenderer(i))},i.prototype.createOneRenderer=function(t){var e=new t,i=this.$DataGroup;return i[2][e.$hashCode]=t,egret.is(e,"eui.IItemRenderer")?(i[13]&&this.setItemRenderSkinName(e,i[13]),this.addChild(e),e):null},i.prototype.setItemRenderSkinName=function(e,i){if(e&&e instanceof t.Component){var n=e;n.$Component[5]||(n.skinName=i,n.$Component[5]=!1)}},Object.defineProperty(i.prototype,"dataProvider",{get:function(){return this.$dataProvider},set:function(t){this.$setDataProvider(t)},enumerable:!0,configurable:!0}),i.prototype.$setDataProvider=function(t){return this.$dataProvider==t||t&&!t.getItemAt?!1:(this.removeDataProviderListener(),this.$dataProvider=t,this.$dataProviderChanged=!0,this.$DataGroup[10]=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList(),!0)},i.prototype.removeDataProviderListener=function(){this.$dataProvider&&this.$dataProvider.removeEventListener(t.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this)},i.prototype.onCollectionChange=function(e){switch(e.kind){case t.CollectionEventKind.ADD:this.itemAddedHandler(e.items,e.location);break;case t.CollectionEventKind.REMOVE:this.itemRemovedHandler(e.items,e.location);break;case t.CollectionEventKind.UPDATE:case t.CollectionEventKind.REPLACE:this.itemUpdatedHandler(e.items[0],e.location);break;case t.CollectionEventKind.RESET:case t.CollectionEventKind.REFRESH:if(this.$layout&&this.$layout.$useVirtualLayout)for(var i=this.$indexToRenderer,n=Object.keys(i),r=n.length,o=r-1;o>=0;o--){var s=+n[o];this.freeRendererByIndex(s)}this.$dataProviderChanged=!0,this.invalidateProperties();break;default:egret.$warn(2204,e.kind)}this.invalidateSize(),this.invalidateDisplayList()},i.prototype.itemAddedHandler=function(t,e){for(var i=t.length,n=0;i>n;n++)this.itemAdded(t[n],e+n);this.resetRenderersIndices()},i.prototype.itemRemovedHandler=function(t,e){for(var i=t.length,n=i-1;n>=0;n--)this.itemRemoved(t[n],e+n);this.resetRenderersIndices()},i.prototype.itemAdded=function(t,e){if(this.$layout&&this.$layout.elementAdded(e),this.$layout&&this.$layout.$useVirtualLayout)return void this.$indexToRenderer.splice(e,0,null);var i=this.createVirtualRenderer(t);if(this.$indexToRenderer.splice(e,0,i),i){this.updateRenderer(i,e,t);var n=this.$DataGroup;n[4]&&(n[4]=!1,this.rendererAdded(i,e,t))}},i.prototype.itemRemoved=function(t,e){this.$layout&&this.$layout.elementRemoved(e);var i=this.$indexToRenderer[e];this.$indexToRenderer.length>e&&this.$indexToRenderer.splice(e,1),i&&(this.$layout&&this.$layout.$useVirtualLayout?this.doFreeRenderer(i):(this.rendererRemoved(i,e,t),this.removeChild(i)))},i.prototype.resetRenderersIndices=function(){var t=this.$indexToRenderer;if(0!=t.length)if(this.$layout&&this.$layout.$useVirtualLayout)for(var e=Object.keys(t),i=e.length,n=0;i>n;n++){var r=+e[n];this.resetRendererItemIndex(r)}else for(var o=t.length,r=0;o>r;r++)this.resetRendererItemIndex(r)},i.prototype.itemUpdatedHandler=function(t,e){if(!this.$DataGroup[11]){var i=this.$indexToRenderer[e];i&&
break;case"number":i=o,-1!=i.indexOf("%")&&(i=i.substring(0,i.length-1));break;case"string":i=this.formatString(o)}return n&&(n.defaultValue=i),i},e.prototype.addAttributesToCodeBlock=function(e,i,n){var r,o,s=n.attributes,a=Object.keys(s);a.sort();for(var h=a.length,l=0;h>l;l++)if(r=a[l],this.isNormalKey(r)&&(o=s[r],r=this.formatKey(r,o),o=this.formatValue(r,o,n))){if(this.currentClass.getVariableByName(o)){var u="this.",p=s.id,c=u+p+" = t;";this.currentClass.getVariableByName(p)||this.createVarForNode(n),e.containsCodeLine(c)||e.addCodeLineAt(c,1);var d=new t.EXCodeBlock;"this"==i?d.addAssignment(i,u+o,r):(d.startIf(u+p),d.addAssignment(u+p,u+o,r),d.endBlock()),this.delayAssignmentDic[o]||(this.delayAssignmentDic[o]=[]),this.delayAssignmentDic[o].push(d),o=u+o}e.addAssignment(i,o,r)}},e.prototype.initlizeChildNode=function(e,n,r){var o=e.children;if(o&&0!=o.length){for(var s,a=t.exmlConfig.getClassNameById(e.localName,e.namespace),h=[],l=o.length,u=[],p=0;l>p;p++){var c=o[p];if(1==c.nodeType&&c.namespace!=t.NS_W)if(this.isInnerClass(c)){if("Skin"==c.localName){var f=this.parseInnerClass(c),g=t.exmlConfig.getPropertyType(d,a);g?n.addAssignment(r,f,d):egret.$error(2005,this.currentClassName,d,i(c))}}else{var y=c.localName;if(this.isProperty(c)){if(!this.isNormalKey(y))continue;var g=t.exmlConfig.getPropertyType(c.localName,a);if(!g)continue;if(!c.children||0==c.children.length)continue;this.addChildrenToProp(c.children,g,y,n,r,s,u,e)}else h.push(c)}}if(0!=h.length){var v=t.exmlConfig.getDefaultPropById(e.localName,e.namespace),m=t.exmlConfig.getPropertyType(v,a);v&&m&&this.addChildrenToProp(h,m,v,n,r,s,u,e)}}},e.prototype.parseInnerClass=function(t){var i=n.pop();i||(i=new e);var o=this.currentClass.className+"$"+t.localName+r++,s=i.parseClass(t,o);return this.currentClass.addInnerClass(s),n.push(i),o},e.prototype.addChildrenToProp=function(t,e,i,n,r,o,s,a){var h="",p=t.length;if(p>1){if(e!=u)return;for(var c=[],d=0;p>d;d++){var f=t[d];if(1==f.nodeType){h=this.createFuncForNode(f);this.getClassNameOfNode(f);this.isStateNode(f)||c.push(h)}}h="["+c.join(",")+"]"}else{var g=t[0];if(e==u)if(g.localName==u){var c=[];if(g.children)for(var y=g.children.length,v=0;y>v;v++){var f=g.children[v];if(1==f.nodeType){h=this.createFuncForNode(f);this.getClassNameOfNode(f);this.isStateNode(f)||c.push(h)}}h="["+c.join(",")+"]"}else{h=this.createFuncForNode(g);this.getClassNameOfNode(g);h=this.isStateNode(g)?"[]":"["+h+"]"}else if(1==g.nodeType)if(e==l){if(p>1)return;h=this.parseInnerClass(t[0])}else{this.getClassNameOfNode(g);h=this.createFuncForNode(g)}else h=this.formatValue(i,g.text,a)}""!=h&&(-1==h.indexOf("()")&&(i=this.formatKey(i,h)),-1==s.indexOf(i)&&s.push(i),n.addAssignment(r,h,i))},e.prototype.isProperty=function(e){if(e.hasOwnProperty("isProperty"))return e.isProperty;var i,n=e.localName;if(n&&1===e.nodeType&&e.parent&&!this.isBasicTypeData(n)){var r=e.parent,o=n.indexOf(".");-1!=o&&(n=n.substr(0,o));var s=t.exmlConfig.getClassNameById(r.localName,r.namespace);i=!!t.exmlConfig.getPropertyType(n,s)}else i=!1;return e.isProperty=i,i},e.prototype.isNormalKey=function(t){return t&&-1==t.indexOf(".")&&-1==t.indexOf(":")&&-1==g.indexOf(t)?!0:!1},e.prototype.formatKey=function(t,e){return-1!=e.indexOf("%")&&("height"==t?t="percentHeight":"width"==t&&(t="percentWidth")),t},e.prototype.formatValue=function(e,i,n){i||(i="");var r=i;i=i.trim();var o=this.getClassNameOfNode(n),s=t.exmlConfig.getPropertyType(e,o),a=this.formatBinding(e,i,n);if(a){this.checkIdForState(n);var u="this";n!==this.currentXML&&(u+="."+n.attributes.id),this.bindings.push(new t.EXBinding(u,e,a.templates,a.chainIndex)),i=""}else if(s==h){i="new "+h+"("+i+")"}else if(s==p)-1!=i.indexOf("%")&&(i=this.formatString(i));else{switch(s){case l:e==d&&(i=this.formatString(r));break;case"number":0==i.indexOf("#")?i="0x"+i.substring(1):-1!=i.indexOf("%")&&(i=parseFloat(i.substr(0,i.length-1)).toString());break;case"boolean":i="false"!=i&&i?"true":"false";break;case"string":case"any":i=this.formatString(r)}}return i},e.prototype.formatString=function(t){return t=this.unescapeH
},i.prototype.commitMultipleSelection=function(){var t,e,i=[],n=[],r=this._selectedIndices,o=this._proposedSelectedIndices;if(r.length>0&&o.length>0){for(e=o.length,t=0;e>t;t++)-1==r.indexOf(o[t])&&n.push(o[t]);for(e=r.length,t=0;e>t;t++)-1==o.indexOf(r[t])&&i.push(r[t])}else r.length>0?i=r:o.length>0&&(n=o);if(this._selectedIndices=o,i.length>0)for(e=i.length,t=0;e>t;t++)this.itemSelected(i[t],!1);if(n.length>0)for(e=n.length,t=0;e>t;t++)this.itemSelected(n[t],!0);this._proposedSelectedIndices=null},i.prototype.$isItemIndexSelected=function(t){return this.allowMultipleSelection?-1!=this._selectedIndices.indexOf(t):e.prototype.$isItemIndexSelected.call(this,t)},i.prototype.dataProviderRefreshed=function(){this.allowMultipleSelection||e.prototype.dataProviderRefreshed.call(this)},i.prototype.calculateSelectedIndices=function(t){var e=[],i=this._selectedIndices,n=i.length;if(n>0){if(1==n&&i[0]==t)return this.$ListBase[0]?(e.splice(0,0,i[0]),e):e;for(var r=!1,o=0;n>o;o++)i[o]==t?r=!0:i[o]!=t&&e.splice(0,0,i[o]);return r||e.splice(0,0,t),e}return e.splice(0,0,t),e},i.prototype.onRendererTouchEnd=function(i){if(this.allowMultipleSelection){var n=i.currentTarget,r=this.$ListBase[7];if(n!=r)return;this.setSelectedIndices(this.calculateSelectedIndices(n.itemIndex),!0),t.ItemTapEvent.dispatchItemTapEvent(this,t.ItemTapEvent.ITEM_TAP,n)}else e.prototype.onRendererTouchEnd.call(this,i)},i}(t.ListBase);t.List=e,__reflect(e.prototype,"eui.List")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){var t=e.call(this)||this;return t.closeButton=null,t.moveArea=null,t.titleDisplay=null,t._title="",t.offsetPointX=0,t.offsetPointY=0,t.addEventListener(egret.TouchEvent.TOUCH_BEGIN,t.onWindowTouchBegin,t,!1,100),t}return __extends(i,e),i.prototype.onWindowTouchBegin=function(t){this.$parent.addChild(this)},Object.defineProperty(i.prototype,"elementsContent",{set:function(t){if(t)for(var e=t.length,i=0;e>i;i++)this.addChild(t[i])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(t){this._title=t,this.titleDisplay&&(this.titleDisplay.text=this.title)},enumerable:!0,configurable:!0}),i.prototype.partAdded=function(t,i){e.prototype.partAdded.call(this,t,i),i==this.titleDisplay?this.titleDisplay.text=this._title:i==this.moveArea?this.moveArea.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this):i==this.closeButton&&this.closeButton.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onCloseButtonClick,this)},i.prototype.partRemoved=function(t,i){e.prototype.partRemoved.call(this,t,i),i==this.moveArea?this.moveArea.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this):i==this.closeButton&&this.closeButton.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onCloseButtonClick,this)},i.prototype.onCloseButtonClick=function(e){t.UIEvent.dispatchUIEvent(this,t.UIEvent.CLOSING,!0,!0)&&this.close()},i.prototype.close=function(){this.$parent&&this.$parent.removeChild(this)},i.prototype.onTouchBegin=function(t){this.$includeInLayout=!1,this.offsetPointX=this.x-t.$stageX,this.offsetPointY=this.y-t.$stageY,this.$stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this),this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEnd,this)},i.prototype.onTouchMove=function(t){this.x=t.$stageX+this.offsetPointX,this.y=t.$stageY+this.offsetPointY},i.prototype.onTouchEnd=function(t){var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEnd,this)},i}(t.Component);t.Panel=e,__reflect(e.prototype,"eui.Panel"),t.registerProperty(e,"elementsContent","Array",!0)}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){var i=e.call(this)||this;return i.thumb=null,i.labelDisplay=null,i._labelFunction=null,i._slideDuration=500,i._direction=t.Direction.LTR,i.slideToValue=0,i.animationValue=0,i.thumbInitX=0,i.thumbInitY=0,i.animation=new t.sys.Animation(i.animationUpdateHandler,i),i}return __extends(i,e),Object.defi
},n.prototype.textDisplayAdded=function(){var t=this.$TextInput;t[1]&&(this.textDisplay.displayAsPassword=t[1]),t[2]&&(this.textDisplay.textColor=t[2]),t[3]&&(this.textDisplay.maxChars=t[3]),t[4]&&(this.textDisplay.maxWidth=t[4]),t[5]&&(this.textDisplay.maxHeight=t[5]),t[6]&&(this.textDisplay.text=t[6]),t[7]&&(this.textDisplay.restrict=t[7]),t[8]&&(this.textDisplay.inputType=t[8])},n.prototype.textDisplayRemoved=function(){var t=this.$TextInput;t[1]=this.textDisplay.displayAsPassword,t[2]=this.textDisplay.textColor,t[3]=this.textDisplay.maxChars,t[4]=this.textDisplay.maxWidth,t[5]=this.textDisplay.maxHeight,t[6]=this.textDisplay.text,t[7]=this.textDisplay.restrict,t[8]=this.textDisplay.inputType},n}(t.Component);t.TextInput=i,__reflect(i.prototype,"eui.TextInput")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){return t.call(this)||this}return __extends(e,t),e}(t.ToggleButton);t.CheckBox=e,__reflect(e.prototype,"eui.CheckBox")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){return t.call(this)||this}return __extends(e,t),e}(t.ToggleButton);t.ToggleSwitch=e,__reflect(e.prototype,"eui.ToggleSwitch")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.addEventListener(egret.Event.ADDED_TO_STAGE,e.onAddToStage,e),e.addEventListener(egret.Event.REMOVED_FROM_STAGE,e.onRemoveFromStage,e),e}return __extends(e,t),e.prototype.onAddToStage=function(t){this.$stage.addEventListener(egret.Event.RESIZE,this.onResize,this),this.onResize()},e.prototype.onRemoveFromStage=function(t){this.$stage.removeEventListener(egret.Event.RESIZE,this.onResize,this)},e.prototype.onResize=function(t){var e=this.$stage;this.$setWidth(e.$stageWidth),this.$setHeight(e.$stageHeight)},e}(t.Group);t.UILayer=e,__reflect(e.prototype,"eui.UILayer")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.updateDisplayList=function(e,i){t.prototype.updateDisplayList.call(this,e,i);var n=this.thumb,r=this.$viewport;if(n&&r){var o=egret.$TempRectangle;n.getPreferredBounds(o);var s=o.height,a=o.x,h=r.scrollV,l=r.contentHeight,u=r.height;if(0>=h){var p=s*(1- -h/(.5*u));p=Math.max(5,Math.round(p)),n.setLayoutBoundsSize(0/0,p),n.setLayoutBoundsPosition(a,0)}else if(h>=l-u){var p=s*(1-(h-l+u)/(.5*u));p=Math.max(5,Math.round(p)),n.setLayoutBoundsSize(0/0,p),n.setLayoutBoundsPosition(a,i-p)}else{var c=(i-s)*h/(l-u);n.setLayoutBoundsSize(0/0,0/0),n.setLayoutBoundsPosition(a,c)}}},e.prototype.onPropertyChanged=function(t){switch(t.property){case"scrollV":case"contentHeight":this.invalidateDisplayList()}},e}(t.ScrollBarBase);t.VScrollBar=e,__reflect(e.prototype,"eui.VScrollBar")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.pointToValue=function(t,e){if(!this.thumb||!this.track)return 0;var i=this.$Range,n=i[0]-i[2],r=this.getThumbRange();return i[2]+(0!=r?(r-e)/r*n:0)},e.prototype.getThumbRange=function(){var t=egret.$TempRectangle;this.track.getLayoutBounds(t);var e=t.height;return this.thumb.getLayoutBounds(t),e-t.height},e.prototype.updateSkinDisplayList=function(){if(this.thumb&&this.track){var t=this.$Range,e=this.getThumbRange(),i=t[0]-t[2],n=i>0?e-(this.pendingValue-t[2])/i*e:0,r=this.track.localToGlobal(0,n,egret.$TempPoint),o=r.x,s=r.y,a=this.thumb.$parent.globalToLocal(o,s,egret.$TempPoint).y,h=egret.$TempRectangle,l=h.height;if(this.thumb.getLayoutBounds(h),this.thumb.setLayoutBoundsPosition(h.x,Math.round(a)),this.trackHighlight){var u=this.trackHighlight.$parent.globalToLocal(o,s,egret.$TempPoint).y;this.trackHighlight.y=Math.round(u+l),this.trackHighlight.height=Math.round(e-u)}}},e}(t.SliderBase);t.VSlider=e,__reflect(e.prototype,"eui.VSlider")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._selectedChild=null,i.proposedSelectedIndex=t.ListBase.NO_PROPOSED_SELECTION,i._selectedIndex=-1,i}return __extends(i,e),Object.defineProperty(i.prototype,"l
return o.target=e,o.property=i,o.position=n,o.relativeTo=r,o}return __extends(e,t),e.prototype.toCode=function(){var t="new "+i+'("'+this.target+'","'+this.property+'",'+this.position+',"'+this.relativeTo+'")';return t},e}(s);t.EXAddItems=c,__reflect(c.prototype,"eui.sys.EXAddItems");var d=function(t){function e(e,i,n){var r=t.call(this)||this;return r.target=e,r.name=i,r.value=n,r}return __extends(e,t),e.prototype.toCode=function(){return"new "+n+'("'+this.target+'","'+this.name+'",'+this.value+")"},e}(s);t.EXSetProperty=d,__reflect(d.prototype,"eui.sys.EXSetProperty");var f=function(t){function e(e,i,n,r){var o=t.call(this)||this;return e=e?"this."+e:"this",o.target=e,o.property=i,o.templates=n,o.chainIndex=r,o}return __extends(e,t),e.prototype.toCode=function(){var t=this.templates.join(","),e=this.chainIndex.join(",");return"new "+r+"(this, ["+t+"],["+e+"],"+this.target+',"'+this.property+'")'},e}(s);t.EXSetStateProperty=f,__reflect(f.prototype,"eui.sys.EXSetStateProperty");var g=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.target=e,o.property=i,o.templates=n,o.chainIndex=r,o}return __extends(e,t),e.prototype.toCode=function(){var t=this.templates.join(","),e=this.chainIndex.join(",");return o+"(this, ["+t+"],["+e+"],"+this.target+',"'+this.property+'")'},e}(s);t.EXBinding=g,__reflect(g.prototype,"eui.sys.EXBinding")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=t.sys.UIComponentImpl,i=function(i){function n(t){var e=i.call(this)||this;return e.$createChildrenCalled=!1,e.$fontChanged=!1,e._widthConstraint=0/0,e._heightConstraint=0/0,e.initializeUIValues(),e.text=t,e}return __extends(n,i),n.prototype.$invalidateContentBounds=function(){i.prototype.$invalidateContentBounds.call(this),this.invalidateSize()},n.prototype.$setWidth=function(t){var n=i.prototype.$setWidth.call(this,t),r=e.prototype.$setWidth.call(this,t);return n&&r},n.prototype.$setHeight=function(t){var n=i.prototype.$setHeight.call(this,t),r=e.prototype.$setHeight.call(this,t);return n&&r},n.prototype.$setText=function(e){var n=i.prototype.$setText.call(this,e);return t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"text"),n},n.prototype.$setFont=function(t){return this.$fontForBitmapLabel==t?!1:(this.$fontForBitmapLabel=t,this.$createChildrenCalled?this.$parseFont():this.$fontChanged=!0,this.$fontStringChanged=!0,!0)},n.prototype.$parseFont=function(){this.$fontChanged=!1;var e=this.$fontForBitmapLabel;"string"==typeof e?t.getAssets(e,function(t){this.$setFontData(t,e)},this):this.$setFontData(e)},n.prototype.$setFontData=function(t,e){return e&&e!=this.$fontForBitmapLabel?void 0:t==this.$font?!1:(this.$font=t,this.$invalidateContentBounds(),!0)},n.prototype.createChildren=function(){this.$fontChanged&&this.$parseFont(),this.$createChildrenCalled=!0},n.prototype.childrenCreated=function(){},n.prototype.commitProperties=function(){},n.prototype.measure=function(){var t=this.$UIComponent,e=this.$textFieldWidth,n=this.$textFieldHeight,r=0/0;isNaN(this._widthConstraint)?isNaN(t[8])?1e5!=t[13]&&(r=t[13]):r=t[8]:(r=this._widthConstraint,this._widthConstraint=0/0),i.prototype.$setWidth.call(this,r);var o=0/0;isNaN(this._heightConstraint)?isNaN(t[9])?1e5!=t[15]&&(o=t[15]):o=t[9]:(o=this._heightConstraint,this._heightConstraint=0/0),i.prototype.$setHeight.call(this,o),this.setMeasuredSize(this.textWidth,this.textHeight),i.prototype.$setWidth.call(this,e),i.prototype.$setHeight.call(this,n)},n.prototype.updateDisplayList=function(t,e){i.prototype.$setWidth.call(this,t),i.prototype.$setHeight.call(this,e)},n.prototype.invalidateParentLayout=function(){},n.prototype.setMeasuredSize=function(t,e){},n.prototype.invalidateProperties=function(){},n.prototype.validateProperties=function(){},n.prototype.invalidateSize=function(){},n.prototype.validateSize=function(t){},n.prototype.invalidateDisplayList=function(){},n.prototype.validateDisplayList=function(){},n.prototype.validateNow=function(){},n.prototype.setLayoutBoundsSize=function(t,i){if(e.prototype.setLayoutBoundsSize.call(this,t,i),!isNaN(t)&&t!=
var u=this.endIndex;o.setVirtualElementIndicesInView(this.startIndex,u);for(var p,c,d,f,g,y=this._orientation==t.TileOrientation.COLUMNS,v=this.startIndex,m=isNaN(this._horizontalGap)?0:this._horizontalGap,$=isNaN(this._verticalGap)?0:this._verticalGap,E=this._rowCount,C=this._columnCount,_=this._columnWidth,b=this._rowHeight,T=this.startIndex;u>=T;T++)if(p=this.$useVirtualLayout?this.target.getVirtualElementAt(T):this.target.getElementAt(T),egret.is(p,e)&&p.$includeInLayout){switch(y?(f=Math.ceil((v+1)/E)-1,g=Math.ceil((v+1)%E)-1,-1==g&&(g=E-1)):(f=Math.ceil((v+1)%C)-1,-1==f&&(f=C-1),g=Math.ceil((v+1)/C)-1),this._horizontalAlign){case egret.HorizontalAlign.RIGHT:c=n-(f+1)*(_+m)+m-a;break;case egret.HorizontalAlign.LEFT:c=f*(_+m)+s;break;default:c=f*(_+m)+s}switch(this._verticalAlign){case egret.VerticalAlign.TOP:d=g*(b+$)+h;break;case egret.VerticalAlign.BOTTOM:d=r-(g+1)*(b+$)+$-l;break;default:d=g*(b+$)+h}this.sizeAndPositionElement(p,c,d,_,b),v++}var S=s+a,x=h+l,I=(_+m)*C-m,P=(b+$)*E-$;o.setContentSize(I+S,P+x)}},n.prototype.sizeAndPositionElement=function(e,i,n,r,o){var s=0/0,a=0/0,h=e.$UIComponent;this._horizontalAlign==t.JustifyAlign.JUSTIFY?s=r:isNaN(h[6])||(s=r*h[6]*.01),this._verticalAlign==t.JustifyAlign.JUSTIFY?a=o:isNaN(h[7])||(a=o*h[7]*.01),e.setLayoutBoundsSize(Math.round(s),Math.round(a));var l=i,u=egret.$TempRectangle;switch(e.getLayoutBounds(u),this._horizontalAlign){case egret.HorizontalAlign.RIGHT:l+=r-u.width;break;case egret.HorizontalAlign.CENTER:l=i+(r-u.width)/2}var p=n;switch(this._verticalAlign){case egret.VerticalAlign.BOTTOM:p+=o-u.height;break;case egret.VerticalAlign.MIDDLE:p+=(o-u.height)/2}e.setLayoutBoundsPosition(Math.round(l),Math.round(p))},n.prototype.adjustForJustify=function(e,i){var n=this._paddingLeft,r=this._paddingRight,o=this._paddingTop,s=this._paddingBottom,a=Math.max(0,e-n-r),h=Math.max(0,i-o-s);isNaN(this.explicitVerticalGap)||(this._verticalGap=this.explicitVerticalGap),isNaN(this.explicitHorizontalGap)||(this._horizontalGap=this.explicitHorizontalGap),this._verticalGap=isNaN(this._verticalGap)?0:this._verticalGap,this._horizontalGap=isNaN(this._horizontalGap)?0:this._horizontalGap;var l,u=h-this._rowHeight*this._rowCount,p=a-this._columnWidth*this._columnCount;u>0&&(this._rowAlign==t.RowAlign.JUSTIFY_USING_GAP?(l=Math.max(1,this._rowCount-1),this._verticalGap=u/l):this._rowAlign==t.RowAlign.JUSTIFY_USING_HEIGHT&&this._rowCount>0&&(this._rowHeight+=(u-(this._rowCount-1)*this._verticalGap)/this._rowCount)),p>0&&(this._columnAlign==t.ColumnAlign.JUSTIFY_USING_GAP?(l=Math.max(1,this._columnCount-1),this._horizontalGap=p/l):this._columnAlign==t.ColumnAlign.JUSTIFY_USING_WIDTH&&this._columnCount>0&&(this._columnWidth+=(p-(this._columnCount-1)*this._horizontalGap)/this._columnCount))},n}(t.LayoutBase);t.TileLayout=i,__reflect(i.prototype,"eui.TileLayout")}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}return t.ROWS="rows",t.COLUMNS="columns",t}();t.TileOrientation=e,__reflect(e.prototype,"eui.TileOrientation")}(eui||(eui={}));var eui;!function(t){var e="eui.UIComponent",i=function(i){function n(){return null!==i&&i.apply(this,arguments)||this}return __extends(n,i),n.prototype.measureReal=function(){for(var t=this.$target,i=t.numElements,n=i,r=0,o=0,s=egret.$TempRectangle,a=0;i>a;a++){var h=t.getElementAt(a);egret.is(h,e)&&h.$includeInLayout?(h.getPreferredBounds(s),o+=s.height,r=Math.max(r,s.width)):n--}o+=(n-1)*this.$gap;var l=this.$paddingLeft+this.$paddingRight,u=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(r+l,o+u)},n.prototype.measureVirtual=function(){for(var t=this.$target,i=this.$typicalHeight,n=this.getElementTotalSize(),r=Math.max(this.maxElementSize,this.$typicalWidth),o=egret.$TempRectangle,s=this.endIndex,a=this.elementSizeTable,h=this.startIndex;s>h;h++){var l=t.getElementAt(h);egret.is(l,e)&&l.$includeInLayout&&(l.getPreferredBounds(o),n+=o.height,n-=isNaN(a[h])?i:a[h],r=Math.max(r,o.width))}var u=this.$paddingLeft+this.$paddingRight,p=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(r+u,n+p)},n.prototype.updateDisplayListReal