From 4fe08eb44bacac084105e608bfa4ff9a2328d13f Mon Sep 17 00:00:00 2001 From: wangyi7099 <724003548@qq.com> Date: Thu, 26 Apr 2018 12:54:25 +0800 Subject: [PATCH] build: release 4.5.0 --- README-ZH.md | 4 ---- README.md | 5 +---- dist/vuescroll.common.js | 8 ++------ dist/vuescroll.common.min.js | 4 ++-- dist/vuescroll.esm.js | 8 ++------ dist/vuescroll.esm.min.js | 4 ++-- dist/vuescroll.js | 8 ++------ dist/vuescroll.min.js | 4 ++-- package.json | 2 +- src/config/global-config.js | 6 ++---- src/util/index.js | 12 ++---------- 11 files changed, 18 insertions(+), 47 deletions(-) diff --git a/README-ZH.md b/README-ZH.md index c8410883..e78da12f 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -13,10 +13,6 @@ vuescroll 是一个基于 [vue.js 2.X](https://github.com/vuejs/vue) 并且同时支持PC端和移动端的虚拟滚动条.你能够在浏览器环境中定制你喜欢的样式而不是用原生的滚动条.[这里是官方网站](https://wangyi7099.github.io/VuescrollDocs)。 - - ## 虚拟滚动条的使用例子 - [element](http://element-cn.eleme.io/#/zh-CN/component/installation),[slimScroll](https://github.com/rochal/jQuery-slimScroll) and [CodePen(Code edit box)](https://codepen.io/wangyi7099/) 正在用. - ## 特点 * [scrollor](https://github.com/pbakaus/scroller)的完整特性. * [强大的配置](https://github.com/wangyi7099/vuescroll/blob/dev/src/config/GlobalConfig.js)能使你定制自己的滚动条。 diff --git a/README.md b/README.md index fca07624..21e7d577 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,8 @@ vuescroll is a virtual scrollbar based on [vue.js 2.X](https://github.com/vuejs/vue) which can both support PC and mobile phone.You can customize the scrollbar how you like instead of using native in browser. Here is the offical [website](https://wangyi7099.github.io/VuescrollDocs). -## Use case of virtual scrollbar - [element](http://element-cn.eleme.io/#/zh-CN/component/installation),[slimScroll](https://github.com/rochal/jQuery-slimScroll) and [CodePen(Code edit box)](https://codepen.io/wangyi7099/) are using it. Here is the offical [website](https://wangyi7099.github.io/VuescrollDocs) of vuescroll. - ## Features -* Whole features of [scrollor](https://github.com/pbakaus/scroller). +* Full features of [scrollor](https://github.com/pbakaus/scroller). * Ability to customize scrollbar by [powerful configurations](https://github.com/wangyi7099/vuescroll/blob/dev/src/config/GlobalConfig.js). * Ability to [detect size change](https://wangyi7099.github.io/VuescrollDocs/getStarted/en/event/handle-resize.html) of content and automatically update. * [smooth-scroll](https://github.com/cferdinandi/smooth-scroll) Integration. diff --git a/dist/vuescroll.common.js b/dist/vuescroll.common.js index 715bfb3f..88232d44 100644 --- a/dist/vuescroll.common.js +++ b/dist/vuescroll.common.js @@ -1,5 +1,5 @@ /* - * @name: vuescroll 4.4.9 + * @name: vuescroll 4.5.0 * @author: (c) 2018-2018 wangyi7099 * @description: A reactive virtual scrollbar based on vue.js 2.X * @license: MIT @@ -110,7 +110,6 @@ function getGutter() { /* istanbul ignore next */ if (Vue.prototype.$isServer) return 0; if (scrollBarWidth !== undefined) return scrollBarWidth; - var outer = document.createElement("div"); outer.style.visibility = "hidden"; outer.style.width = "100px"; @@ -120,7 +119,6 @@ function getGutter() { var widthNoScroll = outer.offsetWidth; outer.style.overflow = "scroll"; - var inner = document.createElement("div"); inner.style.width = "100%"; outer.appendChild(inner); @@ -128,9 +126,7 @@ function getGutter() { var widthWithScroll = inner.offsetWidth; outer.parentNode.removeChild(outer); scrollBarWidth = widthNoScroll - widthWithScroll; - getGutter.isUsed = false; - return scrollBarWidth; } @@ -3480,7 +3476,7 @@ var scroll = { // feat: #8 Vue$$1.prototype.$vuescrollConfig = deepMerge(GCF, {}); scroll.isInstalled = true; - scroll.version = "4.4.9"; + scroll.version = "4.5.0"; } }; /* istanbul ignore if */ diff --git a/dist/vuescroll.common.min.js b/dist/vuescroll.common.min.js index ae7eeb1e..e183117f 100644 --- a/dist/vuescroll.common.min.js +++ b/dist/vuescroll.common.min.js @@ -1,8 +1,8 @@ /* - * @name: vuescroll 4.4.9 + * @name: vuescroll 4.5.0 * @author: (c) 2018-2018 wangyi7099 * @description: A reactive virtual scrollbar based on vue.js 2.X * @license: MIT * @GitHub: https://github.com/wangyi7099/vuescroll */ -"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var Vue=_interopDefault(require("vue")),map={vertical:{bar:{size:"height",opsSize:"width",posName:"top",page:"pageY",scroll:"scrollTop",scrollSize:"scrollHeight",offset:"offsetHeight",client:"clientY"},axis:"Y"},horizontal:{bar:{size:"width",opsSize:"height",posName:"left",page:"pageX",scroll:"scrollLeft",scrollSize:"scrollWidth",offset:"offsetWidth",client:"clientX"},axis:"X"}},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function deepCopy(e,t){for(var i in t="object"===(void 0===t?"undefined":_typeof(t))&&t||{},e)t[i]="object"===_typeof(e[i])?deepCopy(e[i],t[i]={}):e[i];return t}function deepMerge(e,t){for(var i in t=t||{},e)"object"===_typeof(e[i])?void 0===t[i]?(t[i]={},deepCopy(e[i],t[i])):deepMerge(e[i],t[i]):void 0===t[i]&&(t[i]=e[i]);return t}function defineReactive(e,t,i,o){var s=null;(i[t]||"function"==typeof i)&&(o=o||t,"function"==typeof i&&(s=i),Object.defineProperty(e,t,{get:s||function(){return i[o]},configurable:!0}))}var scrollBarWidth=void 0;function getGutter(){if(Vue.prototype.$isServer)return 0;if(void 0!==scrollBarWidth)return scrollBarWidth;var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var i=document.createElement("div");i.style.width="100%",e.appendChild(i);var o=i.offsetWidth;return e.parentNode.removeChild(e),scrollBarWidth=t-o,getGutter.isUsed=!1,scrollBarWidth}var haveHideen=!1,haveCreatedRefreshDomClass=!1,haveCreatedLoadDomClass=!1;function hideSystemBar(){if(!haveHideen){haveHideen=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML=".vuescroll-panel::-webkit-scrollbar{width:0;height:0}",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createRefreshDomStyle(){if(!haveCreatedRefreshDomClass){haveCreatedRefreshDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-refresh {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-refresh svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-refresh svg path,\n .vuescroll-refresh svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createLoadDomStyle(){if(!haveCreatedLoadDomClass){haveCreatedLoadDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-load {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-load svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-load svg path,\n .vuescroll-load svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function renderTransform(e,t){return{transform:"translate"+map[e].axis+"("+t+"%)",msTransform:"translate"+map[e].axis+"("+t+"%)",webkitTransform:"translate"+map[e].axis+"("+t+"%)"}}function on(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.addEventListener(t,i,o)}function off(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,i,o)}function easingPattern(e,t){var i=null;return"easeInQuad"===e&&(i=t*t),"easeOutQuad"===e&&(i=t*(2-t)),"easeInOutQuad"===e&&(i=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e&&(i=t*t*t),"easeOutCubic"===e&&(i=--t*t*t+1),"easeInOutCubic"===e&&(i=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e&&(i=t*t*t*t),"easeOutQuart"===e&&(i=1- --t*t*t*t),"easeInOutQuart"===e&&(i=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e&&(i=t*t*t*t*t),"easeOutQuint"===e&&(i=1+--t*t*t*t*t),"easeInOutQuint"===e&&(i=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),i||t}function goScrolling(e,t,i,o,s){var l=null,r=null,a=null,n=e.scrollTop,c=e.scrollLeft;n+i<0&&(i=-n),n+i>e.scrollHeight&&(i=e.scrollHeight-n),c+t<0&&(t=-c),c+t>e.scrollWidth&&(t=e.scrollWidth-c);requestAnimationFrame(function h(d){l||(l=d);var _=d-l,u=_/o>1?1:_/o;r=c+t*easingPattern(s,u),a=n+i*easingPattern(s,u),(Math.abs(a-n)<=Math.abs(i)||Math.abs(r-c)<=Math.abs(t))&&(e.scrollTop=Math.floor(a),e.scrollLeft=Math.floor(r),u<1&&requestAnimationFrame(h))})}function listenResize(e,t){var i=document.createElement("object");return i.style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",i.tabIndex=-1,i.type="text/html",i.onload=function(){t.forEach(function(e){on(i.contentDocument.defaultView,"resize",e)})},e.appendChild(i),function(){i.contentDocument&&t.forEach(function(e){off(i.contentDocument.defaultView,"resize",e)}),e.removeChild(i)}}function findValuesByMode(e,t){var i={};switch(e){case"native":case"pure-native":i={x:t.scrollPanelElm.scrollLeft,y:t.scrollPanelElm.scrollTop};break;case"slide":i={x:t.scroller.__scrollLeft,y:t.scroller.__scrollTop}}return i}var modes=["slide","native","pure-native"],GCF={vuescroll:{mode:"native",pullRefresh:{enable:!1,tips:{deactive:"Pull to Refresh",active:"Release to Refresh",start:"Refreshing...",beforeDeactive:"Refresh Successfully!"}},pushLoad:{enable:!1,tips:{deactive:"Push to Load",active:"Release to Load",start:"Loading...",beforeDeactive:"Load Successfully!"}},paging:!1,snapping:{enable:!1,width:100,height:100}},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!0,scrollingY:!0,speed:300,easing:void 0},scrollContent:{tag:"div",padding:!0,props:{},attrs:{}},rail:{vRail:{width:"5px",pos:"right",background:"#a5d6a7",opacity:0},hRail:{height:"5px",pos:"bottom",background:"#a5d6a7",opacity:0}},bar:{vBar:{background:"#4caf50",deltaY:100,keepShow:!1,opacity:1,hover:!1},hBar:{background:"#4caf50",keepShow:!1,opacity:1,hover:!1}}};function validateOptions(e){var t=!1,i=e.vuescroll,o=e.scrollPanel;~modes.indexOf(i.mode)||(console.error('[vuescroll][ops]: The vuescroll\'s option "mode" should be one of the '+modes),t=!0),i.paging==i.snapping.enable&&i.paging&&(i.pullRefresh||i.pushLoad)&&console.error("[vuescroll][ops]: paging, snapping, (pullRefresh with pushLoad) can only one of them to be true.");var s=o.initialScrollY,l=o.initialScrollX;return s&&!String(s).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollY` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),l&&!String(l).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollX` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),t}function hackPropsData(){var e=this;if("vueScroll"===e.$options.name){var t=deepMerge(e.$vuescrollConfig,{}),i=deepMerge(GCF,t);e.$options.propsData.ops=e.$options.propsData.ops||{},Object.keys(e.$options.propsData.ops).forEach(function(t){defineReactive(e.mergedOptions,t,e.$options.propsData.ops)}),deepMerge(i,e.mergedOptions),defineReactive(e.mergedOptions.bar.vBar,"pos",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.vBar,"width",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.hBar,"pos",e.mergedOptions.rail.hRail),defineReactive(e.mergedOptions.bar.hBar,"height",e.mergedOptions.rail.hRail);defineReactive(e.mergedOptions.scrollContent,"paddPos",function(){return"padding-"+e.mergedOptions.rail.vRail.pos}),defineReactive(e.mergedOptions.scrollContent,"paddValue",function(){return e.mergedOptions.rail.vRail.width})}}var hackLifecycle={data:function(){return{shouldStopRender:!1}},created:function(){hackPropsData.call(this),this.shouldStopRender=validateOptions(this.mergedOptions)}};function getNumericValue(e,t){var i=void 0;return i=(i=/(-?\d+(?:\.\d+?)?)%$/.exec(e))?t*(i=i[1]-0)/100:e-0}var api={methods:{scrollTo:function(e){var t=e.x,i=e.y,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=void 0===t?this.vuescroll.state.internalScrollLeft:getNumericValue(t,this.scrollPanelElm.scrollWidth),i=void 0===i?this.vuescroll.state.internalScrollTop:getNumericValue(i,this.scrollPanelElm.scrollHeight),this.internalScrollTo(t,i,o,s)},scrollBy:function(e){var t=e.dx,i=e.dy,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=this.vuescroll.state,l=s.internalScrollLeft,r=s.internalScrollTop;t&&(l+=getNumericValue(t,this.scrollPanelElm.scrollWidth)),i&&(r+=getNumericValue(i,this.scrollPanelElm.scrollHeight)),this.internalScrollTo(l,r,o)},internalScrollTo:function(e,t,i,o){"native"==this.mode||"pure-native"==this.mode?i?goScrolling(this.$refs.scrollPanel.$el,e-this.$refs.scrollPanel.$el.scrollLeft,t-this.$refs.scrollPanel.$el.scrollTop,this.mergedOptions.scrollPanel.speed,this.mergedOptions.scrollPanel.easing):(this.$refs.scrollPanel.$el.scrollTop=t,this.$refs.scrollPanel.$el.scrollLeft=e):"slide"==this.mode&&this.scroller.scrollTo(e,t,i,void 0,o)},forceUpdate:function(){var e=this;this.$forceUpdate(),Object.keys(this.$refs).forEach(function(t){var i=e.$refs[t];i._isVue&&i.$forceUpdate()})}}},nativeMode={methods:{updateNativeModeBarState:function(){var e=this.scrollPanelElm,t=this.$el,i=100*t.clientHeight/e.scrollHeight,o=100*t.clientWidth/e.scrollWidth;this.bar.vBar.state.posValue=100*e.scrollTop/t.clientHeight,this.bar.hBar.state.posValue=100*e.scrollLeft/t.clientWidth,this.bar.vBar.state.size=i<100?i+"%":0,this.bar.hBar.state.size=o<100?o+"%":0}}},time=Date.now||function(){return+new Date},desiredFrames=60,millisecondsPerSecond=1e3,running={},counter=1,core={effect:{}},global=window;core.effect.Animate={requestAnimationFrame:function(){var e=global.requestAnimationFrame||global.webkitRequestAnimationFrame||global.mozRequestAnimationFrame||global.oRequestAnimationFrame,t=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(t=!1),t)return function(t,i){e(t,i)};var i={},o=1,s=null,l=+new Date;return function(e){var t=o++;return i[t]=e,requestCount++,null===s&&(s=setInterval(function(){var e=+new Date,t=i;for(var o in i={},requestCount=0,t)t.hasOwnProperty(o)&&(t[o](e),l=e);e-l>2500&&(clearInterval(s),s=null)},1e3/60)),t}}(),stop:function(e){var t=null!=running[e];return t&&(running[e]=null),t},isRunning:function(e){return null!=running[e]},start:function(e,t,i,o,s,l){var r=time(),a=r,n=0,c=0,h=counter++;if(l||(l=document.body),h%20==0){var d={};for(var _ in running)d[_]=!0;running=d}return running[h]=!0,core.effect.Animate.requestAnimationFrame(function d(_){var u=!0!==_,p=time();if(!running[h]||t&&!t(h))return running[h]=null,void(i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,!1));if(u)for(var f=Math.round((p-a)/(millisecondsPerSecond/desiredFrames))-1,m=0;m1&&(n=1);var v=s?s(n):n;!1!==e(v,p,u)&&1!==n||!u?u&&(a=p,core.effect.Animate.requestAnimationFrame(d,l)):(running[h]=null,i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,1===n||null==o))},l),h}};var NOOP=function(){};function createEasingFunction(e){return function(t){return easingPattern(e,t)}}var animatingMethod=null,noAnimatingMethod=null;function Scroller(e,t){for(var i in this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:NOOP,animatingEasing:"easeOutCubic",noAnimatingEasing:"easeInOutCubic",penetrationDeceleration:.03,penetrationAcceleration:.08},t)this.options[i]=t[i];animatingMethod=createEasingFunction(this.options.animatingEasing),noAnimatingMethod=createEasingFunction(this.options.noAnimatingEasing)}var members={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__loadHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshBeforeDeactivate:null,__refreshDeactivate:null,__refreshStart:null,__loadActive:null,__loadActivate:null,__loadBeforeDeactivate:null,__loadDeactivate:null,__loadStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__disable:!1,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(e,t,i,o){e===+e&&(this.__clientWidth=e),t===+t&&(this.__clientHeight=t),i===+i&&(this.__contentWidth=i),o===+o&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(e,t){this.__clientLeft=e||0,this.__clientTop=t||0},setSnapSize:function(e,t){this.__snapWidth=e,this.__snapHeight=t},activatePullToRefresh:function(e,t,i,o,s){this.__refreshHeight=e,this.__refreshActivate=t,this.__refreshBeforeDeactivate=s,this.__refreshDeactivate=i,this.__refreshStart=o},activatePushToLoad:function(e,t,i,o,s){this.__loadHeight=e,this.__loadActivate=t,this.__loadBeforeDeactivate=s,this.__loadDeactivate=i,this.__loadStart=o},triggerRefreshOrLoad:function(){"refresh"==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"refresh")?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart())},finishRefreshOrLoad:function(){var e=this;e.__refreshBeforeDeactivate&&e.__refreshActive?(e.__refreshActive=!1,e.__refreshBeforeDeactivate(function(){e.__refreshDeactivate&&e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__refreshDeactivate&&e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)),e.__loadBeforeDeactivate&&e.__loadActive?(e.__loadActive=!1,e.__loadBeforeDeactivate(function(){e.__loadDeactivate&&e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__loadDeactivate&&e.__loadActive&&(e.__loadActive=!1,e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0))},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(e,t,i,o,s){if(!this.options.zooming)throw new Error("Zooming is not enabled!");s&&(this.__zoomComplete=s),this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var l=this.__zoomLevel;null==i&&(i=this.__clientWidth/2),null==o&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);var r=(i+this.__scrollLeft)*e/l-i,a=(o+this.__scrollTop)*e/l-o;r>this.__maxScrollLeft?r=this.__maxScrollLeft:r<0&&(r=0),a>this.__maxScrollTop?a=this.__maxScrollTop:a<0&&(a=0),this.__publish(r,a,e,t)},zoomBy:function(e,t,i,o,s){this.zoomTo(this.__zoomLevel*e,t,i,o,s)},scrollTo:function(e,t,i,o,s){if(this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1),null!=o&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX||s?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY||s?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(i=!1),this.__isTracking||this.__publish(e,t,o,i)},scrollBy:function(e,t,i){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,s=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),s+(t||0),i)},doMouseZoom:function(e,t,i,o){var s=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*s,!1,i-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(e,t){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var i,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(core.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var s=1===e.length;s?(i=e[0].pageX,o=e[0].pageY):(i=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=i,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=i,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!s&&this.options.scrollingX,this.__enableScrollY=!s&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!s,this.__isSingleTouch=s,this.__positions=[]},doTouchMove:function(e,t,i){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){var o,s;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,s=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,s=e[0].pageY);var l=this.__positions;if(this.__isDragging){var r=o-this.__lastTouchLeft,a=s-this.__lastTouchTop,n=this.__scrollLeft,c=this.__scrollTop,h=this.__zoomLevel;if(null!=i&&this.options.zooming){var d=h;if(h=h/this.__lastScale*i,d!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var _=o-this.__clientLeft,u=s-this.__clientTop;n=(_+n)*h/d-_,c=(u+c)*h/d-u,this.__computeScrollMax(h)}}if(this.__enableScrollX){n-=r*this.options.speedMultiplier;var p=this.__maxScrollLeft;(n>p||n<0)&&(this.options.bouncing?n+=r/2*this.options.speedMultiplier:n=n>p?p:0)}if(this.__enableScrollY){c-=a*this.options.speedMultiplier;var f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?(c+=a/2*this.options.speedMultiplier,this.__enableScrollX||null==this.__refreshHeight&&null==this.__loadHeight||(!this.__refreshActive&&c<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&c>-this.__refreshHeight?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):!this.__loadActive&&c>=this.__maxScrollTop+this.__loadHeight?(this.__loadActive=!0,this.__loadActivate&&this.__loadActivate()):this.__refreshActive&&cf?f:0)}l.length>60&&l.splice(0,30),l.push(n,c,t),this.__publish(n,c,h)}else{var m=this.options.locking?3:0,v=Math.abs(o-this.__initialTouchLeft),g=Math.abs(s-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&v>=m,this.__enableScrollY=this.options.scrollingY&&g>=m,l.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(v>=5||g>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=s,this.__lastTouchMove=t,this.__lastScale=i}},doTouchEnd:function(e){if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){for(var t=this.__positions,i=t.length-1,o=i,s=i;s>0&&t[s]>this.__lastTouchMove-100;s-=3)o=s;if(o!==i){var l=t[i]-t[o],r=this.__scrollLeft-t[o-2],a=this.__scrollTop-t[o-1];this.__decelerationVelocityX=r/l*(1e3/60),this.__decelerationVelocityY=a/l*(1e3/60);var n=this.options.paging||this.options.snapping?4:1;Math.abs(this.__decelerationVelocityX)>n||Math.abs(this.__decelerationVelocityY)>n?this.__refreshActive||this.__loadActive||this.__startDeceleration(e):this.options.scrollingComplete()}else this.options.scrollingComplete()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||(this.__refreshActive&&this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):this.__loadActive&&this.__loadStart?(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart()):((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):this.__loadActive&&(this.__loadActive=!1,this.__loadDeactivate&&this.__loadDeactivate()))),this.__positions.length=0}},onScroll:NOOP,stop:function(){this.__disable=!0},start:function(){self.__disable=!0},__publish:function(e,t,i,o){var s=this;if(!s.__disable){var l=s.__isAnimating;if(l&&(core.effect.Animate.stop(l),s.__isAnimating=!1),o&&s.options.animating){s.__scheduledLeft=e,s.__scheduledTop=t,s.__scheduledZoom=i;var r=s.__scrollLeft,a=s.__scrollTop,n=s.__zoomLevel,c=e-r,h=t-a,d=i-n;s.__isAnimating=core.effect.Animate.start(function(e,t,i){i&&(s.__scrollLeft=r+c*e,s.__scrollTop=a+h*e,s.__zoomLevel=n+d*e,s.__callback&&(s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel),s.onScroll()))},function(e){return s.__isAnimating===e},function(e,t,i){t===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||i)&&s.options.scrollingComplete(),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))},s.options.animationDuration,l?animatingMethod:noAnimatingMethod)}else s.__scheduledLeft=s.__scrollLeft=e,s.__scheduledTop=s.__scrollTop=t,s.__scheduledZoom=s.__zoomLevel=i,s.__callback&&(s.__callback(e,t,i),s.onScroll()),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))}},__computeScrollMax:function(e){null==e&&(e=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)},__startDeceleration:function(){var e=this;if(e.options.paging){var t=Math.max(Math.min(e.__scrollLeft,e.__maxScrollLeft),0),i=Math.max(Math.min(e.__scrollTop,e.__maxScrollTop),0),o=e.__clientWidth,s=e.__clientHeight;e.__minDecelerationScrollLeft=Math.floor(t/o)*o,e.__minDecelerationScrollTop=Math.floor(i/s)*s,e.__maxDecelerationScrollLeft=Math.ceil(t/o)*o,e.__maxDecelerationScrollTop=Math.ceil(i/s)*s}else e.__minDecelerationScrollLeft=0,e.__minDecelerationScrollTop=0,e.__maxDecelerationScrollLeft=e.__maxScrollLeft,e.__maxDecelerationScrollTop=e.__maxScrollTop;var l=e.options.snapping?4:.001;e.__isDecelerating=core.effect.Animate.start(function(t,i,o){e.__stepThroughDeceleration(o)},function(){var t=Math.abs(e.__decelerationVelocityX)>=l||Math.abs(e.__decelerationVelocityY)>=l;return t||(e.__didDecelerationComplete=!0),t},function(){e.__isDecelerating=!1,e.__didDecelerationComplete&&e.options.scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,e.options.snapping)})},__stepThroughDeceleration:function(e){var t=this.__scrollLeft+this.__decelerationVelocityX,i=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);var s=Math.max(Math.min(this.__maxDecelerationScrollTop,i),this.__minDecelerationScrollTop);s!==i&&(i=s,this.__decelerationVelocityY=0)}if(e?this.__publish(t,i,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=i),!this.options.paging){this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95}if(this.options.bouncing){var l=0,r=0,a=this.options.penetrationDeceleration,n=this.options.penetrationAcceleration;tthis.__maxDecelerationScrollLeft&&(l=this.__maxDecelerationScrollLeft-t),ithis.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-i),0!==l&&(l*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=l*a:this.__decelerationVelocityX=l*n),0!==r&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*a:this.__decelerationVelocityY=r*n)}}};for(var key in members)Scroller.prototype[key]=members[key];function render(e,t){var i,o=document.documentElement.style;t.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?i="presto":"MozAppearance"in o?i="gecko":"WebkitAppearance"in o?i="webkit":"string"==typeof navigator.cpuClass&&(i="trident");var s={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[i],l=document.createElement("div"),r=s+"Perspective",a=s+"Transform";return void 0!==l.style[r]?function(t,i,o){e.style[a]="translate3d("+-t+"px,"+-i+"px,0) scale("+o+")"}:void 0!==l.style[a]?function(t,i,o){e.style[a]="translate("+-t+"px,"+-i+"px) scale("+o+")"}:function(t,i,o){e.style.marginLeft=t?-t/o+"px":"",e.style.marginTop=i?-i/o+"px":"",e.style.zoom=o||""}}function listenContainer(e,t,i,o){var s=null;function l(e){e.touches[0]&&e.touches[0].target&&e.touches[0].target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart(e.touches,e.timeStamp),e.preventDefault())}function r(e){i("mousemove"),t.doTouchMove(e.touches,e.timeStamp,e.scale)}function a(e){i("mouseup"),t.doTouchEnd(e.timeStamp)}function n(e){t.doTouchEnd(e.timeStamp)}function c(e){e.target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function h(e){u&&(i("mousemove"),t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function d(e){u&&(i("mouseup"),t.doTouchEnd(e.timeStamp),u=!1)}function _(e){t.doMouseZoom(e.detail?-120*e.detail:e.wheelDelta,e.timeStamp,e.pageX,e.pageY)}if("ontouchstart"in window)e.addEventListener("touchstart",l,!1),document.addEventListener("touchmove",r,!1),document.addEventListener("touchend",a,!1),document.addEventListener("touchcancel",n,!1),s=function(){e.removeEventListener("touchstart",l,!1),document.removeEventListener("touchmove",r,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",n,!1)};else{var u=!1;e.addEventListener("mousedown",c,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",d,!1),o&&e.addEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1),s=function(){e.removeEventListener("mousedown",c,!1),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",d,!1),e.removeEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1)}}return t.onScroll=function(){i("onscroll")},s}var refreshActivateCallback=function(){this.vuescroll.state.refreshStage="active"},refreshStartCallback=function(){var e=this;e.vuescroll.state.refreshStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},refreshBeforeDeactivateCallback=function(e){this.vuescroll.state.refreshStage="beforeDeactive",setTimeout(function(){e()},500)},refreshDeactivateCallback=function(){this.vuescroll.state.refreshStage="deactive"},loadActivateCallback=function(){this.vuescroll.state.loadStage="active"},loadStartCallback=function(){var e=this;e.vuescroll.state.loadStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},loadBeforeDeactivateCallback=function(e){this.vuescroll.state.loadStage="beforeDeactive",setTimeout(function(){e()},500)},loadDeactivateCallback=function(){this.vuescroll.state.loadStage="deactive"},slideMode={methods:{updateScroller:function(){var e=this.$el.clientWidth,t=this.$el.clientHeight,i=this.scrollPanelElm.scrollWidth,o=this.scrollPanelElm.scrollHeight,s=0;if(this.mergedOptions.vuescroll.pullRefresh.enable){var l=this.$refs.refreshDom.elm||this.$refs.refreshDom;s=l.scrollHeight,l.style.marginTop||(l.style.marginTop=-s+"px",o-=s)}this.mergedOptions.vuescroll.pushLoad.enable&&(o-=(this.$refs.loadDom.elm||this.$refs.loadDom).scrollHeight);this.scroller.setDimensions(e,t,i,o)},registryScroller:function(){var e=this,t=this.mergedOptions.vuescroll.paging,i=this.mergedOptions.vuescroll.snapping.enable,o=!this.refreshLoad&&!t&&!i,s=this.mergedOptions.scrollPanel,l=s.scrollingY,r=s.scrollingX;this.scroller=new Scroller(render(this.scrollPanelElm,window),{zooming:o,scrollingY:l,scrollingX:r&&!this.refreshLoad,animationDuration:this.mergedOptions.scrollPanel.speed,paging:t,snapping:i}),i&&this.scroller.setSnapSize(this.mergedOptions.vuescroll.snapping.width,this.mergedOptions.vuescroll.snapping.height);var a=this.$el.getBoundingClientRect();this.scroller.setPosition(a.left+this.$el.clientLeft,a.top+this.$el.clientTop);var n=listenContainer(this.$el,this.scroller,function(t){switch(t){case"mousedown":e.vuescroll.state.isDragging=!0;break;case"onscroll":e.handleScroll(!1);break;case"mouseup":e.vuescroll.state.isDragging=!1}},o);if(this.mergedOptions.vuescroll.pullRefresh.enable){var c=this.$refs.refreshDom.elm||this.$refs.refreshDom;this.$listeners["refresh-activate"]&&(refreshActivateCallback=function(){e.vuescroll.state.refreshStage="active",e.$emit("refresh-activate",e,c)}),this.$listeners["refresh-before-deactivate"]&&(refreshBeforeDeactivateCallback=function(t){e.vuescroll.state.refreshStage="beforeDeactive",e.$emit("refresh-before-deactivate",e,c,t.bind(e.scroller))}),this.$listeners["refresh-deactivate"]&&(refreshDeactivateCallback=function(){e.vuescroll.state.refreshStage="deactive",e.$emit("refresh-deactivate",e,c)}),this.$listeners["refresh-start"]&&(refreshStartCallback=function(){e.vuescroll.state.refreshStage="start",e.$emit("refresh-start",e,c,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var h=c.scrollHeight;this.scroller.activatePullToRefresh(h,refreshActivateCallback.bind(this),refreshDeactivateCallback.bind(this),refreshStartCallback.bind(this),refreshBeforeDeactivateCallback.bind(this))}if(this.mergedOptions.vuescroll.pushLoad.enable){var d=this.$refs.loadDom.elm||this.$refs.loadDom;this.$listeners["load-activate"]&&(loadActivateCallback=function(){e.vuescroll.state.loadStage="active",e.$emit("load-activate",e,d)}),this.$listeners["load-before-deactivate"]&&(loadBeforeDeactivateCallback=function(t){e.vuescroll.state.loadStage="beforeDeactive",e.$emit("load-before-deactivate",e,d,t.bind(e.scroller))}),this.$listeners["load-deactivate"]&&(loadDeactivateCallback=function(){e.vuescroll.state.loadStage="deactive",e.$emit("load-deactivate",e,d)}),this.$listeners["load-start"]&&(loadStartCallback=function(){e.vuescroll.state.loadStage="start",e.$emit("load-start",e,d,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var _=d.scrollHeight;this.scroller.activatePushToLoad(_,loadActivateCallback.bind(this),loadDeactivateCallback.bind(this),loadStartCallback.bind(this),loadBeforeDeactivateCallback.bind(this))}return this.updateScroller(),n},updateSlideModeBarState:function(){var e,t,i=this.$el,o=this.scroller,s=0,l=0,r=i.clientWidth,a=i.clientHeight,n=r+this.scroller.__maxScrollLeft,c=a+this.scroller.__maxScrollTop,h=ro.__maxScrollLeft&&(s=o.__scrollLeft-o.__maxScrollLeft)),d&&(o.__scrollTop<0?l=-o.__scrollTop:o.__scrollTop>o.__maxScrollTop&&(l=o.__scrollTop-o.__maxScrollTop)),e=100*a/(c+l),t=100*r/(n+s);var _=Math.min(Math.max(0,o.__scrollTop),o.__maxScrollTop),u=Math.min(Math.max(0,o.__scrollLeft),o.__maxScrollLeft);this.bar.vBar.state.posValue=100*(_+l)/i.clientHeight,this.bar.hBar.state.posValue=100*(u+s)/i.clientWidth,o.__scrollLeft<0&&(this.bar.hBar.state.posValue=0),o.__scrollTop<0&&(this.bar.vBar.state.posValue=0),this.bar.vBar.state.size=e<100?e+"%":0,this.bar.hBar.state.size=t<100?t+"%":0}}},_extends=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;"native"==this.mode||"pure-native"==this.mode?this.updateNativeModeBarState():"slide"==this.mode&&this.updateSlideModeBarState(),e&&this.emitEvent(e,t)},updateMode:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{var t=this.vuescroll.state.internalScrollLeft,i=this.vuescroll.state.internalScrollTop;this.destroyScroller&&(this.scroller.stop(),this.destroyScroller(),this.destroyScroller=null),"slide"==this.mode?this.destroyScroller=this.registryScroller():"native"!=this.mode&&"pure-native"!=this.mode||(this.scrollPanelElm.style.transform="",this.scrollPanelElm.style.transformOrigin=""),this.scrollTo({x:t,y:i},!1,!0)}},handleScroll:function(e){this.recordCurrentPos(),this.update("handle-scroll",e),this.showAndDefferedHideBar()},setBarClick:function(e){this.isClickingBar=e},showAndDefferedHideBar:function(){var e=this;this.showBar(),this.vuescroll.state.timeoutId&&clearTimeout(this.vuescroll.state.timeoutId),this.vuescroll.state.timeoutId=setTimeout(function(){e.vuescroll.state.timeoutId=0,e.hideBar()},500)},emitEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.scrollPanelElm,o={type:"vertical"},s={type:"horizontal"},l=i.scrollTop,r=i.scrollLeft;"slide"==this.mode&&(l=this.scroller.__scrollTop,r=this.scroller.__scrollLeft),o.process=l/(i.scrollHeight-i.clientHeight),s.process=r/(i.scrollWidth-i.clientWidth),o.barSize=this.bar.vBar.state.size,s.barSize=this.bar.hBar.state.size,this.$emit(e,o,s,t)},showBar:function(){this.bar.vBar.state.opacity=this.mergedOptions.bar.vBar.opacity,this.bar.hBar.state.opacity=this.mergedOptions.bar.hBar.opacity},hideBar:function(){this.vuescroll.state.isDragging||(this.mergedOptions.bar.vBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.vBar.state.opacity=0),this.mergedOptions.bar.hBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.hBar.state.opacity=0))},registryResize:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{this.destroyResize&&this.destroyResize();var t=null;"slide"==this.mode||"pure-native"==this.mode?t=this.scrollPanelElm:"native"==this.mode&&(t=this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent),window.addEventListener("resize",function(){e.update(),e.showAndDefferedHideBar(),"slide"==e.mode&&e.updateScroller()},!1);var i=[function(){var t={};"slide"==e.mode?(e.updateScroller(),t.width=e.scroller.__contentWidth,t.height=e.scroller.__contentHeight):"native"==e.mode&&(t.width=e.scrollPanelElm.scrollWidth,t.height=e.scrollPanelElm.scrollHeight),e.update("handle-resize",t),e.showAndDefferedHideBar()}];this.destroyResize=listenResize(t,i)}},recordCurrentPos:function(){this.mode!==this.lastMode?(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.lastMode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.lastMode,this).y,this.lastMode=this.mode):(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.mode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.mode,this).y)},watchChanges:function(){var e=this;this.$watch("mergedOptions",function(){e.recordCurrentPos(),e.$nextTick(function(){e.registryResize(),e.updateMode()})},{deep:!0,sync:!0})},watchSmallChanges:function(){var e=this;uncessaryChangeArray.forEach(function(t){e.$watch(t,function(){e.shouldStop=!0},{sync:!0,deep:!0})})}},mounted:function(){var e=this;this._isDestroyed||this.shouldStopRender||("slide"==this.mode&&(this.destroyScroller=this.registryScroller()),this.lastMode=this.mode,this.registryResize(),this.watchChanges(),this.watchSmallChanges(),this.$nextTick(function(){e.update(),e.showAndDefferedHideBar()}))},updated:function(){var e=this;this.$nextTick(function(){e._isDestroyed||e.showAndDefferedHideBar()})}},scroll={install:function(e){scroll.isInstalled?console.warn("You should not install the vuescroll again!"):(e.component(vuescroll.name,vuescroll),e.prototype.$vuescrollConfig=deepMerge(GCF,{}),scroll.isInstalled=!0,scroll.version="4.4.9")}};module.exports=scroll; \ No newline at end of file +"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var Vue=_interopDefault(require("vue")),map={vertical:{bar:{size:"height",opsSize:"width",posName:"top",page:"pageY",scroll:"scrollTop",scrollSize:"scrollHeight",offset:"offsetHeight",client:"clientY"},axis:"Y"},horizontal:{bar:{size:"width",opsSize:"height",posName:"left",page:"pageX",scroll:"scrollLeft",scrollSize:"scrollWidth",offset:"offsetWidth",client:"clientX"},axis:"X"}},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function deepCopy(e,t){for(var i in t="object"===(void 0===t?"undefined":_typeof(t))&&t||{},e)t[i]="object"===_typeof(e[i])?deepCopy(e[i],t[i]={}):e[i];return t}function deepMerge(e,t){for(var i in t=t||{},e)"object"===_typeof(e[i])?void 0===t[i]?(t[i]={},deepCopy(e[i],t[i])):deepMerge(e[i],t[i]):void 0===t[i]&&(t[i]=e[i]);return t}function defineReactive(e,t,i,o){var s=null;(i[t]||"function"==typeof i)&&(o=o||t,"function"==typeof i&&(s=i),Object.defineProperty(e,t,{get:s||function(){return i[o]},configurable:!0}))}var scrollBarWidth=void 0;function getGutter(){if(Vue.prototype.$isServer)return 0;if(void 0!==scrollBarWidth)return scrollBarWidth;var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var i=document.createElement("div");i.style.width="100%",e.appendChild(i);var o=i.offsetWidth;return e.parentNode.removeChild(e),scrollBarWidth=t-o,getGutter.isUsed=!1,scrollBarWidth}var haveHideen=!1,haveCreatedRefreshDomClass=!1,haveCreatedLoadDomClass=!1;function hideSystemBar(){if(!haveHideen){haveHideen=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML=".vuescroll-panel::-webkit-scrollbar{width:0;height:0}",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createRefreshDomStyle(){if(!haveCreatedRefreshDomClass){haveCreatedRefreshDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-refresh {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-refresh svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-refresh svg path,\n .vuescroll-refresh svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createLoadDomStyle(){if(!haveCreatedLoadDomClass){haveCreatedLoadDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-load {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-load svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-load svg path,\n .vuescroll-load svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function renderTransform(e,t){return{transform:"translate"+map[e].axis+"("+t+"%)",msTransform:"translate"+map[e].axis+"("+t+"%)",webkitTransform:"translate"+map[e].axis+"("+t+"%)"}}function on(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.addEventListener(t,i,o)}function off(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,i,o)}function easingPattern(e,t){var i=null;return"easeInQuad"===e&&(i=t*t),"easeOutQuad"===e&&(i=t*(2-t)),"easeInOutQuad"===e&&(i=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e&&(i=t*t*t),"easeOutCubic"===e&&(i=--t*t*t+1),"easeInOutCubic"===e&&(i=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e&&(i=t*t*t*t),"easeOutQuart"===e&&(i=1- --t*t*t*t),"easeInOutQuart"===e&&(i=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e&&(i=t*t*t*t*t),"easeOutQuint"===e&&(i=1+--t*t*t*t*t),"easeInOutQuint"===e&&(i=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),i||t}function goScrolling(e,t,i,o,s){var l=null,r=null,a=null,n=e.scrollTop,c=e.scrollLeft;n+i<0&&(i=-n),n+i>e.scrollHeight&&(i=e.scrollHeight-n),c+t<0&&(t=-c),c+t>e.scrollWidth&&(t=e.scrollWidth-c);requestAnimationFrame(function h(d){l||(l=d);var _=d-l,u=_/o>1?1:_/o;r=c+t*easingPattern(s,u),a=n+i*easingPattern(s,u),(Math.abs(a-n)<=Math.abs(i)||Math.abs(r-c)<=Math.abs(t))&&(e.scrollTop=Math.floor(a),e.scrollLeft=Math.floor(r),u<1&&requestAnimationFrame(h))})}function listenResize(e,t){var i=document.createElement("object");return i.style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",i.tabIndex=-1,i.type="text/html",i.onload=function(){t.forEach(function(e){on(i.contentDocument.defaultView,"resize",e)})},e.appendChild(i),function(){i.contentDocument&&t.forEach(function(e){off(i.contentDocument.defaultView,"resize",e)}),e.removeChild(i)}}function findValuesByMode(e,t){var i={};switch(e){case"native":case"pure-native":i={x:t.scrollPanelElm.scrollLeft,y:t.scrollPanelElm.scrollTop};break;case"slide":i={x:t.scroller.__scrollLeft,y:t.scroller.__scrollTop}}return i}var modes=["slide","native","pure-native"],GCF={vuescroll:{mode:"native",pullRefresh:{enable:!1,tips:{deactive:"Pull to Refresh",active:"Release to Refresh",start:"Refreshing...",beforeDeactive:"Refresh Successfully!"}},pushLoad:{enable:!1,tips:{deactive:"Push to Load",active:"Release to Load",start:"Loading...",beforeDeactive:"Load Successfully!"}},paging:!1,snapping:{enable:!1,width:100,height:100}},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!0,scrollingY:!0,speed:300,easing:void 0},scrollContent:{tag:"div",padding:!0,props:{},attrs:{}},rail:{vRail:{width:"5px",pos:"right",background:"#a5d6a7",opacity:0},hRail:{height:"5px",pos:"bottom",background:"#a5d6a7",opacity:0}},bar:{vBar:{background:"#4caf50",deltaY:100,keepShow:!1,opacity:1,hover:!1},hBar:{background:"#4caf50",keepShow:!1,opacity:1,hover:!1}}};function validateOptions(e){var t=!1,i=e.vuescroll,o=e.scrollPanel;~modes.indexOf(i.mode)||(console.error('[vuescroll][ops]: The vuescroll\'s option "mode" should be one of the '+modes),t=!0),i.paging==i.snapping.enable&&i.paging&&(i.pullRefresh||i.pushLoad)&&console.error("[vuescroll][ops]: paging, snapping, (pullRefresh with pushLoad) can only one of them to be true.");var s=o.initialScrollY,l=o.initialScrollX;return s&&!String(s).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollY` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),l&&!String(l).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollX` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),t}function hackPropsData(){var e=this;if("vueScroll"===e.$options.name){var t=deepMerge(e.$vuescrollConfig,{}),i=deepMerge(GCF,t);e.$options.propsData.ops=e.$options.propsData.ops||{},Object.keys(e.$options.propsData.ops).forEach(function(t){defineReactive(e.mergedOptions,t,e.$options.propsData.ops)}),deepMerge(i,e.mergedOptions),defineReactive(e.mergedOptions.bar.vBar,"pos",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.vBar,"width",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.hBar,"pos",e.mergedOptions.rail.hRail),defineReactive(e.mergedOptions.bar.hBar,"height",e.mergedOptions.rail.hRail);defineReactive(e.mergedOptions.scrollContent,"paddPos",function(){return"padding-"+e.mergedOptions.rail.vRail.pos}),defineReactive(e.mergedOptions.scrollContent,"paddValue",function(){return e.mergedOptions.rail.vRail.width})}}var hackLifecycle={data:function(){return{shouldStopRender:!1}},created:function(){hackPropsData.call(this),this.shouldStopRender=validateOptions(this.mergedOptions)}};function getNumericValue(e,t){var i=void 0;return i=(i=/(-?\d+(?:\.\d+?)?)%$/.exec(e))?t*(i=i[1]-0)/100:e-0}var api={methods:{scrollTo:function(e){var t=e.x,i=e.y,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=void 0===t?this.vuescroll.state.internalScrollLeft:getNumericValue(t,this.scrollPanelElm.scrollWidth),i=void 0===i?this.vuescroll.state.internalScrollTop:getNumericValue(i,this.scrollPanelElm.scrollHeight),this.internalScrollTo(t,i,o,s)},scrollBy:function(e){var t=e.dx,i=e.dy,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=this.vuescroll.state,l=s.internalScrollLeft,r=s.internalScrollTop;t&&(l+=getNumericValue(t,this.scrollPanelElm.scrollWidth)),i&&(r+=getNumericValue(i,this.scrollPanelElm.scrollHeight)),this.internalScrollTo(l,r,o)},internalScrollTo:function(e,t,i,o){"native"==this.mode||"pure-native"==this.mode?i?goScrolling(this.$refs.scrollPanel.$el,e-this.$refs.scrollPanel.$el.scrollLeft,t-this.$refs.scrollPanel.$el.scrollTop,this.mergedOptions.scrollPanel.speed,this.mergedOptions.scrollPanel.easing):(this.$refs.scrollPanel.$el.scrollTop=t,this.$refs.scrollPanel.$el.scrollLeft=e):"slide"==this.mode&&this.scroller.scrollTo(e,t,i,void 0,o)},forceUpdate:function(){var e=this;this.$forceUpdate(),Object.keys(this.$refs).forEach(function(t){var i=e.$refs[t];i._isVue&&i.$forceUpdate()})}}},nativeMode={methods:{updateNativeModeBarState:function(){var e=this.scrollPanelElm,t=this.$el,i=100*t.clientHeight/e.scrollHeight,o=100*t.clientWidth/e.scrollWidth;this.bar.vBar.state.posValue=100*e.scrollTop/t.clientHeight,this.bar.hBar.state.posValue=100*e.scrollLeft/t.clientWidth,this.bar.vBar.state.size=i<100?i+"%":0,this.bar.hBar.state.size=o<100?o+"%":0}}},time=Date.now||function(){return+new Date},desiredFrames=60,millisecondsPerSecond=1e3,running={},counter=1,core={effect:{}},global=window;core.effect.Animate={requestAnimationFrame:function(){var e=global.requestAnimationFrame||global.webkitRequestAnimationFrame||global.mozRequestAnimationFrame||global.oRequestAnimationFrame,t=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(t=!1),t)return function(t,i){e(t,i)};var i={},o=1,s=null,l=+new Date;return function(e){var t=o++;return i[t]=e,requestCount++,null===s&&(s=setInterval(function(){var e=+new Date,t=i;for(var o in i={},requestCount=0,t)t.hasOwnProperty(o)&&(t[o](e),l=e);e-l>2500&&(clearInterval(s),s=null)},1e3/60)),t}}(),stop:function(e){var t=null!=running[e];return t&&(running[e]=null),t},isRunning:function(e){return null!=running[e]},start:function(e,t,i,o,s,l){var r=time(),a=r,n=0,c=0,h=counter++;if(l||(l=document.body),h%20==0){var d={};for(var _ in running)d[_]=!0;running=d}return running[h]=!0,core.effect.Animate.requestAnimationFrame(function d(_){var u=!0!==_,p=time();if(!running[h]||t&&!t(h))return running[h]=null,void(i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,!1));if(u)for(var f=Math.round((p-a)/(millisecondsPerSecond/desiredFrames))-1,m=0;m1&&(n=1);var v=s?s(n):n;!1!==e(v,p,u)&&1!==n||!u?u&&(a=p,core.effect.Animate.requestAnimationFrame(d,l)):(running[h]=null,i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,1===n||null==o))},l),h}};var NOOP=function(){};function createEasingFunction(e){return function(t){return easingPattern(e,t)}}var animatingMethod=null,noAnimatingMethod=null;function Scroller(e,t){for(var i in this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:NOOP,animatingEasing:"easeOutCubic",noAnimatingEasing:"easeInOutCubic",penetrationDeceleration:.03,penetrationAcceleration:.08},t)this.options[i]=t[i];animatingMethod=createEasingFunction(this.options.animatingEasing),noAnimatingMethod=createEasingFunction(this.options.noAnimatingEasing)}var members={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__loadHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshBeforeDeactivate:null,__refreshDeactivate:null,__refreshStart:null,__loadActive:null,__loadActivate:null,__loadBeforeDeactivate:null,__loadDeactivate:null,__loadStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__disable:!1,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(e,t,i,o){e===+e&&(this.__clientWidth=e),t===+t&&(this.__clientHeight=t),i===+i&&(this.__contentWidth=i),o===+o&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(e,t){this.__clientLeft=e||0,this.__clientTop=t||0},setSnapSize:function(e,t){this.__snapWidth=e,this.__snapHeight=t},activatePullToRefresh:function(e,t,i,o,s){this.__refreshHeight=e,this.__refreshActivate=t,this.__refreshBeforeDeactivate=s,this.__refreshDeactivate=i,this.__refreshStart=o},activatePushToLoad:function(e,t,i,o,s){this.__loadHeight=e,this.__loadActivate=t,this.__loadBeforeDeactivate=s,this.__loadDeactivate=i,this.__loadStart=o},triggerRefreshOrLoad:function(){"refresh"==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"refresh")?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart())},finishRefreshOrLoad:function(){var e=this;e.__refreshBeforeDeactivate&&e.__refreshActive?(e.__refreshActive=!1,e.__refreshBeforeDeactivate(function(){e.__refreshDeactivate&&e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__refreshDeactivate&&e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)),e.__loadBeforeDeactivate&&e.__loadActive?(e.__loadActive=!1,e.__loadBeforeDeactivate(function(){e.__loadDeactivate&&e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__loadDeactivate&&e.__loadActive&&(e.__loadActive=!1,e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0))},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(e,t,i,o,s){if(!this.options.zooming)throw new Error("Zooming is not enabled!");s&&(this.__zoomComplete=s),this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var l=this.__zoomLevel;null==i&&(i=this.__clientWidth/2),null==o&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);var r=(i+this.__scrollLeft)*e/l-i,a=(o+this.__scrollTop)*e/l-o;r>this.__maxScrollLeft?r=this.__maxScrollLeft:r<0&&(r=0),a>this.__maxScrollTop?a=this.__maxScrollTop:a<0&&(a=0),this.__publish(r,a,e,t)},zoomBy:function(e,t,i,o,s){this.zoomTo(this.__zoomLevel*e,t,i,o,s)},scrollTo:function(e,t,i,o,s){if(this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1),null!=o&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX||s?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY||s?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(i=!1),this.__isTracking||this.__publish(e,t,o,i)},scrollBy:function(e,t,i){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,s=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),s+(t||0),i)},doMouseZoom:function(e,t,i,o){var s=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*s,!1,i-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(e,t){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var i,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(core.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var s=1===e.length;s?(i=e[0].pageX,o=e[0].pageY):(i=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=i,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=i,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!s&&this.options.scrollingX,this.__enableScrollY=!s&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!s,this.__isSingleTouch=s,this.__positions=[]},doTouchMove:function(e,t,i){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){var o,s;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,s=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,s=e[0].pageY);var l=this.__positions;if(this.__isDragging){var r=o-this.__lastTouchLeft,a=s-this.__lastTouchTop,n=this.__scrollLeft,c=this.__scrollTop,h=this.__zoomLevel;if(null!=i&&this.options.zooming){var d=h;if(h=h/this.__lastScale*i,d!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var _=o-this.__clientLeft,u=s-this.__clientTop;n=(_+n)*h/d-_,c=(u+c)*h/d-u,this.__computeScrollMax(h)}}if(this.__enableScrollX){n-=r*this.options.speedMultiplier;var p=this.__maxScrollLeft;(n>p||n<0)&&(this.options.bouncing?n+=r/2*this.options.speedMultiplier:n=n>p?p:0)}if(this.__enableScrollY){c-=a*this.options.speedMultiplier;var f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?(c+=a/2*this.options.speedMultiplier,this.__enableScrollX||null==this.__refreshHeight&&null==this.__loadHeight||(!this.__refreshActive&&c<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&c>-this.__refreshHeight?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):!this.__loadActive&&c>=this.__maxScrollTop+this.__loadHeight?(this.__loadActive=!0,this.__loadActivate&&this.__loadActivate()):this.__refreshActive&&cf?f:0)}l.length>60&&l.splice(0,30),l.push(n,c,t),this.__publish(n,c,h)}else{var m=this.options.locking?3:0,v=Math.abs(o-this.__initialTouchLeft),g=Math.abs(s-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&v>=m,this.__enableScrollY=this.options.scrollingY&&g>=m,l.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(v>=5||g>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=s,this.__lastTouchMove=t,this.__lastScale=i}},doTouchEnd:function(e){if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){for(var t=this.__positions,i=t.length-1,o=i,s=i;s>0&&t[s]>this.__lastTouchMove-100;s-=3)o=s;if(o!==i){var l=t[i]-t[o],r=this.__scrollLeft-t[o-2],a=this.__scrollTop-t[o-1];this.__decelerationVelocityX=r/l*(1e3/60),this.__decelerationVelocityY=a/l*(1e3/60);var n=this.options.paging||this.options.snapping?4:1;Math.abs(this.__decelerationVelocityX)>n||Math.abs(this.__decelerationVelocityY)>n?this.__refreshActive||this.__loadActive||this.__startDeceleration(e):this.options.scrollingComplete()}else this.options.scrollingComplete()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||(this.__refreshActive&&this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):this.__loadActive&&this.__loadStart?(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart()):((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):this.__loadActive&&(this.__loadActive=!1,this.__loadDeactivate&&this.__loadDeactivate()))),this.__positions.length=0}},onScroll:NOOP,stop:function(){this.__disable=!0},start:function(){self.__disable=!0},__publish:function(e,t,i,o){var s=this;if(!s.__disable){var l=s.__isAnimating;if(l&&(core.effect.Animate.stop(l),s.__isAnimating=!1),o&&s.options.animating){s.__scheduledLeft=e,s.__scheduledTop=t,s.__scheduledZoom=i;var r=s.__scrollLeft,a=s.__scrollTop,n=s.__zoomLevel,c=e-r,h=t-a,d=i-n;s.__isAnimating=core.effect.Animate.start(function(e,t,i){i&&(s.__scrollLeft=r+c*e,s.__scrollTop=a+h*e,s.__zoomLevel=n+d*e,s.__callback&&(s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel),s.onScroll()))},function(e){return s.__isAnimating===e},function(e,t,i){t===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||i)&&s.options.scrollingComplete(),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))},s.options.animationDuration,l?animatingMethod:noAnimatingMethod)}else s.__scheduledLeft=s.__scrollLeft=e,s.__scheduledTop=s.__scrollTop=t,s.__scheduledZoom=s.__zoomLevel=i,s.__callback&&(s.__callback(e,t,i),s.onScroll()),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))}},__computeScrollMax:function(e){null==e&&(e=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)},__startDeceleration:function(){var e=this;if(e.options.paging){var t=Math.max(Math.min(e.__scrollLeft,e.__maxScrollLeft),0),i=Math.max(Math.min(e.__scrollTop,e.__maxScrollTop),0),o=e.__clientWidth,s=e.__clientHeight;e.__minDecelerationScrollLeft=Math.floor(t/o)*o,e.__minDecelerationScrollTop=Math.floor(i/s)*s,e.__maxDecelerationScrollLeft=Math.ceil(t/o)*o,e.__maxDecelerationScrollTop=Math.ceil(i/s)*s}else e.__minDecelerationScrollLeft=0,e.__minDecelerationScrollTop=0,e.__maxDecelerationScrollLeft=e.__maxScrollLeft,e.__maxDecelerationScrollTop=e.__maxScrollTop;var l=e.options.snapping?4:.001;e.__isDecelerating=core.effect.Animate.start(function(t,i,o){e.__stepThroughDeceleration(o)},function(){var t=Math.abs(e.__decelerationVelocityX)>=l||Math.abs(e.__decelerationVelocityY)>=l;return t||(e.__didDecelerationComplete=!0),t},function(){e.__isDecelerating=!1,e.__didDecelerationComplete&&e.options.scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,e.options.snapping)})},__stepThroughDeceleration:function(e){var t=this.__scrollLeft+this.__decelerationVelocityX,i=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);var s=Math.max(Math.min(this.__maxDecelerationScrollTop,i),this.__minDecelerationScrollTop);s!==i&&(i=s,this.__decelerationVelocityY=0)}if(e?this.__publish(t,i,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=i),!this.options.paging){this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95}if(this.options.bouncing){var l=0,r=0,a=this.options.penetrationDeceleration,n=this.options.penetrationAcceleration;tthis.__maxDecelerationScrollLeft&&(l=this.__maxDecelerationScrollLeft-t),ithis.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-i),0!==l&&(l*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=l*a:this.__decelerationVelocityX=l*n),0!==r&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*a:this.__decelerationVelocityY=r*n)}}};for(var key in members)Scroller.prototype[key]=members[key];function render(e,t){var i,o=document.documentElement.style;t.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?i="presto":"MozAppearance"in o?i="gecko":"WebkitAppearance"in o?i="webkit":"string"==typeof navigator.cpuClass&&(i="trident");var s={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[i],l=document.createElement("div"),r=s+"Perspective",a=s+"Transform";return void 0!==l.style[r]?function(t,i,o){e.style[a]="translate3d("+-t+"px,"+-i+"px,0) scale("+o+")"}:void 0!==l.style[a]?function(t,i,o){e.style[a]="translate("+-t+"px,"+-i+"px) scale("+o+")"}:function(t,i,o){e.style.marginLeft=t?-t/o+"px":"",e.style.marginTop=i?-i/o+"px":"",e.style.zoom=o||""}}function listenContainer(e,t,i,o){var s=null;function l(e){e.touches[0]&&e.touches[0].target&&e.touches[0].target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart(e.touches,e.timeStamp),e.preventDefault())}function r(e){i("mousemove"),t.doTouchMove(e.touches,e.timeStamp,e.scale)}function a(e){i("mouseup"),t.doTouchEnd(e.timeStamp)}function n(e){t.doTouchEnd(e.timeStamp)}function c(e){e.target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function h(e){u&&(i("mousemove"),t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function d(e){u&&(i("mouseup"),t.doTouchEnd(e.timeStamp),u=!1)}function _(e){t.doMouseZoom(e.detail?-120*e.detail:e.wheelDelta,e.timeStamp,e.pageX,e.pageY)}if("ontouchstart"in window)e.addEventListener("touchstart",l,!1),document.addEventListener("touchmove",r,!1),document.addEventListener("touchend",a,!1),document.addEventListener("touchcancel",n,!1),s=function(){e.removeEventListener("touchstart",l,!1),document.removeEventListener("touchmove",r,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",n,!1)};else{var u=!1;e.addEventListener("mousedown",c,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",d,!1),o&&e.addEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1),s=function(){e.removeEventListener("mousedown",c,!1),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",d,!1),e.removeEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1)}}return t.onScroll=function(){i("onscroll")},s}var refreshActivateCallback=function(){this.vuescroll.state.refreshStage="active"},refreshStartCallback=function(){var e=this;e.vuescroll.state.refreshStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},refreshBeforeDeactivateCallback=function(e){this.vuescroll.state.refreshStage="beforeDeactive",setTimeout(function(){e()},500)},refreshDeactivateCallback=function(){this.vuescroll.state.refreshStage="deactive"},loadActivateCallback=function(){this.vuescroll.state.loadStage="active"},loadStartCallback=function(){var e=this;e.vuescroll.state.loadStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},loadBeforeDeactivateCallback=function(e){this.vuescroll.state.loadStage="beforeDeactive",setTimeout(function(){e()},500)},loadDeactivateCallback=function(){this.vuescroll.state.loadStage="deactive"},slideMode={methods:{updateScroller:function(){var e=this.$el.clientWidth,t=this.$el.clientHeight,i=this.scrollPanelElm.scrollWidth,o=this.scrollPanelElm.scrollHeight,s=0;if(this.mergedOptions.vuescroll.pullRefresh.enable){var l=this.$refs.refreshDom.elm||this.$refs.refreshDom;s=l.scrollHeight,l.style.marginTop||(l.style.marginTop=-s+"px",o-=s)}this.mergedOptions.vuescroll.pushLoad.enable&&(o-=(this.$refs.loadDom.elm||this.$refs.loadDom).scrollHeight);this.scroller.setDimensions(e,t,i,o)},registryScroller:function(){var e=this,t=this.mergedOptions.vuescroll.paging,i=this.mergedOptions.vuescroll.snapping.enable,o=!this.refreshLoad&&!t&&!i,s=this.mergedOptions.scrollPanel,l=s.scrollingY,r=s.scrollingX;this.scroller=new Scroller(render(this.scrollPanelElm,window),{zooming:o,scrollingY:l,scrollingX:r&&!this.refreshLoad,animationDuration:this.mergedOptions.scrollPanel.speed,paging:t,snapping:i}),i&&this.scroller.setSnapSize(this.mergedOptions.vuescroll.snapping.width,this.mergedOptions.vuescroll.snapping.height);var a=this.$el.getBoundingClientRect();this.scroller.setPosition(a.left+this.$el.clientLeft,a.top+this.$el.clientTop);var n=listenContainer(this.$el,this.scroller,function(t){switch(t){case"mousedown":e.vuescroll.state.isDragging=!0;break;case"onscroll":e.handleScroll(!1);break;case"mouseup":e.vuescroll.state.isDragging=!1}},o);if(this.mergedOptions.vuescroll.pullRefresh.enable){var c=this.$refs.refreshDom.elm||this.$refs.refreshDom;this.$listeners["refresh-activate"]&&(refreshActivateCallback=function(){e.vuescroll.state.refreshStage="active",e.$emit("refresh-activate",e,c)}),this.$listeners["refresh-before-deactivate"]&&(refreshBeforeDeactivateCallback=function(t){e.vuescroll.state.refreshStage="beforeDeactive",e.$emit("refresh-before-deactivate",e,c,t.bind(e.scroller))}),this.$listeners["refresh-deactivate"]&&(refreshDeactivateCallback=function(){e.vuescroll.state.refreshStage="deactive",e.$emit("refresh-deactivate",e,c)}),this.$listeners["refresh-start"]&&(refreshStartCallback=function(){e.vuescroll.state.refreshStage="start",e.$emit("refresh-start",e,c,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var h=c.scrollHeight;this.scroller.activatePullToRefresh(h,refreshActivateCallback.bind(this),refreshDeactivateCallback.bind(this),refreshStartCallback.bind(this),refreshBeforeDeactivateCallback.bind(this))}if(this.mergedOptions.vuescroll.pushLoad.enable){var d=this.$refs.loadDom.elm||this.$refs.loadDom;this.$listeners["load-activate"]&&(loadActivateCallback=function(){e.vuescroll.state.loadStage="active",e.$emit("load-activate",e,d)}),this.$listeners["load-before-deactivate"]&&(loadBeforeDeactivateCallback=function(t){e.vuescroll.state.loadStage="beforeDeactive",e.$emit("load-before-deactivate",e,d,t.bind(e.scroller))}),this.$listeners["load-deactivate"]&&(loadDeactivateCallback=function(){e.vuescroll.state.loadStage="deactive",e.$emit("load-deactivate",e,d)}),this.$listeners["load-start"]&&(loadStartCallback=function(){e.vuescroll.state.loadStage="start",e.$emit("load-start",e,d,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var _=d.scrollHeight;this.scroller.activatePushToLoad(_,loadActivateCallback.bind(this),loadDeactivateCallback.bind(this),loadStartCallback.bind(this),loadBeforeDeactivateCallback.bind(this))}return this.updateScroller(),n},updateSlideModeBarState:function(){var e,t,i=this.$el,o=this.scroller,s=0,l=0,r=i.clientWidth,a=i.clientHeight,n=r+this.scroller.__maxScrollLeft,c=a+this.scroller.__maxScrollTop,h=ro.__maxScrollLeft&&(s=o.__scrollLeft-o.__maxScrollLeft)),d&&(o.__scrollTop<0?l=-o.__scrollTop:o.__scrollTop>o.__maxScrollTop&&(l=o.__scrollTop-o.__maxScrollTop)),e=100*a/(c+l),t=100*r/(n+s);var _=Math.min(Math.max(0,o.__scrollTop),o.__maxScrollTop),u=Math.min(Math.max(0,o.__scrollLeft),o.__maxScrollLeft);this.bar.vBar.state.posValue=100*(_+l)/i.clientHeight,this.bar.hBar.state.posValue=100*(u+s)/i.clientWidth,o.__scrollLeft<0&&(this.bar.hBar.state.posValue=0),o.__scrollTop<0&&(this.bar.vBar.state.posValue=0),this.bar.vBar.state.size=e<100?e+"%":0,this.bar.hBar.state.size=t<100?t+"%":0}}},_extends=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;"native"==this.mode||"pure-native"==this.mode?this.updateNativeModeBarState():"slide"==this.mode&&this.updateSlideModeBarState(),e&&this.emitEvent(e,t)},updateMode:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{var t=this.vuescroll.state.internalScrollLeft,i=this.vuescroll.state.internalScrollTop;this.destroyScroller&&(this.scroller.stop(),this.destroyScroller(),this.destroyScroller=null),"slide"==this.mode?this.destroyScroller=this.registryScroller():"native"!=this.mode&&"pure-native"!=this.mode||(this.scrollPanelElm.style.transform="",this.scrollPanelElm.style.transformOrigin=""),this.scrollTo({x:t,y:i},!1,!0)}},handleScroll:function(e){this.recordCurrentPos(),this.update("handle-scroll",e),this.showAndDefferedHideBar()},setBarClick:function(e){this.isClickingBar=e},showAndDefferedHideBar:function(){var e=this;this.showBar(),this.vuescroll.state.timeoutId&&clearTimeout(this.vuescroll.state.timeoutId),this.vuescroll.state.timeoutId=setTimeout(function(){e.vuescroll.state.timeoutId=0,e.hideBar()},500)},emitEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.scrollPanelElm,o={type:"vertical"},s={type:"horizontal"},l=i.scrollTop,r=i.scrollLeft;"slide"==this.mode&&(l=this.scroller.__scrollTop,r=this.scroller.__scrollLeft),o.process=l/(i.scrollHeight-i.clientHeight),s.process=r/(i.scrollWidth-i.clientWidth),o.barSize=this.bar.vBar.state.size,s.barSize=this.bar.hBar.state.size,this.$emit(e,o,s,t)},showBar:function(){this.bar.vBar.state.opacity=this.mergedOptions.bar.vBar.opacity,this.bar.hBar.state.opacity=this.mergedOptions.bar.hBar.opacity},hideBar:function(){this.vuescroll.state.isDragging||(this.mergedOptions.bar.vBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.vBar.state.opacity=0),this.mergedOptions.bar.hBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.hBar.state.opacity=0))},registryResize:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{this.destroyResize&&this.destroyResize();var t=null;"slide"==this.mode||"pure-native"==this.mode?t=this.scrollPanelElm:"native"==this.mode&&(t=this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent),window.addEventListener("resize",function(){e.update(),e.showAndDefferedHideBar(),"slide"==e.mode&&e.updateScroller()},!1);var i=[function(){var t={};"slide"==e.mode?(e.updateScroller(),t.width=e.scroller.__contentWidth,t.height=e.scroller.__contentHeight):"native"==e.mode&&(t.width=e.scrollPanelElm.scrollWidth,t.height=e.scrollPanelElm.scrollHeight),e.update("handle-resize",t),e.showAndDefferedHideBar()}];this.destroyResize=listenResize(t,i)}},recordCurrentPos:function(){this.mode!==this.lastMode?(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.lastMode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.lastMode,this).y,this.lastMode=this.mode):(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.mode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.mode,this).y)},watchChanges:function(){var e=this;this.$watch("mergedOptions",function(){e.recordCurrentPos(),e.$nextTick(function(){e.registryResize(),e.updateMode()})},{deep:!0,sync:!0})},watchSmallChanges:function(){var e=this;uncessaryChangeArray.forEach(function(t){e.$watch(t,function(){e.shouldStop=!0},{sync:!0,deep:!0})})}},mounted:function(){var e=this;this._isDestroyed||this.shouldStopRender||("slide"==this.mode&&(this.destroyScroller=this.registryScroller()),this.lastMode=this.mode,this.registryResize(),this.watchChanges(),this.watchSmallChanges(),this.$nextTick(function(){e.update(),e.showAndDefferedHideBar()}))},updated:function(){var e=this;this.$nextTick(function(){e._isDestroyed||e.showAndDefferedHideBar()})}},scroll={install:function(e){scroll.isInstalled?console.warn("You should not install the vuescroll again!"):(e.component(vuescroll.name,vuescroll),e.prototype.$vuescrollConfig=deepMerge(GCF,{}),scroll.isInstalled=!0,scroll.version="4.5.0")}};module.exports=scroll; \ No newline at end of file diff --git a/dist/vuescroll.esm.js b/dist/vuescroll.esm.js index 64ba41aa..007e6a35 100644 --- a/dist/vuescroll.esm.js +++ b/dist/vuescroll.esm.js @@ -1,5 +1,5 @@ /* - * @name: vuescroll 4.4.9 + * @name: vuescroll 4.5.0 * @author: (c) 2018-2018 wangyi7099 * @description: A reactive virtual scrollbar based on vue.js 2.X * @license: MIT @@ -106,7 +106,6 @@ function getGutter() { /* istanbul ignore next */ if (Vue.prototype.$isServer) return 0; if (scrollBarWidth !== undefined) return scrollBarWidth; - var outer = document.createElement("div"); outer.style.visibility = "hidden"; outer.style.width = "100px"; @@ -116,7 +115,6 @@ function getGutter() { var widthNoScroll = outer.offsetWidth; outer.style.overflow = "scroll"; - var inner = document.createElement("div"); inner.style.width = "100%"; outer.appendChild(inner); @@ -124,9 +122,7 @@ function getGutter() { var widthWithScroll = inner.offsetWidth; outer.parentNode.removeChild(outer); scrollBarWidth = widthNoScroll - widthWithScroll; - getGutter.isUsed = false; - return scrollBarWidth; } @@ -3476,7 +3472,7 @@ var scroll = { // feat: #8 Vue$$1.prototype.$vuescrollConfig = deepMerge(GCF, {}); scroll.isInstalled = true; - scroll.version = "4.4.9"; + scroll.version = "4.5.0"; } }; /* istanbul ignore if */ diff --git a/dist/vuescroll.esm.min.js b/dist/vuescroll.esm.min.js index 91c57982..e391d44d 100644 --- a/dist/vuescroll.esm.min.js +++ b/dist/vuescroll.esm.min.js @@ -1,8 +1,8 @@ /* - * @name: vuescroll 4.4.9 + * @name: vuescroll 4.5.0 * @author: (c) 2018-2018 wangyi7099 * @description: A reactive virtual scrollbar based on vue.js 2.X * @license: MIT * @GitHub: https://github.com/wangyi7099/vuescroll */ -import Vue from"vue";var map={vertical:{bar:{size:"height",opsSize:"width",posName:"top",page:"pageY",scroll:"scrollTop",scrollSize:"scrollHeight",offset:"offsetHeight",client:"clientY"},axis:"Y"},horizontal:{bar:{size:"width",opsSize:"height",posName:"left",page:"pageX",scroll:"scrollLeft",scrollSize:"scrollWidth",offset:"offsetWidth",client:"clientX"},axis:"X"}},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function deepCopy(e,t){for(var i in t="object"===(void 0===t?"undefined":_typeof(t))&&t||{},e)t[i]="object"===_typeof(e[i])?deepCopy(e[i],t[i]={}):e[i];return t}function deepMerge(e,t){for(var i in t=t||{},e)"object"===_typeof(e[i])?void 0===t[i]?(t[i]={},deepCopy(e[i],t[i])):deepMerge(e[i],t[i]):void 0===t[i]&&(t[i]=e[i]);return t}function defineReactive(e,t,i,o){var s=null;(i[t]||"function"==typeof i)&&(o=o||t,"function"==typeof i&&(s=i),Object.defineProperty(e,t,{get:s||function(){return i[o]},configurable:!0}))}var scrollBarWidth=void 0;function getGutter(){if(Vue.prototype.$isServer)return 0;if(void 0!==scrollBarWidth)return scrollBarWidth;var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var i=document.createElement("div");i.style.width="100%",e.appendChild(i);var o=i.offsetWidth;return e.parentNode.removeChild(e),scrollBarWidth=t-o,getGutter.isUsed=!1,scrollBarWidth}var haveHideen=!1,haveCreatedRefreshDomClass=!1,haveCreatedLoadDomClass=!1;function hideSystemBar(){if(!haveHideen){haveHideen=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML=".vuescroll-panel::-webkit-scrollbar{width:0;height:0}",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createRefreshDomStyle(){if(!haveCreatedRefreshDomClass){haveCreatedRefreshDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-refresh {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-refresh svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-refresh svg path,\n .vuescroll-refresh svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createLoadDomStyle(){if(!haveCreatedLoadDomClass){haveCreatedLoadDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-load {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-load svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-load svg path,\n .vuescroll-load svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function renderTransform(e,t){return{transform:"translate"+map[e].axis+"("+t+"%)",msTransform:"translate"+map[e].axis+"("+t+"%)",webkitTransform:"translate"+map[e].axis+"("+t+"%)"}}function on(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.addEventListener(t,i,o)}function off(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,i,o)}function easingPattern(e,t){var i=null;return"easeInQuad"===e&&(i=t*t),"easeOutQuad"===e&&(i=t*(2-t)),"easeInOutQuad"===e&&(i=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e&&(i=t*t*t),"easeOutCubic"===e&&(i=--t*t*t+1),"easeInOutCubic"===e&&(i=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e&&(i=t*t*t*t),"easeOutQuart"===e&&(i=1- --t*t*t*t),"easeInOutQuart"===e&&(i=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e&&(i=t*t*t*t*t),"easeOutQuint"===e&&(i=1+--t*t*t*t*t),"easeInOutQuint"===e&&(i=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),i||t}function goScrolling(e,t,i,o,s){var l=null,r=null,a=null,n=e.scrollTop,c=e.scrollLeft;n+i<0&&(i=-n),n+i>e.scrollHeight&&(i=e.scrollHeight-n),c+t<0&&(t=-c),c+t>e.scrollWidth&&(t=e.scrollWidth-c);requestAnimationFrame(function h(d){l||(l=d);var _=d-l,u=_/o>1?1:_/o;r=c+t*easingPattern(s,u),a=n+i*easingPattern(s,u),(Math.abs(a-n)<=Math.abs(i)||Math.abs(r-c)<=Math.abs(t))&&(e.scrollTop=Math.floor(a),e.scrollLeft=Math.floor(r),u<1&&requestAnimationFrame(h))})}function listenResize(e,t){var i=document.createElement("object");return i.style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",i.tabIndex=-1,i.type="text/html",i.onload=function(){t.forEach(function(e){on(i.contentDocument.defaultView,"resize",e)})},e.appendChild(i),function(){i.contentDocument&&t.forEach(function(e){off(i.contentDocument.defaultView,"resize",e)}),e.removeChild(i)}}function findValuesByMode(e,t){var i={};switch(e){case"native":case"pure-native":i={x:t.scrollPanelElm.scrollLeft,y:t.scrollPanelElm.scrollTop};break;case"slide":i={x:t.scroller.__scrollLeft,y:t.scroller.__scrollTop}}return i}var modes=["slide","native","pure-native"],GCF={vuescroll:{mode:"native",pullRefresh:{enable:!1,tips:{deactive:"Pull to Refresh",active:"Release to Refresh",start:"Refreshing...",beforeDeactive:"Refresh Successfully!"}},pushLoad:{enable:!1,tips:{deactive:"Push to Load",active:"Release to Load",start:"Loading...",beforeDeactive:"Load Successfully!"}},paging:!1,snapping:{enable:!1,width:100,height:100}},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!0,scrollingY:!0,speed:300,easing:void 0},scrollContent:{tag:"div",padding:!0,props:{},attrs:{}},rail:{vRail:{width:"5px",pos:"right",background:"#a5d6a7",opacity:0},hRail:{height:"5px",pos:"bottom",background:"#a5d6a7",opacity:0}},bar:{vBar:{background:"#4caf50",deltaY:100,keepShow:!1,opacity:1,hover:!1},hBar:{background:"#4caf50",keepShow:!1,opacity:1,hover:!1}}};function validateOptions(e){var t=!1,i=e.vuescroll,o=e.scrollPanel;~modes.indexOf(i.mode)||(console.error('[vuescroll][ops]: The vuescroll\'s option "mode" should be one of the '+modes),t=!0),i.paging==i.snapping.enable&&i.paging&&(i.pullRefresh||i.pushLoad)&&console.error("[vuescroll][ops]: paging, snapping, (pullRefresh with pushLoad) can only one of them to be true.");var s=o.initialScrollY,l=o.initialScrollX;return s&&!String(s).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollY` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),l&&!String(l).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollX` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),t}function hackPropsData(){var e=this;if("vueScroll"===e.$options.name){var t=deepMerge(e.$vuescrollConfig,{}),i=deepMerge(GCF,t);e.$options.propsData.ops=e.$options.propsData.ops||{},Object.keys(e.$options.propsData.ops).forEach(function(t){defineReactive(e.mergedOptions,t,e.$options.propsData.ops)}),deepMerge(i,e.mergedOptions),defineReactive(e.mergedOptions.bar.vBar,"pos",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.vBar,"width",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.hBar,"pos",e.mergedOptions.rail.hRail),defineReactive(e.mergedOptions.bar.hBar,"height",e.mergedOptions.rail.hRail);defineReactive(e.mergedOptions.scrollContent,"paddPos",function(){return"padding-"+e.mergedOptions.rail.vRail.pos}),defineReactive(e.mergedOptions.scrollContent,"paddValue",function(){return e.mergedOptions.rail.vRail.width})}}var hackLifecycle={data:function(){return{shouldStopRender:!1}},created:function(){hackPropsData.call(this),this.shouldStopRender=validateOptions(this.mergedOptions)}};function getNumericValue(e,t){var i=void 0;return i=(i=/(-?\d+(?:\.\d+?)?)%$/.exec(e))?t*(i=i[1]-0)/100:e-0}var api={methods:{scrollTo:function(e){var t=e.x,i=e.y,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=void 0===t?this.vuescroll.state.internalScrollLeft:getNumericValue(t,this.scrollPanelElm.scrollWidth),i=void 0===i?this.vuescroll.state.internalScrollTop:getNumericValue(i,this.scrollPanelElm.scrollHeight),this.internalScrollTo(t,i,o,s)},scrollBy:function(e){var t=e.dx,i=e.dy,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=this.vuescroll.state,l=s.internalScrollLeft,r=s.internalScrollTop;t&&(l+=getNumericValue(t,this.scrollPanelElm.scrollWidth)),i&&(r+=getNumericValue(i,this.scrollPanelElm.scrollHeight)),this.internalScrollTo(l,r,o)},internalScrollTo:function(e,t,i,o){"native"==this.mode||"pure-native"==this.mode?i?goScrolling(this.$refs.scrollPanel.$el,e-this.$refs.scrollPanel.$el.scrollLeft,t-this.$refs.scrollPanel.$el.scrollTop,this.mergedOptions.scrollPanel.speed,this.mergedOptions.scrollPanel.easing):(this.$refs.scrollPanel.$el.scrollTop=t,this.$refs.scrollPanel.$el.scrollLeft=e):"slide"==this.mode&&this.scroller.scrollTo(e,t,i,void 0,o)},forceUpdate:function(){var e=this;this.$forceUpdate(),Object.keys(this.$refs).forEach(function(t){var i=e.$refs[t];i._isVue&&i.$forceUpdate()})}}},nativeMode={methods:{updateNativeModeBarState:function(){var e=this.scrollPanelElm,t=this.$el,i=100*t.clientHeight/e.scrollHeight,o=100*t.clientWidth/e.scrollWidth;this.bar.vBar.state.posValue=100*e.scrollTop/t.clientHeight,this.bar.hBar.state.posValue=100*e.scrollLeft/t.clientWidth,this.bar.vBar.state.size=i<100?i+"%":0,this.bar.hBar.state.size=o<100?o+"%":0}}},time=Date.now||function(){return+new Date},desiredFrames=60,millisecondsPerSecond=1e3,running={},counter=1,core={effect:{}},global=window;core.effect.Animate={requestAnimationFrame:function(){var e=global.requestAnimationFrame||global.webkitRequestAnimationFrame||global.mozRequestAnimationFrame||global.oRequestAnimationFrame,t=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(t=!1),t)return function(t,i){e(t,i)};var i={},o=1,s=null,l=+new Date;return function(e){var t=o++;return i[t]=e,requestCount++,null===s&&(s=setInterval(function(){var e=+new Date,t=i;for(var o in i={},requestCount=0,t)t.hasOwnProperty(o)&&(t[o](e),l=e);e-l>2500&&(clearInterval(s),s=null)},1e3/60)),t}}(),stop:function(e){var t=null!=running[e];return t&&(running[e]=null),t},isRunning:function(e){return null!=running[e]},start:function(e,t,i,o,s,l){var r=time(),a=r,n=0,c=0,h=counter++;if(l||(l=document.body),h%20==0){var d={};for(var _ in running)d[_]=!0;running=d}return running[h]=!0,core.effect.Animate.requestAnimationFrame(function d(_){var u=!0!==_,p=time();if(!running[h]||t&&!t(h))return running[h]=null,void(i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,!1));if(u)for(var f=Math.round((p-a)/(millisecondsPerSecond/desiredFrames))-1,m=0;m1&&(n=1);var v=s?s(n):n;!1!==e(v,p,u)&&1!==n||!u?u&&(a=p,core.effect.Animate.requestAnimationFrame(d,l)):(running[h]=null,i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,1===n||null==o))},l),h}};var NOOP=function(){};function createEasingFunction(e){return function(t){return easingPattern(e,t)}}var animatingMethod=null,noAnimatingMethod=null;function Scroller(e,t){for(var i in this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:NOOP,animatingEasing:"easeOutCubic",noAnimatingEasing:"easeInOutCubic",penetrationDeceleration:.03,penetrationAcceleration:.08},t)this.options[i]=t[i];animatingMethod=createEasingFunction(this.options.animatingEasing),noAnimatingMethod=createEasingFunction(this.options.noAnimatingEasing)}var members={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__loadHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshBeforeDeactivate:null,__refreshDeactivate:null,__refreshStart:null,__loadActive:null,__loadActivate:null,__loadBeforeDeactivate:null,__loadDeactivate:null,__loadStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__disable:!1,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(e,t,i,o){e===+e&&(this.__clientWidth=e),t===+t&&(this.__clientHeight=t),i===+i&&(this.__contentWidth=i),o===+o&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(e,t){this.__clientLeft=e||0,this.__clientTop=t||0},setSnapSize:function(e,t){this.__snapWidth=e,this.__snapHeight=t},activatePullToRefresh:function(e,t,i,o,s){this.__refreshHeight=e,this.__refreshActivate=t,this.__refreshBeforeDeactivate=s,this.__refreshDeactivate=i,this.__refreshStart=o},activatePushToLoad:function(e,t,i,o,s){this.__loadHeight=e,this.__loadActivate=t,this.__loadBeforeDeactivate=s,this.__loadDeactivate=i,this.__loadStart=o},triggerRefreshOrLoad:function(){"refresh"==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"refresh")?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart())},finishRefreshOrLoad:function(){var e=this;e.__refreshBeforeDeactivate&&e.__refreshActive?(e.__refreshActive=!1,e.__refreshBeforeDeactivate(function(){e.__refreshDeactivate&&e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__refreshDeactivate&&e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)),e.__loadBeforeDeactivate&&e.__loadActive?(e.__loadActive=!1,e.__loadBeforeDeactivate(function(){e.__loadDeactivate&&e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__loadDeactivate&&e.__loadActive&&(e.__loadActive=!1,e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0))},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(e,t,i,o,s){if(!this.options.zooming)throw new Error("Zooming is not enabled!");s&&(this.__zoomComplete=s),this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var l=this.__zoomLevel;null==i&&(i=this.__clientWidth/2),null==o&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);var r=(i+this.__scrollLeft)*e/l-i,a=(o+this.__scrollTop)*e/l-o;r>this.__maxScrollLeft?r=this.__maxScrollLeft:r<0&&(r=0),a>this.__maxScrollTop?a=this.__maxScrollTop:a<0&&(a=0),this.__publish(r,a,e,t)},zoomBy:function(e,t,i,o,s){this.zoomTo(this.__zoomLevel*e,t,i,o,s)},scrollTo:function(e,t,i,o,s){if(this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1),null!=o&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX||s?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY||s?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(i=!1),this.__isTracking||this.__publish(e,t,o,i)},scrollBy:function(e,t,i){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,s=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),s+(t||0),i)},doMouseZoom:function(e,t,i,o){var s=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*s,!1,i-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(e,t){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var i,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(core.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var s=1===e.length;s?(i=e[0].pageX,o=e[0].pageY):(i=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=i,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=i,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!s&&this.options.scrollingX,this.__enableScrollY=!s&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!s,this.__isSingleTouch=s,this.__positions=[]},doTouchMove:function(e,t,i){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){var o,s;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,s=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,s=e[0].pageY);var l=this.__positions;if(this.__isDragging){var r=o-this.__lastTouchLeft,a=s-this.__lastTouchTop,n=this.__scrollLeft,c=this.__scrollTop,h=this.__zoomLevel;if(null!=i&&this.options.zooming){var d=h;if(h=h/this.__lastScale*i,d!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var _=o-this.__clientLeft,u=s-this.__clientTop;n=(_+n)*h/d-_,c=(u+c)*h/d-u,this.__computeScrollMax(h)}}if(this.__enableScrollX){n-=r*this.options.speedMultiplier;var p=this.__maxScrollLeft;(n>p||n<0)&&(this.options.bouncing?n+=r/2*this.options.speedMultiplier:n=n>p?p:0)}if(this.__enableScrollY){c-=a*this.options.speedMultiplier;var f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?(c+=a/2*this.options.speedMultiplier,this.__enableScrollX||null==this.__refreshHeight&&null==this.__loadHeight||(!this.__refreshActive&&c<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&c>-this.__refreshHeight?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):!this.__loadActive&&c>=this.__maxScrollTop+this.__loadHeight?(this.__loadActive=!0,this.__loadActivate&&this.__loadActivate()):this.__refreshActive&&cf?f:0)}l.length>60&&l.splice(0,30),l.push(n,c,t),this.__publish(n,c,h)}else{var m=this.options.locking?3:0,v=Math.abs(o-this.__initialTouchLeft),g=Math.abs(s-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&v>=m,this.__enableScrollY=this.options.scrollingY&&g>=m,l.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(v>=5||g>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=s,this.__lastTouchMove=t,this.__lastScale=i}},doTouchEnd:function(e){if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){for(var t=this.__positions,i=t.length-1,o=i,s=i;s>0&&t[s]>this.__lastTouchMove-100;s-=3)o=s;if(o!==i){var l=t[i]-t[o],r=this.__scrollLeft-t[o-2],a=this.__scrollTop-t[o-1];this.__decelerationVelocityX=r/l*(1e3/60),this.__decelerationVelocityY=a/l*(1e3/60);var n=this.options.paging||this.options.snapping?4:1;Math.abs(this.__decelerationVelocityX)>n||Math.abs(this.__decelerationVelocityY)>n?this.__refreshActive||this.__loadActive||this.__startDeceleration(e):this.options.scrollingComplete()}else this.options.scrollingComplete()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||(this.__refreshActive&&this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):this.__loadActive&&this.__loadStart?(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart()):((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):this.__loadActive&&(this.__loadActive=!1,this.__loadDeactivate&&this.__loadDeactivate()))),this.__positions.length=0}},onScroll:NOOP,stop:function(){this.__disable=!0},start:function(){self.__disable=!0},__publish:function(e,t,i,o){var s=this;if(!s.__disable){var l=s.__isAnimating;if(l&&(core.effect.Animate.stop(l),s.__isAnimating=!1),o&&s.options.animating){s.__scheduledLeft=e,s.__scheduledTop=t,s.__scheduledZoom=i;var r=s.__scrollLeft,a=s.__scrollTop,n=s.__zoomLevel,c=e-r,h=t-a,d=i-n;s.__isAnimating=core.effect.Animate.start(function(e,t,i){i&&(s.__scrollLeft=r+c*e,s.__scrollTop=a+h*e,s.__zoomLevel=n+d*e,s.__callback&&(s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel),s.onScroll()))},function(e){return s.__isAnimating===e},function(e,t,i){t===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||i)&&s.options.scrollingComplete(),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))},s.options.animationDuration,l?animatingMethod:noAnimatingMethod)}else s.__scheduledLeft=s.__scrollLeft=e,s.__scheduledTop=s.__scrollTop=t,s.__scheduledZoom=s.__zoomLevel=i,s.__callback&&(s.__callback(e,t,i),s.onScroll()),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))}},__computeScrollMax:function(e){null==e&&(e=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)},__startDeceleration:function(){var e=this;if(e.options.paging){var t=Math.max(Math.min(e.__scrollLeft,e.__maxScrollLeft),0),i=Math.max(Math.min(e.__scrollTop,e.__maxScrollTop),0),o=e.__clientWidth,s=e.__clientHeight;e.__minDecelerationScrollLeft=Math.floor(t/o)*o,e.__minDecelerationScrollTop=Math.floor(i/s)*s,e.__maxDecelerationScrollLeft=Math.ceil(t/o)*o,e.__maxDecelerationScrollTop=Math.ceil(i/s)*s}else e.__minDecelerationScrollLeft=0,e.__minDecelerationScrollTop=0,e.__maxDecelerationScrollLeft=e.__maxScrollLeft,e.__maxDecelerationScrollTop=e.__maxScrollTop;var l=e.options.snapping?4:.001;e.__isDecelerating=core.effect.Animate.start(function(t,i,o){e.__stepThroughDeceleration(o)},function(){var t=Math.abs(e.__decelerationVelocityX)>=l||Math.abs(e.__decelerationVelocityY)>=l;return t||(e.__didDecelerationComplete=!0),t},function(){e.__isDecelerating=!1,e.__didDecelerationComplete&&e.options.scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,e.options.snapping)})},__stepThroughDeceleration:function(e){var t=this.__scrollLeft+this.__decelerationVelocityX,i=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);var s=Math.max(Math.min(this.__maxDecelerationScrollTop,i),this.__minDecelerationScrollTop);s!==i&&(i=s,this.__decelerationVelocityY=0)}if(e?this.__publish(t,i,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=i),!this.options.paging){this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95}if(this.options.bouncing){var l=0,r=0,a=this.options.penetrationDeceleration,n=this.options.penetrationAcceleration;tthis.__maxDecelerationScrollLeft&&(l=this.__maxDecelerationScrollLeft-t),ithis.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-i),0!==l&&(l*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=l*a:this.__decelerationVelocityX=l*n),0!==r&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*a:this.__decelerationVelocityY=r*n)}}};for(var key in members)Scroller.prototype[key]=members[key];function render(e,t){var i,o=document.documentElement.style;t.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?i="presto":"MozAppearance"in o?i="gecko":"WebkitAppearance"in o?i="webkit":"string"==typeof navigator.cpuClass&&(i="trident");var s={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[i],l=document.createElement("div"),r=s+"Perspective",a=s+"Transform";return void 0!==l.style[r]?function(t,i,o){e.style[a]="translate3d("+-t+"px,"+-i+"px,0) scale("+o+")"}:void 0!==l.style[a]?function(t,i,o){e.style[a]="translate("+-t+"px,"+-i+"px) scale("+o+")"}:function(t,i,o){e.style.marginLeft=t?-t/o+"px":"",e.style.marginTop=i?-i/o+"px":"",e.style.zoom=o||""}}function listenContainer(e,t,i,o){var s=null;function l(e){e.touches[0]&&e.touches[0].target&&e.touches[0].target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart(e.touches,e.timeStamp),e.preventDefault())}function r(e){i("mousemove"),t.doTouchMove(e.touches,e.timeStamp,e.scale)}function a(e){i("mouseup"),t.doTouchEnd(e.timeStamp)}function n(e){t.doTouchEnd(e.timeStamp)}function c(e){e.target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function h(e){u&&(i("mousemove"),t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function d(e){u&&(i("mouseup"),t.doTouchEnd(e.timeStamp),u=!1)}function _(e){t.doMouseZoom(e.detail?-120*e.detail:e.wheelDelta,e.timeStamp,e.pageX,e.pageY)}if("ontouchstart"in window)e.addEventListener("touchstart",l,!1),document.addEventListener("touchmove",r,!1),document.addEventListener("touchend",a,!1),document.addEventListener("touchcancel",n,!1),s=function(){e.removeEventListener("touchstart",l,!1),document.removeEventListener("touchmove",r,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",n,!1)};else{var u=!1;e.addEventListener("mousedown",c,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",d,!1),o&&e.addEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1),s=function(){e.removeEventListener("mousedown",c,!1),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",d,!1),e.removeEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1)}}return t.onScroll=function(){i("onscroll")},s}var refreshActivateCallback=function(){this.vuescroll.state.refreshStage="active"},refreshStartCallback=function(){var e=this;e.vuescroll.state.refreshStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},refreshBeforeDeactivateCallback=function(e){this.vuescroll.state.refreshStage="beforeDeactive",setTimeout(function(){e()},500)},refreshDeactivateCallback=function(){this.vuescroll.state.refreshStage="deactive"},loadActivateCallback=function(){this.vuescroll.state.loadStage="active"},loadStartCallback=function(){var e=this;e.vuescroll.state.loadStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},loadBeforeDeactivateCallback=function(e){this.vuescroll.state.loadStage="beforeDeactive",setTimeout(function(){e()},500)},loadDeactivateCallback=function(){this.vuescroll.state.loadStage="deactive"},slideMode={methods:{updateScroller:function(){var e=this.$el.clientWidth,t=this.$el.clientHeight,i=this.scrollPanelElm.scrollWidth,o=this.scrollPanelElm.scrollHeight,s=0;if(this.mergedOptions.vuescroll.pullRefresh.enable){var l=this.$refs.refreshDom.elm||this.$refs.refreshDom;s=l.scrollHeight,l.style.marginTop||(l.style.marginTop=-s+"px",o-=s)}this.mergedOptions.vuescroll.pushLoad.enable&&(o-=(this.$refs.loadDom.elm||this.$refs.loadDom).scrollHeight);this.scroller.setDimensions(e,t,i,o)},registryScroller:function(){var e=this,t=this.mergedOptions.vuescroll.paging,i=this.mergedOptions.vuescroll.snapping.enable,o=!this.refreshLoad&&!t&&!i,s=this.mergedOptions.scrollPanel,l=s.scrollingY,r=s.scrollingX;this.scroller=new Scroller(render(this.scrollPanelElm,window),{zooming:o,scrollingY:l,scrollingX:r&&!this.refreshLoad,animationDuration:this.mergedOptions.scrollPanel.speed,paging:t,snapping:i}),i&&this.scroller.setSnapSize(this.mergedOptions.vuescroll.snapping.width,this.mergedOptions.vuescroll.snapping.height);var a=this.$el.getBoundingClientRect();this.scroller.setPosition(a.left+this.$el.clientLeft,a.top+this.$el.clientTop);var n=listenContainer(this.$el,this.scroller,function(t){switch(t){case"mousedown":e.vuescroll.state.isDragging=!0;break;case"onscroll":e.handleScroll(!1);break;case"mouseup":e.vuescroll.state.isDragging=!1}},o);if(this.mergedOptions.vuescroll.pullRefresh.enable){var c=this.$refs.refreshDom.elm||this.$refs.refreshDom;this.$listeners["refresh-activate"]&&(refreshActivateCallback=function(){e.vuescroll.state.refreshStage="active",e.$emit("refresh-activate",e,c)}),this.$listeners["refresh-before-deactivate"]&&(refreshBeforeDeactivateCallback=function(t){e.vuescroll.state.refreshStage="beforeDeactive",e.$emit("refresh-before-deactivate",e,c,t.bind(e.scroller))}),this.$listeners["refresh-deactivate"]&&(refreshDeactivateCallback=function(){e.vuescroll.state.refreshStage="deactive",e.$emit("refresh-deactivate",e,c)}),this.$listeners["refresh-start"]&&(refreshStartCallback=function(){e.vuescroll.state.refreshStage="start",e.$emit("refresh-start",e,c,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var h=c.scrollHeight;this.scroller.activatePullToRefresh(h,refreshActivateCallback.bind(this),refreshDeactivateCallback.bind(this),refreshStartCallback.bind(this),refreshBeforeDeactivateCallback.bind(this))}if(this.mergedOptions.vuescroll.pushLoad.enable){var d=this.$refs.loadDom.elm||this.$refs.loadDom;this.$listeners["load-activate"]&&(loadActivateCallback=function(){e.vuescroll.state.loadStage="active",e.$emit("load-activate",e,d)}),this.$listeners["load-before-deactivate"]&&(loadBeforeDeactivateCallback=function(t){e.vuescroll.state.loadStage="beforeDeactive",e.$emit("load-before-deactivate",e,d,t.bind(e.scroller))}),this.$listeners["load-deactivate"]&&(loadDeactivateCallback=function(){e.vuescroll.state.loadStage="deactive",e.$emit("load-deactivate",e,d)}),this.$listeners["load-start"]&&(loadStartCallback=function(){e.vuescroll.state.loadStage="start",e.$emit("load-start",e,d,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var _=d.scrollHeight;this.scroller.activatePushToLoad(_,loadActivateCallback.bind(this),loadDeactivateCallback.bind(this),loadStartCallback.bind(this),loadBeforeDeactivateCallback.bind(this))}return this.updateScroller(),n},updateSlideModeBarState:function(){var e,t,i=this.$el,o=this.scroller,s=0,l=0,r=i.clientWidth,a=i.clientHeight,n=r+this.scroller.__maxScrollLeft,c=a+this.scroller.__maxScrollTop,h=ro.__maxScrollLeft&&(s=o.__scrollLeft-o.__maxScrollLeft)),d&&(o.__scrollTop<0?l=-o.__scrollTop:o.__scrollTop>o.__maxScrollTop&&(l=o.__scrollTop-o.__maxScrollTop)),e=100*a/(c+l),t=100*r/(n+s);var _=Math.min(Math.max(0,o.__scrollTop),o.__maxScrollTop),u=Math.min(Math.max(0,o.__scrollLeft),o.__maxScrollLeft);this.bar.vBar.state.posValue=100*(_+l)/i.clientHeight,this.bar.hBar.state.posValue=100*(u+s)/i.clientWidth,o.__scrollLeft<0&&(this.bar.hBar.state.posValue=0),o.__scrollTop<0&&(this.bar.vBar.state.posValue=0),this.bar.vBar.state.size=e<100?e+"%":0,this.bar.hBar.state.size=t<100?t+"%":0}}},_extends=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;"native"==this.mode||"pure-native"==this.mode?this.updateNativeModeBarState():"slide"==this.mode&&this.updateSlideModeBarState(),e&&this.emitEvent(e,t)},updateMode:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{var t=this.vuescroll.state.internalScrollLeft,i=this.vuescroll.state.internalScrollTop;this.destroyScroller&&(this.scroller.stop(),this.destroyScroller(),this.destroyScroller=null),"slide"==this.mode?this.destroyScroller=this.registryScroller():"native"!=this.mode&&"pure-native"!=this.mode||(this.scrollPanelElm.style.transform="",this.scrollPanelElm.style.transformOrigin=""),this.scrollTo({x:t,y:i},!1,!0)}},handleScroll:function(e){this.recordCurrentPos(),this.update("handle-scroll",e),this.showAndDefferedHideBar()},setBarClick:function(e){this.isClickingBar=e},showAndDefferedHideBar:function(){var e=this;this.showBar(),this.vuescroll.state.timeoutId&&clearTimeout(this.vuescroll.state.timeoutId),this.vuescroll.state.timeoutId=setTimeout(function(){e.vuescroll.state.timeoutId=0,e.hideBar()},500)},emitEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.scrollPanelElm,o={type:"vertical"},s={type:"horizontal"},l=i.scrollTop,r=i.scrollLeft;"slide"==this.mode&&(l=this.scroller.__scrollTop,r=this.scroller.__scrollLeft),o.process=l/(i.scrollHeight-i.clientHeight),s.process=r/(i.scrollWidth-i.clientWidth),o.barSize=this.bar.vBar.state.size,s.barSize=this.bar.hBar.state.size,this.$emit(e,o,s,t)},showBar:function(){this.bar.vBar.state.opacity=this.mergedOptions.bar.vBar.opacity,this.bar.hBar.state.opacity=this.mergedOptions.bar.hBar.opacity},hideBar:function(){this.vuescroll.state.isDragging||(this.mergedOptions.bar.vBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.vBar.state.opacity=0),this.mergedOptions.bar.hBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.hBar.state.opacity=0))},registryResize:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{this.destroyResize&&this.destroyResize();var t=null;"slide"==this.mode||"pure-native"==this.mode?t=this.scrollPanelElm:"native"==this.mode&&(t=this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent),window.addEventListener("resize",function(){e.update(),e.showAndDefferedHideBar(),"slide"==e.mode&&e.updateScroller()},!1);var i=[function(){var t={};"slide"==e.mode?(e.updateScroller(),t.width=e.scroller.__contentWidth,t.height=e.scroller.__contentHeight):"native"==e.mode&&(t.width=e.scrollPanelElm.scrollWidth,t.height=e.scrollPanelElm.scrollHeight),e.update("handle-resize",t),e.showAndDefferedHideBar()}];this.destroyResize=listenResize(t,i)}},recordCurrentPos:function(){this.mode!==this.lastMode?(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.lastMode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.lastMode,this).y,this.lastMode=this.mode):(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.mode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.mode,this).y)},watchChanges:function(){var e=this;this.$watch("mergedOptions",function(){e.recordCurrentPos(),e.$nextTick(function(){e.registryResize(),e.updateMode()})},{deep:!0,sync:!0})},watchSmallChanges:function(){var e=this;uncessaryChangeArray.forEach(function(t){e.$watch(t,function(){e.shouldStop=!0},{sync:!0,deep:!0})})}},mounted:function(){var e=this;this._isDestroyed||this.shouldStopRender||("slide"==this.mode&&(this.destroyScroller=this.registryScroller()),this.lastMode=this.mode,this.registryResize(),this.watchChanges(),this.watchSmallChanges(),this.$nextTick(function(){e.update(),e.showAndDefferedHideBar()}))},updated:function(){var e=this;this.$nextTick(function(){e._isDestroyed||e.showAndDefferedHideBar()})}},scroll={install:function(e){scroll.isInstalled?console.warn("You should not install the vuescroll again!"):(e.component(vuescroll.name,vuescroll),e.prototype.$vuescrollConfig=deepMerge(GCF,{}),scroll.isInstalled=!0,scroll.version="4.4.9")}};export default scroll; \ No newline at end of file +import Vue from"vue";var map={vertical:{bar:{size:"height",opsSize:"width",posName:"top",page:"pageY",scroll:"scrollTop",scrollSize:"scrollHeight",offset:"offsetHeight",client:"clientY"},axis:"Y"},horizontal:{bar:{size:"width",opsSize:"height",posName:"left",page:"pageX",scroll:"scrollLeft",scrollSize:"scrollWidth",offset:"offsetWidth",client:"clientX"},axis:"X"}},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function deepCopy(e,t){for(var i in t="object"===(void 0===t?"undefined":_typeof(t))&&t||{},e)t[i]="object"===_typeof(e[i])?deepCopy(e[i],t[i]={}):e[i];return t}function deepMerge(e,t){for(var i in t=t||{},e)"object"===_typeof(e[i])?void 0===t[i]?(t[i]={},deepCopy(e[i],t[i])):deepMerge(e[i],t[i]):void 0===t[i]&&(t[i]=e[i]);return t}function defineReactive(e,t,i,o){var s=null;(i[t]||"function"==typeof i)&&(o=o||t,"function"==typeof i&&(s=i),Object.defineProperty(e,t,{get:s||function(){return i[o]},configurable:!0}))}var scrollBarWidth=void 0;function getGutter(){if(Vue.prototype.$isServer)return 0;if(void 0!==scrollBarWidth)return scrollBarWidth;var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var i=document.createElement("div");i.style.width="100%",e.appendChild(i);var o=i.offsetWidth;return e.parentNode.removeChild(e),scrollBarWidth=t-o,getGutter.isUsed=!1,scrollBarWidth}var haveHideen=!1,haveCreatedRefreshDomClass=!1,haveCreatedLoadDomClass=!1;function hideSystemBar(){if(!haveHideen){haveHideen=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML=".vuescroll-panel::-webkit-scrollbar{width:0;height:0}",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createRefreshDomStyle(){if(!haveCreatedRefreshDomClass){haveCreatedRefreshDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-refresh {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-refresh svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-refresh svg path,\n .vuescroll-refresh svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function createLoadDomStyle(){if(!haveCreatedLoadDomClass){haveCreatedLoadDomClass=!0;var e=document.createElement("style");e.type="text/css",e.innerHTML="\n .vuescroll-load {\n color: black;\n height: 50px;\n text-align: center;\n font-size: 16px;\n line-height: 50px;\n }\n .vuescroll-load svg {\n margin-right: 10px;\n width: 25px;\n height: 25px;\n vertical-align: sub;\n }\n .vuescroll-load svg path,\n .vuescroll-load svg rect{\n fill: #FF6700;\n }\n ",document.getElementsByTagName("HEAD").item(0).appendChild(e)}}function renderTransform(e,t){return{transform:"translate"+map[e].axis+"("+t+"%)",msTransform:"translate"+map[e].axis+"("+t+"%)",webkitTransform:"translate"+map[e].axis+"("+t+"%)"}}function on(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.addEventListener(t,i,o)}function off(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,i,o)}function easingPattern(e,t){var i=null;return"easeInQuad"===e&&(i=t*t),"easeOutQuad"===e&&(i=t*(2-t)),"easeInOutQuad"===e&&(i=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e&&(i=t*t*t),"easeOutCubic"===e&&(i=--t*t*t+1),"easeInOutCubic"===e&&(i=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e&&(i=t*t*t*t),"easeOutQuart"===e&&(i=1- --t*t*t*t),"easeInOutQuart"===e&&(i=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e&&(i=t*t*t*t*t),"easeOutQuint"===e&&(i=1+--t*t*t*t*t),"easeInOutQuint"===e&&(i=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),i||t}function goScrolling(e,t,i,o,s){var l=null,r=null,a=null,n=e.scrollTop,c=e.scrollLeft;n+i<0&&(i=-n),n+i>e.scrollHeight&&(i=e.scrollHeight-n),c+t<0&&(t=-c),c+t>e.scrollWidth&&(t=e.scrollWidth-c);requestAnimationFrame(function h(d){l||(l=d);var _=d-l,u=_/o>1?1:_/o;r=c+t*easingPattern(s,u),a=n+i*easingPattern(s,u),(Math.abs(a-n)<=Math.abs(i)||Math.abs(r-c)<=Math.abs(t))&&(e.scrollTop=Math.floor(a),e.scrollLeft=Math.floor(r),u<1&&requestAnimationFrame(h))})}function listenResize(e,t){var i=document.createElement("object");return i.style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",i.tabIndex=-1,i.type="text/html",i.onload=function(){t.forEach(function(e){on(i.contentDocument.defaultView,"resize",e)})},e.appendChild(i),function(){i.contentDocument&&t.forEach(function(e){off(i.contentDocument.defaultView,"resize",e)}),e.removeChild(i)}}function findValuesByMode(e,t){var i={};switch(e){case"native":case"pure-native":i={x:t.scrollPanelElm.scrollLeft,y:t.scrollPanelElm.scrollTop};break;case"slide":i={x:t.scroller.__scrollLeft,y:t.scroller.__scrollTop}}return i}var modes=["slide","native","pure-native"],GCF={vuescroll:{mode:"native",pullRefresh:{enable:!1,tips:{deactive:"Pull to Refresh",active:"Release to Refresh",start:"Refreshing...",beforeDeactive:"Refresh Successfully!"}},pushLoad:{enable:!1,tips:{deactive:"Push to Load",active:"Release to Load",start:"Loading...",beforeDeactive:"Load Successfully!"}},paging:!1,snapping:{enable:!1,width:100,height:100}},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!0,scrollingY:!0,speed:300,easing:void 0},scrollContent:{tag:"div",padding:!0,props:{},attrs:{}},rail:{vRail:{width:"5px",pos:"right",background:"#a5d6a7",opacity:0},hRail:{height:"5px",pos:"bottom",background:"#a5d6a7",opacity:0}},bar:{vBar:{background:"#4caf50",deltaY:100,keepShow:!1,opacity:1,hover:!1},hBar:{background:"#4caf50",keepShow:!1,opacity:1,hover:!1}}};function validateOptions(e){var t=!1,i=e.vuescroll,o=e.scrollPanel;~modes.indexOf(i.mode)||(console.error('[vuescroll][ops]: The vuescroll\'s option "mode" should be one of the '+modes),t=!0),i.paging==i.snapping.enable&&i.paging&&(i.pullRefresh||i.pushLoad)&&console.error("[vuescroll][ops]: paging, snapping, (pullRefresh with pushLoad) can only one of them to be true.");var s=o.initialScrollY,l=o.initialScrollX;return s&&!String(s).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollY` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),l&&!String(l).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollX` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),t}function hackPropsData(){var e=this;if("vueScroll"===e.$options.name){var t=deepMerge(e.$vuescrollConfig,{}),i=deepMerge(GCF,t);e.$options.propsData.ops=e.$options.propsData.ops||{},Object.keys(e.$options.propsData.ops).forEach(function(t){defineReactive(e.mergedOptions,t,e.$options.propsData.ops)}),deepMerge(i,e.mergedOptions),defineReactive(e.mergedOptions.bar.vBar,"pos",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.vBar,"width",e.mergedOptions.rail.vRail),defineReactive(e.mergedOptions.bar.hBar,"pos",e.mergedOptions.rail.hRail),defineReactive(e.mergedOptions.bar.hBar,"height",e.mergedOptions.rail.hRail);defineReactive(e.mergedOptions.scrollContent,"paddPos",function(){return"padding-"+e.mergedOptions.rail.vRail.pos}),defineReactive(e.mergedOptions.scrollContent,"paddValue",function(){return e.mergedOptions.rail.vRail.width})}}var hackLifecycle={data:function(){return{shouldStopRender:!1}},created:function(){hackPropsData.call(this),this.shouldStopRender=validateOptions(this.mergedOptions)}};function getNumericValue(e,t){var i=void 0;return i=(i=/(-?\d+(?:\.\d+?)?)%$/.exec(e))?t*(i=i[1]-0)/100:e-0}var api={methods:{scrollTo:function(e){var t=e.x,i=e.y,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=void 0===t?this.vuescroll.state.internalScrollLeft:getNumericValue(t,this.scrollPanelElm.scrollWidth),i=void 0===i?this.vuescroll.state.internalScrollTop:getNumericValue(i,this.scrollPanelElm.scrollHeight),this.internalScrollTo(t,i,o,s)},scrollBy:function(e){var t=e.dx,i=e.dy,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=this.vuescroll.state,l=s.internalScrollLeft,r=s.internalScrollTop;t&&(l+=getNumericValue(t,this.scrollPanelElm.scrollWidth)),i&&(r+=getNumericValue(i,this.scrollPanelElm.scrollHeight)),this.internalScrollTo(l,r,o)},internalScrollTo:function(e,t,i,o){"native"==this.mode||"pure-native"==this.mode?i?goScrolling(this.$refs.scrollPanel.$el,e-this.$refs.scrollPanel.$el.scrollLeft,t-this.$refs.scrollPanel.$el.scrollTop,this.mergedOptions.scrollPanel.speed,this.mergedOptions.scrollPanel.easing):(this.$refs.scrollPanel.$el.scrollTop=t,this.$refs.scrollPanel.$el.scrollLeft=e):"slide"==this.mode&&this.scroller.scrollTo(e,t,i,void 0,o)},forceUpdate:function(){var e=this;this.$forceUpdate(),Object.keys(this.$refs).forEach(function(t){var i=e.$refs[t];i._isVue&&i.$forceUpdate()})}}},nativeMode={methods:{updateNativeModeBarState:function(){var e=this.scrollPanelElm,t=this.$el,i=100*t.clientHeight/e.scrollHeight,o=100*t.clientWidth/e.scrollWidth;this.bar.vBar.state.posValue=100*e.scrollTop/t.clientHeight,this.bar.hBar.state.posValue=100*e.scrollLeft/t.clientWidth,this.bar.vBar.state.size=i<100?i+"%":0,this.bar.hBar.state.size=o<100?o+"%":0}}},time=Date.now||function(){return+new Date},desiredFrames=60,millisecondsPerSecond=1e3,running={},counter=1,core={effect:{}},global=window;core.effect.Animate={requestAnimationFrame:function(){var e=global.requestAnimationFrame||global.webkitRequestAnimationFrame||global.mozRequestAnimationFrame||global.oRequestAnimationFrame,t=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(t=!1),t)return function(t,i){e(t,i)};var i={},o=1,s=null,l=+new Date;return function(e){var t=o++;return i[t]=e,requestCount++,null===s&&(s=setInterval(function(){var e=+new Date,t=i;for(var o in i={},requestCount=0,t)t.hasOwnProperty(o)&&(t[o](e),l=e);e-l>2500&&(clearInterval(s),s=null)},1e3/60)),t}}(),stop:function(e){var t=null!=running[e];return t&&(running[e]=null),t},isRunning:function(e){return null!=running[e]},start:function(e,t,i,o,s,l){var r=time(),a=r,n=0,c=0,h=counter++;if(l||(l=document.body),h%20==0){var d={};for(var _ in running)d[_]=!0;running=d}return running[h]=!0,core.effect.Animate.requestAnimationFrame(function d(_){var u=!0!==_,p=time();if(!running[h]||t&&!t(h))return running[h]=null,void(i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,!1));if(u)for(var f=Math.round((p-a)/(millisecondsPerSecond/desiredFrames))-1,m=0;m1&&(n=1);var v=s?s(n):n;!1!==e(v,p,u)&&1!==n||!u?u&&(a=p,core.effect.Animate.requestAnimationFrame(d,l)):(running[h]=null,i&&i(desiredFrames-c/((p-r)/millisecondsPerSecond),h,1===n||null==o))},l),h}};var NOOP=function(){};function createEasingFunction(e){return function(t){return easingPattern(e,t)}}var animatingMethod=null,noAnimatingMethod=null;function Scroller(e,t){for(var i in this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:NOOP,animatingEasing:"easeOutCubic",noAnimatingEasing:"easeInOutCubic",penetrationDeceleration:.03,penetrationAcceleration:.08},t)this.options[i]=t[i];animatingMethod=createEasingFunction(this.options.animatingEasing),noAnimatingMethod=createEasingFunction(this.options.noAnimatingEasing)}var members={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__loadHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshBeforeDeactivate:null,__refreshDeactivate:null,__refreshStart:null,__loadActive:null,__loadActivate:null,__loadBeforeDeactivate:null,__loadDeactivate:null,__loadStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__disable:!1,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(e,t,i,o){e===+e&&(this.__clientWidth=e),t===+t&&(this.__clientHeight=t),i===+i&&(this.__contentWidth=i),o===+o&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(e,t){this.__clientLeft=e||0,this.__clientTop=t||0},setSnapSize:function(e,t){this.__snapWidth=e,this.__snapHeight=t},activatePullToRefresh:function(e,t,i,o,s){this.__refreshHeight=e,this.__refreshActivate=t,this.__refreshBeforeDeactivate=s,this.__refreshDeactivate=i,this.__refreshStart=o},activatePushToLoad:function(e,t,i,o,s){this.__loadHeight=e,this.__loadActivate=t,this.__loadBeforeDeactivate=s,this.__loadDeactivate=i,this.__loadStart=o},triggerRefreshOrLoad:function(){"refresh"==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"refresh")?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart())},finishRefreshOrLoad:function(){var e=this;e.__refreshBeforeDeactivate&&e.__refreshActive?(e.__refreshActive=!1,e.__refreshBeforeDeactivate(function(){e.__refreshDeactivate&&e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__refreshDeactivate&&e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)),e.__loadBeforeDeactivate&&e.__loadActive?(e.__loadActive=!1,e.__loadBeforeDeactivate(function(){e.__loadDeactivate&&e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__loadDeactivate&&e.__loadActive&&(e.__loadActive=!1,e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0))},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(e,t,i,o,s){if(!this.options.zooming)throw new Error("Zooming is not enabled!");s&&(this.__zoomComplete=s),this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var l=this.__zoomLevel;null==i&&(i=this.__clientWidth/2),null==o&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);var r=(i+this.__scrollLeft)*e/l-i,a=(o+this.__scrollTop)*e/l-o;r>this.__maxScrollLeft?r=this.__maxScrollLeft:r<0&&(r=0),a>this.__maxScrollTop?a=this.__maxScrollTop:a<0&&(a=0),this.__publish(r,a,e,t)},zoomBy:function(e,t,i,o,s){this.zoomTo(this.__zoomLevel*e,t,i,o,s)},scrollTo:function(e,t,i,o,s){if(this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1),null!=o&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX||s?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY||s?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(i=!1),this.__isTracking||this.__publish(e,t,o,i)},scrollBy:function(e,t,i){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,s=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),s+(t||0),i)},doMouseZoom:function(e,t,i,o){var s=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*s,!1,i-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(e,t){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var i,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(core.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(core.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var s=1===e.length;s?(i=e[0].pageX,o=e[0].pageY):(i=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=i,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=i,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!s&&this.options.scrollingX,this.__enableScrollY=!s&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!s,this.__isSingleTouch=s,this.__positions=[]},doTouchMove:function(e,t,i){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){var o,s;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,s=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,s=e[0].pageY);var l=this.__positions;if(this.__isDragging){var r=o-this.__lastTouchLeft,a=s-this.__lastTouchTop,n=this.__scrollLeft,c=this.__scrollTop,h=this.__zoomLevel;if(null!=i&&this.options.zooming){var d=h;if(h=h/this.__lastScale*i,d!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var _=o-this.__clientLeft,u=s-this.__clientTop;n=(_+n)*h/d-_,c=(u+c)*h/d-u,this.__computeScrollMax(h)}}if(this.__enableScrollX){n-=r*this.options.speedMultiplier;var p=this.__maxScrollLeft;(n>p||n<0)&&(this.options.bouncing?n+=r/2*this.options.speedMultiplier:n=n>p?p:0)}if(this.__enableScrollY){c-=a*this.options.speedMultiplier;var f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?(c+=a/2*this.options.speedMultiplier,this.__enableScrollX||null==this.__refreshHeight&&null==this.__loadHeight||(!this.__refreshActive&&c<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&c>-this.__refreshHeight?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):!this.__loadActive&&c>=this.__maxScrollTop+this.__loadHeight?(this.__loadActive=!0,this.__loadActivate&&this.__loadActivate()):this.__refreshActive&&cf?f:0)}l.length>60&&l.splice(0,30),l.push(n,c,t),this.__publish(n,c,h)}else{var m=this.options.locking?3:0,v=Math.abs(o-this.__initialTouchLeft),g=Math.abs(s-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&v>=m,this.__enableScrollY=this.options.scrollingY&&g>=m,l.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(v>=5||g>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=s,this.__lastTouchMove=t,this.__lastScale=i}},doTouchEnd:function(e){if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){for(var t=this.__positions,i=t.length-1,o=i,s=i;s>0&&t[s]>this.__lastTouchMove-100;s-=3)o=s;if(o!==i){var l=t[i]-t[o],r=this.__scrollLeft-t[o-2],a=this.__scrollTop-t[o-1];this.__decelerationVelocityX=r/l*(1e3/60),this.__decelerationVelocityY=a/l*(1e3/60);var n=this.options.paging||this.options.snapping?4:1;Math.abs(this.__decelerationVelocityX)>n||Math.abs(this.__decelerationVelocityY)>n?this.__refreshActive||this.__loadActive||this.__startDeceleration(e):this.options.scrollingComplete()}else this.options.scrollingComplete()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||(this.__refreshActive&&this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):this.__loadActive&&this.__loadStart?(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart()):((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):this.__loadActive&&(this.__loadActive=!1,this.__loadDeactivate&&this.__loadDeactivate()))),this.__positions.length=0}},onScroll:NOOP,stop:function(){this.__disable=!0},start:function(){self.__disable=!0},__publish:function(e,t,i,o){var s=this;if(!s.__disable){var l=s.__isAnimating;if(l&&(core.effect.Animate.stop(l),s.__isAnimating=!1),o&&s.options.animating){s.__scheduledLeft=e,s.__scheduledTop=t,s.__scheduledZoom=i;var r=s.__scrollLeft,a=s.__scrollTop,n=s.__zoomLevel,c=e-r,h=t-a,d=i-n;s.__isAnimating=core.effect.Animate.start(function(e,t,i){i&&(s.__scrollLeft=r+c*e,s.__scrollTop=a+h*e,s.__zoomLevel=n+d*e,s.__callback&&(s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel),s.onScroll()))},function(e){return s.__isAnimating===e},function(e,t,i){t===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||i)&&s.options.scrollingComplete(),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))},s.options.animationDuration,l?animatingMethod:noAnimatingMethod)}else s.__scheduledLeft=s.__scrollLeft=e,s.__scheduledTop=s.__scrollTop=t,s.__scheduledZoom=s.__zoomLevel=i,s.__callback&&(s.__callback(e,t,i),s.onScroll()),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))}},__computeScrollMax:function(e){null==e&&(e=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)},__startDeceleration:function(){var e=this;if(e.options.paging){var t=Math.max(Math.min(e.__scrollLeft,e.__maxScrollLeft),0),i=Math.max(Math.min(e.__scrollTop,e.__maxScrollTop),0),o=e.__clientWidth,s=e.__clientHeight;e.__minDecelerationScrollLeft=Math.floor(t/o)*o,e.__minDecelerationScrollTop=Math.floor(i/s)*s,e.__maxDecelerationScrollLeft=Math.ceil(t/o)*o,e.__maxDecelerationScrollTop=Math.ceil(i/s)*s}else e.__minDecelerationScrollLeft=0,e.__minDecelerationScrollTop=0,e.__maxDecelerationScrollLeft=e.__maxScrollLeft,e.__maxDecelerationScrollTop=e.__maxScrollTop;var l=e.options.snapping?4:.001;e.__isDecelerating=core.effect.Animate.start(function(t,i,o){e.__stepThroughDeceleration(o)},function(){var t=Math.abs(e.__decelerationVelocityX)>=l||Math.abs(e.__decelerationVelocityY)>=l;return t||(e.__didDecelerationComplete=!0),t},function(){e.__isDecelerating=!1,e.__didDecelerationComplete&&e.options.scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,e.options.snapping)})},__stepThroughDeceleration:function(e){var t=this.__scrollLeft+this.__decelerationVelocityX,i=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);var s=Math.max(Math.min(this.__maxDecelerationScrollTop,i),this.__minDecelerationScrollTop);s!==i&&(i=s,this.__decelerationVelocityY=0)}if(e?this.__publish(t,i,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=i),!this.options.paging){this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95}if(this.options.bouncing){var l=0,r=0,a=this.options.penetrationDeceleration,n=this.options.penetrationAcceleration;tthis.__maxDecelerationScrollLeft&&(l=this.__maxDecelerationScrollLeft-t),ithis.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-i),0!==l&&(l*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=l*a:this.__decelerationVelocityX=l*n),0!==r&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*a:this.__decelerationVelocityY=r*n)}}};for(var key in members)Scroller.prototype[key]=members[key];function render(e,t){var i,o=document.documentElement.style;t.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?i="presto":"MozAppearance"in o?i="gecko":"WebkitAppearance"in o?i="webkit":"string"==typeof navigator.cpuClass&&(i="trident");var s={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[i],l=document.createElement("div"),r=s+"Perspective",a=s+"Transform";return void 0!==l.style[r]?function(t,i,o){e.style[a]="translate3d("+-t+"px,"+-i+"px,0) scale("+o+")"}:void 0!==l.style[a]?function(t,i,o){e.style[a]="translate("+-t+"px,"+-i+"px) scale("+o+")"}:function(t,i,o){e.style.marginLeft=t?-t/o+"px":"",e.style.marginTop=i?-i/o+"px":"",e.style.zoom=o||""}}function listenContainer(e,t,i,o){var s=null;function l(e){e.touches[0]&&e.touches[0].target&&e.touches[0].target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart(e.touches,e.timeStamp),e.preventDefault())}function r(e){i("mousemove"),t.doTouchMove(e.touches,e.timeStamp,e.scale)}function a(e){i("mouseup"),t.doTouchEnd(e.timeStamp)}function n(e){t.doTouchEnd(e.timeStamp)}function c(e){e.target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function h(e){u&&(i("mousemove"),t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),u=!0)}function d(e){u&&(i("mouseup"),t.doTouchEnd(e.timeStamp),u=!1)}function _(e){t.doMouseZoom(e.detail?-120*e.detail:e.wheelDelta,e.timeStamp,e.pageX,e.pageY)}if("ontouchstart"in window)e.addEventListener("touchstart",l,!1),document.addEventListener("touchmove",r,!1),document.addEventListener("touchend",a,!1),document.addEventListener("touchcancel",n,!1),s=function(){e.removeEventListener("touchstart",l,!1),document.removeEventListener("touchmove",r,!1),document.removeEventListener("touchend",a,!1),document.removeEventListener("touchcancel",n,!1)};else{var u=!1;e.addEventListener("mousedown",c,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",d,!1),o&&e.addEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1),s=function(){e.removeEventListener("mousedown",c,!1),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",d,!1),e.removeEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",_,!1)}}return t.onScroll=function(){i("onscroll")},s}var refreshActivateCallback=function(){this.vuescroll.state.refreshStage="active"},refreshStartCallback=function(){var e=this;e.vuescroll.state.refreshStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},refreshBeforeDeactivateCallback=function(e){this.vuescroll.state.refreshStage="beforeDeactive",setTimeout(function(){e()},500)},refreshDeactivateCallback=function(){this.vuescroll.state.refreshStage="deactive"},loadActivateCallback=function(){this.vuescroll.state.loadStage="active"},loadStartCallback=function(){var e=this;e.vuescroll.state.loadStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},loadBeforeDeactivateCallback=function(e){this.vuescroll.state.loadStage="beforeDeactive",setTimeout(function(){e()},500)},loadDeactivateCallback=function(){this.vuescroll.state.loadStage="deactive"},slideMode={methods:{updateScroller:function(){var e=this.$el.clientWidth,t=this.$el.clientHeight,i=this.scrollPanelElm.scrollWidth,o=this.scrollPanelElm.scrollHeight,s=0;if(this.mergedOptions.vuescroll.pullRefresh.enable){var l=this.$refs.refreshDom.elm||this.$refs.refreshDom;s=l.scrollHeight,l.style.marginTop||(l.style.marginTop=-s+"px",o-=s)}this.mergedOptions.vuescroll.pushLoad.enable&&(o-=(this.$refs.loadDom.elm||this.$refs.loadDom).scrollHeight);this.scroller.setDimensions(e,t,i,o)},registryScroller:function(){var e=this,t=this.mergedOptions.vuescroll.paging,i=this.mergedOptions.vuescroll.snapping.enable,o=!this.refreshLoad&&!t&&!i,s=this.mergedOptions.scrollPanel,l=s.scrollingY,r=s.scrollingX;this.scroller=new Scroller(render(this.scrollPanelElm,window),{zooming:o,scrollingY:l,scrollingX:r&&!this.refreshLoad,animationDuration:this.mergedOptions.scrollPanel.speed,paging:t,snapping:i}),i&&this.scroller.setSnapSize(this.mergedOptions.vuescroll.snapping.width,this.mergedOptions.vuescroll.snapping.height);var a=this.$el.getBoundingClientRect();this.scroller.setPosition(a.left+this.$el.clientLeft,a.top+this.$el.clientTop);var n=listenContainer(this.$el,this.scroller,function(t){switch(t){case"mousedown":e.vuescroll.state.isDragging=!0;break;case"onscroll":e.handleScroll(!1);break;case"mouseup":e.vuescroll.state.isDragging=!1}},o);if(this.mergedOptions.vuescroll.pullRefresh.enable){var c=this.$refs.refreshDom.elm||this.$refs.refreshDom;this.$listeners["refresh-activate"]&&(refreshActivateCallback=function(){e.vuescroll.state.refreshStage="active",e.$emit("refresh-activate",e,c)}),this.$listeners["refresh-before-deactivate"]&&(refreshBeforeDeactivateCallback=function(t){e.vuescroll.state.refreshStage="beforeDeactive",e.$emit("refresh-before-deactivate",e,c,t.bind(e.scroller))}),this.$listeners["refresh-deactivate"]&&(refreshDeactivateCallback=function(){e.vuescroll.state.refreshStage="deactive",e.$emit("refresh-deactivate",e,c)}),this.$listeners["refresh-start"]&&(refreshStartCallback=function(){e.vuescroll.state.refreshStage="start",e.$emit("refresh-start",e,c,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var h=c.scrollHeight;this.scroller.activatePullToRefresh(h,refreshActivateCallback.bind(this),refreshDeactivateCallback.bind(this),refreshStartCallback.bind(this),refreshBeforeDeactivateCallback.bind(this))}if(this.mergedOptions.vuescroll.pushLoad.enable){var d=this.$refs.loadDom.elm||this.$refs.loadDom;this.$listeners["load-activate"]&&(loadActivateCallback=function(){e.vuescroll.state.loadStage="active",e.$emit("load-activate",e,d)}),this.$listeners["load-before-deactivate"]&&(loadBeforeDeactivateCallback=function(t){e.vuescroll.state.loadStage="beforeDeactive",e.$emit("load-before-deactivate",e,d,t.bind(e.scroller))}),this.$listeners["load-deactivate"]&&(loadDeactivateCallback=function(){e.vuescroll.state.loadStage="deactive",e.$emit("load-deactivate",e,d)}),this.$listeners["load-start"]&&(loadStartCallback=function(){e.vuescroll.state.loadStage="start",e.$emit("load-start",e,d,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var _=d.scrollHeight;this.scroller.activatePushToLoad(_,loadActivateCallback.bind(this),loadDeactivateCallback.bind(this),loadStartCallback.bind(this),loadBeforeDeactivateCallback.bind(this))}return this.updateScroller(),n},updateSlideModeBarState:function(){var e,t,i=this.$el,o=this.scroller,s=0,l=0,r=i.clientWidth,a=i.clientHeight,n=r+this.scroller.__maxScrollLeft,c=a+this.scroller.__maxScrollTop,h=ro.__maxScrollLeft&&(s=o.__scrollLeft-o.__maxScrollLeft)),d&&(o.__scrollTop<0?l=-o.__scrollTop:o.__scrollTop>o.__maxScrollTop&&(l=o.__scrollTop-o.__maxScrollTop)),e=100*a/(c+l),t=100*r/(n+s);var _=Math.min(Math.max(0,o.__scrollTop),o.__maxScrollTop),u=Math.min(Math.max(0,o.__scrollLeft),o.__maxScrollLeft);this.bar.vBar.state.posValue=100*(_+l)/i.clientHeight,this.bar.hBar.state.posValue=100*(u+s)/i.clientWidth,o.__scrollLeft<0&&(this.bar.hBar.state.posValue=0),o.__scrollTop<0&&(this.bar.vBar.state.posValue=0),this.bar.vBar.state.size=e<100?e+"%":0,this.bar.hBar.state.size=t<100?t+"%":0}}},_extends=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;"native"==this.mode||"pure-native"==this.mode?this.updateNativeModeBarState():"slide"==this.mode&&this.updateSlideModeBarState(),e&&this.emitEvent(e,t)},updateMode:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{var t=this.vuescroll.state.internalScrollLeft,i=this.vuescroll.state.internalScrollTop;this.destroyScroller&&(this.scroller.stop(),this.destroyScroller(),this.destroyScroller=null),"slide"==this.mode?this.destroyScroller=this.registryScroller():"native"!=this.mode&&"pure-native"!=this.mode||(this.scrollPanelElm.style.transform="",this.scrollPanelElm.style.transformOrigin=""),this.scrollTo({x:t,y:i},!1,!0)}},handleScroll:function(e){this.recordCurrentPos(),this.update("handle-scroll",e),this.showAndDefferedHideBar()},setBarClick:function(e){this.isClickingBar=e},showAndDefferedHideBar:function(){var e=this;this.showBar(),this.vuescroll.state.timeoutId&&clearTimeout(this.vuescroll.state.timeoutId),this.vuescroll.state.timeoutId=setTimeout(function(){e.vuescroll.state.timeoutId=0,e.hideBar()},500)},emitEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.scrollPanelElm,o={type:"vertical"},s={type:"horizontal"},l=i.scrollTop,r=i.scrollLeft;"slide"==this.mode&&(l=this.scroller.__scrollTop,r=this.scroller.__scrollLeft),o.process=l/(i.scrollHeight-i.clientHeight),s.process=r/(i.scrollWidth-i.clientWidth),o.barSize=this.bar.vBar.state.size,s.barSize=this.bar.hBar.state.size,this.$emit(e,o,s,t)},showBar:function(){this.bar.vBar.state.opacity=this.mergedOptions.bar.vBar.opacity,this.bar.hBar.state.opacity=this.mergedOptions.bar.hBar.opacity},hideBar:function(){this.vuescroll.state.isDragging||(this.mergedOptions.bar.vBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.vBar.state.opacity=0),this.mergedOptions.bar.hBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.hBar.state.opacity=0))},registryResize:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{this.destroyResize&&this.destroyResize();var t=null;"slide"==this.mode||"pure-native"==this.mode?t=this.scrollPanelElm:"native"==this.mode&&(t=this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent),window.addEventListener("resize",function(){e.update(),e.showAndDefferedHideBar(),"slide"==e.mode&&e.updateScroller()},!1);var i=[function(){var t={};"slide"==e.mode?(e.updateScroller(),t.width=e.scroller.__contentWidth,t.height=e.scroller.__contentHeight):"native"==e.mode&&(t.width=e.scrollPanelElm.scrollWidth,t.height=e.scrollPanelElm.scrollHeight),e.update("handle-resize",t),e.showAndDefferedHideBar()}];this.destroyResize=listenResize(t,i)}},recordCurrentPos:function(){this.mode!==this.lastMode?(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.lastMode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.lastMode,this).y,this.lastMode=this.mode):(this.vuescroll.state.internalScrollLeft=findValuesByMode(this.mode,this).x,this.vuescroll.state.internalScrollTop=findValuesByMode(this.mode,this).y)},watchChanges:function(){var e=this;this.$watch("mergedOptions",function(){e.recordCurrentPos(),e.$nextTick(function(){e.registryResize(),e.updateMode()})},{deep:!0,sync:!0})},watchSmallChanges:function(){var e=this;uncessaryChangeArray.forEach(function(t){e.$watch(t,function(){e.shouldStop=!0},{sync:!0,deep:!0})})}},mounted:function(){var e=this;this._isDestroyed||this.shouldStopRender||("slide"==this.mode&&(this.destroyScroller=this.registryScroller()),this.lastMode=this.mode,this.registryResize(),this.watchChanges(),this.watchSmallChanges(),this.$nextTick(function(){e.update(),e.showAndDefferedHideBar()}))},updated:function(){var e=this;this.$nextTick(function(){e._isDestroyed||e.showAndDefferedHideBar()})}},scroll={install:function(e){scroll.isInstalled?console.warn("You should not install the vuescroll again!"):(e.component(vuescroll.name,vuescroll),e.prototype.$vuescrollConfig=deepMerge(GCF,{}),scroll.isInstalled=!0,scroll.version="4.5.0")}};export default scroll; \ No newline at end of file diff --git a/dist/vuescroll.js b/dist/vuescroll.js index 2aa47838..8cc402fc 100644 --- a/dist/vuescroll.js +++ b/dist/vuescroll.js @@ -1,5 +1,5 @@ /* - * @name: vuescroll 4.4.9 + * @name: vuescroll 4.5.0 * @author: (c) 2018-2018 wangyi7099 * @description: A reactive virtual scrollbar based on vue.js 2.X * @license: MIT @@ -112,7 +112,6 @@ function getGutter() { /* istanbul ignore next */ if (Vue.prototype.$isServer) return 0; if (scrollBarWidth !== undefined) return scrollBarWidth; - var outer = document.createElement("div"); outer.style.visibility = "hidden"; outer.style.width = "100px"; @@ -122,7 +121,6 @@ function getGutter() { var widthNoScroll = outer.offsetWidth; outer.style.overflow = "scroll"; - var inner = document.createElement("div"); inner.style.width = "100%"; outer.appendChild(inner); @@ -130,9 +128,7 @@ function getGutter() { var widthWithScroll = inner.offsetWidth; outer.parentNode.removeChild(outer); scrollBarWidth = widthNoScroll - widthWithScroll; - getGutter.isUsed = false; - return scrollBarWidth; } @@ -3482,7 +3478,7 @@ var scroll = { // feat: #8 Vue$$1.prototype.$vuescrollConfig = deepMerge(GCF, {}); scroll.isInstalled = true; - scroll.version = "4.4.9"; + scroll.version = "4.5.0"; } }; /* istanbul ignore if */ diff --git a/dist/vuescroll.min.js b/dist/vuescroll.min.js index b6c7b961..107e4921 100644 --- a/dist/vuescroll.min.js +++ b/dist/vuescroll.min.js @@ -1,8 +1,8 @@ /* - * @name: vuescroll 4.4.9 + * @name: vuescroll 4.5.0 * @author: (c) 2018-2018 wangyi7099 * @description: A reactive virtual scrollbar based on vue.js 2.X * @license: MIT * @GitHub: https://github.com/wangyi7099/vuescroll */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):e.vuescroll=t(e.Vue)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={vertical:{bar:{size:"height",opsSize:"width",posName:"top",page:"pageY",scroll:"scrollTop",scrollSize:"scrollHeight",offset:"offsetHeight",client:"clientY"},axis:"Y"},horizontal:{bar:{size:"width",opsSize:"height",posName:"left",page:"pageX",scroll:"scrollLeft",scrollSize:"scrollWidth",offset:"offsetWidth",client:"clientX"},axis:"X"}},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e,t){for(var s in t="object"===(void 0===t?"undefined":i(t))&&t||{},e)t[s]="object"===i(e[s])?o(e[s],t[s]={}):e[s];return t}function s(e,t){for(var l in t=t||{},e)"object"===i(e[l])?void 0===t[l]?(t[l]={},o(e[l],t[l])):s(e[l],t[l]):void 0===t[l]&&(t[l]=e[l]);return t}function l(e,t,i,o){var s=null;(i[t]||"function"==typeof i)&&(o=o||t,"function"==typeof i&&(s=i),Object.defineProperty(e,t,{get:s||function(){return i[o]},configurable:!0}))}var r=void 0;function n(){if(e.prototype.$isServer)return 0;if(void 0!==r)return r;var t=document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);var i=t.offsetWidth;t.style.overflow="scroll";var o=document.createElement("div");o.style.width="100%",t.appendChild(o);var s=o.offsetWidth;return t.parentNode.removeChild(t),r=i-s,n.isUsed=!1,r}var a=!1,c=!1,h=!1;function _(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.addEventListener(t,i,o)}function u(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,i,o)}function p(e,t){var i=null;return"easeInQuad"===e&&(i=t*t),"easeOutQuad"===e&&(i=t*(2-t)),"easeInOutQuad"===e&&(i=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e&&(i=t*t*t),"easeOutCubic"===e&&(i=--t*t*t+1),"easeInOutCubic"===e&&(i=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e&&(i=t*t*t*t),"easeOutQuart"===e&&(i=1- --t*t*t*t),"easeInOutQuart"===e&&(i=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e&&(i=t*t*t*t*t),"easeOutQuint"===e&&(i=1+--t*t*t*t*t),"easeInOutQuint"===e&&(i=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),i||t}function d(e,t){var i={};switch(e){case"native":case"pure-native":i={x:t.scrollPanelElm.scrollLeft,y:t.scrollPanelElm.scrollTop};break;case"slide":i={x:t.scroller.__scrollLeft,y:t.scroller.__scrollTop}}return i}var f=["slide","native","pure-native"],m={vuescroll:{mode:"native",pullRefresh:{enable:!1,tips:{deactive:"Pull to Refresh",active:"Release to Refresh",start:"Refreshing...",beforeDeactive:"Refresh Successfully!"}},pushLoad:{enable:!1,tips:{deactive:"Push to Load",active:"Release to Load",start:"Loading...",beforeDeactive:"Load Successfully!"}},paging:!1,snapping:{enable:!1,width:100,height:100}},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!0,scrollingY:!0,speed:300,easing:void 0},scrollContent:{tag:"div",padding:!0,props:{},attrs:{}},rail:{vRail:{width:"5px",pos:"right",background:"#a5d6a7",opacity:0},hRail:{height:"5px",pos:"bottom",background:"#a5d6a7",opacity:0}},bar:{vBar:{background:"#4caf50",deltaY:100,keepShow:!1,opacity:1,hover:!1},hBar:{background:"#4caf50",keepShow:!1,opacity:1,hover:!1}}};var v={data:function(){return{shouldStopRender:!1}},created:function(){(function(){var e=this;if("vueScroll"===e.$options.name){var t=s(e.$vuescrollConfig,{}),i=s(m,t);e.$options.propsData.ops=e.$options.propsData.ops||{},Object.keys(e.$options.propsData.ops).forEach(function(t){l(e.mergedOptions,t,e.$options.propsData.ops)}),s(i,e.mergedOptions),l(e.mergedOptions.bar.vBar,"pos",e.mergedOptions.rail.vRail),l(e.mergedOptions.bar.vBar,"width",e.mergedOptions.rail.vRail),l(e.mergedOptions.bar.hBar,"pos",e.mergedOptions.rail.hRail),l(e.mergedOptions.bar.hBar,"height",e.mergedOptions.rail.hRail),l(e.mergedOptions.scrollContent,"paddPos",function(){return"padding-"+e.mergedOptions.rail.vRail.pos}),l(e.mergedOptions.scrollContent,"paddValue",function(){return e.mergedOptions.rail.vRail.width})}}).call(this),this.shouldStopRender=function(e){var t=!1,i=e.vuescroll,o=e.scrollPanel;~f.indexOf(i.mode)||(console.error('[vuescroll][ops]: The vuescroll\'s option "mode" should be one of the '+f),t=!0),i.paging==i.snapping.enable&&i.paging&&(i.pullRefresh||i.pushLoad)&&console.error("[vuescroll][ops]: paging, snapping, (pullRefresh with pushLoad) can only one of them to be true.");var s=o.initialScrollY,l=o.initialScrollX;return s&&!String(s).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollY` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),l&&!String(l).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollX` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),t}(this.mergedOptions)}};function g(e,t){var i=void 0;return i=(i=/(-?\d+(?:\.\d+?)?)%$/.exec(e))?t*(i=i[1]-0)/100:e-0}var b={methods:{scrollTo:function(e){var t=e.x,i=e.y,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=void 0===t?this.vuescroll.state.internalScrollLeft:g(t,this.scrollPanelElm.scrollWidth),i=void 0===i?this.vuescroll.state.internalScrollTop:g(i,this.scrollPanelElm.scrollHeight),this.internalScrollTo(t,i,o,s)},scrollBy:function(e){var t=e.dx,i=e.dy,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=this.vuescroll.state,l=s.internalScrollLeft,r=s.internalScrollTop;t&&(l+=g(t,this.scrollPanelElm.scrollWidth)),i&&(r+=g(i,this.scrollPanelElm.scrollHeight)),this.internalScrollTo(l,r,o)},internalScrollTo:function(e,t,i,o){var s,l,r,n,a,c,h,_,u,d;"native"==this.mode||"pure-native"==this.mode?i?(s=this.$refs.scrollPanel.$el,l=e-this.$refs.scrollPanel.$el.scrollLeft,r=t-this.$refs.scrollPanel.$el.scrollTop,n=this.mergedOptions.scrollPanel.speed,a=this.mergedOptions.scrollPanel.easing,c=null,h=null,_=null,u=s.scrollTop,d=s.scrollLeft,u+r<0&&(r=-u),u+r>s.scrollHeight&&(r=s.scrollHeight-u),d+l<0&&(l=-d),d+l>s.scrollWidth&&(l=s.scrollWidth-d),requestAnimationFrame(function e(t){c||(c=t);var i=t-c,o=i/n>1?1:i/n;h=d+l*p(a,o),_=u+r*p(a,o),(Math.abs(_-u)<=Math.abs(r)||Math.abs(h-d)<=Math.abs(l))&&(s.scrollTop=Math.floor(_),s.scrollLeft=Math.floor(h),o<1&&requestAnimationFrame(e))})):(this.$refs.scrollPanel.$el.scrollTop=t,this.$refs.scrollPanel.$el.scrollLeft=e):"slide"==this.mode&&this.scroller.scrollTo(e,t,i,void 0,o)},forceUpdate:function(){var e=this;this.$forceUpdate(),Object.keys(this.$refs).forEach(function(t){var i=e.$refs[t];i._isVue&&i.$forceUpdate()})}}},S=Date.now||function(){return+new Date},y={},x=1,T={effect:{}},L=window;T.effect.Animate={requestAnimationFrame:function(){var e=L.requestAnimationFrame||L.webkitRequestAnimationFrame||L.mozRequestAnimationFrame||L.oRequestAnimationFrame,t=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(t=!1),t)return function(t,i){e(t,i)};var i={},o=1,s=null,l=+new Date;return function(e){var t=o++;return i[t]=e,requestCount++,null===s&&(s=setInterval(function(){var e=+new Date,t=i;for(var o in i={},requestCount=0,t)t.hasOwnProperty(o)&&(t[o](e),l=e);e-l>2500&&(clearInterval(s),s=null)},1e3/60)),t}}(),stop:function(e){var t=null!=y[e];return t&&(y[e]=null),t},isRunning:function(e){return null!=y[e]},start:function(e,t,i,o,s,l){var r=S(),n=r,a=0,c=0,h=x++;if(l||(l=document.body),h%20==0){var _={};for(var u in y)_[u]=!0;y=_}return y[h]=!0,T.effect.Animate.requestAnimationFrame(function _(u){var p=!0!==u,d=S();if(!y[h]||t&&!t(h))return y[h]=null,void(i&&i(60-c/((d-r)/1e3),h,!1));if(p)for(var f=Math.round((d-n)/(1e3/60))-1,m=0;m1&&(a=1);var v=s?s(a):a;!1!==e(v,d,p)&&1!==a||!p?p&&(n=d,T.effect.Animate.requestAnimationFrame(_,l)):(y[h]=null,i&&i(60-c/((d-r)/1e3),h,1===a||null==o))},l),h}};var w=function(){};function D(e){return function(t){return p(e,t)}}var M=null,O=null;function z(e,t){for(var i in this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:w,animatingEasing:"easeOutCubic",noAnimatingEasing:"easeInOutCubic",penetrationDeceleration:.03,penetrationAcceleration:.08},t)this.options[i]=t[i];M=D(this.options.animatingEasing),O=D(this.options.noAnimatingEasing)}var $={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__loadHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshBeforeDeactivate:null,__refreshDeactivate:null,__refreshStart:null,__loadActive:null,__loadActivate:null,__loadBeforeDeactivate:null,__loadDeactivate:null,__loadStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__disable:!1,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(e,t,i,o){e===+e&&(this.__clientWidth=e),t===+t&&(this.__clientHeight=t),i===+i&&(this.__contentWidth=i),o===+o&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(e,t){this.__clientLeft=e||0,this.__clientTop=t||0},setSnapSize:function(e,t){this.__snapWidth=e,this.__snapHeight=t},activatePullToRefresh:function(e,t,i,o,s){this.__refreshHeight=e,this.__refreshActivate=t,this.__refreshBeforeDeactivate=s,this.__refreshDeactivate=i,this.__refreshStart=o},activatePushToLoad:function(e,t,i,o,s){this.__loadHeight=e,this.__loadActivate=t,this.__loadBeforeDeactivate=s,this.__loadDeactivate=i,this.__loadStart=o},triggerRefreshOrLoad:function(){"refresh"==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"refresh")?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart())},finishRefreshOrLoad:function(){var e=this;e.__refreshBeforeDeactivate&&e.__refreshActive?(e.__refreshActive=!1,e.__refreshBeforeDeactivate(function(){e.__refreshDeactivate&&e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__refreshDeactivate&&e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)),e.__loadBeforeDeactivate&&e.__loadActive?(e.__loadActive=!1,e.__loadBeforeDeactivate(function(){e.__loadDeactivate&&e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__loadDeactivate&&e.__loadActive&&(e.__loadActive=!1,e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0))},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(e,t,i,o,s){if(!this.options.zooming)throw new Error("Zooming is not enabled!");s&&(this.__zoomComplete=s),this.__isDecelerating&&(T.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var l=this.__zoomLevel;null==i&&(i=this.__clientWidth/2),null==o&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);var r=(i+this.__scrollLeft)*e/l-i,n=(o+this.__scrollTop)*e/l-o;r>this.__maxScrollLeft?r=this.__maxScrollLeft:r<0&&(r=0),n>this.__maxScrollTop?n=this.__maxScrollTop:n<0&&(n=0),this.__publish(r,n,e,t)},zoomBy:function(e,t,i,o,s){this.zoomTo(this.__zoomLevel*e,t,i,o,s)},scrollTo:function(e,t,i,o,s){if(this.__isDecelerating&&(T.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1),null!=o&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX||s?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY||s?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(i=!1),this.__isTracking||this.__publish(e,t,o,i)},scrollBy:function(e,t,i){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,s=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),s+(t||0),i)},doMouseZoom:function(e,t,i,o){var s=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*s,!1,i-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(e,t){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var i,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(T.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(T.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var s=1===e.length;s?(i=e[0].pageX,o=e[0].pageY):(i=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=i,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=i,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!s&&this.options.scrollingX,this.__enableScrollY=!s&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!s,this.__isSingleTouch=s,this.__positions=[]},doTouchMove:function(e,t,i){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){var o,s;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,s=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,s=e[0].pageY);var l=this.__positions;if(this.__isDragging){var r=o-this.__lastTouchLeft,n=s-this.__lastTouchTop,a=this.__scrollLeft,c=this.__scrollTop,h=this.__zoomLevel;if(null!=i&&this.options.zooming){var _=h;if(h=h/this.__lastScale*i,_!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var u=o-this.__clientLeft,p=s-this.__clientTop;a=(u+a)*h/_-u,c=(p+c)*h/_-p,this.__computeScrollMax(h)}}if(this.__enableScrollX){a-=r*this.options.speedMultiplier;var d=this.__maxScrollLeft;(a>d||a<0)&&(this.options.bouncing?a+=r/2*this.options.speedMultiplier:a=a>d?d:0)}if(this.__enableScrollY){c-=n*this.options.speedMultiplier;var f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?(c+=n/2*this.options.speedMultiplier,this.__enableScrollX||null==this.__refreshHeight&&null==this.__loadHeight||(!this.__refreshActive&&c<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&c>-this.__refreshHeight?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):!this.__loadActive&&c>=this.__maxScrollTop+this.__loadHeight?(this.__loadActive=!0,this.__loadActivate&&this.__loadActivate()):this.__refreshActive&&cf?f:0)}l.length>60&&l.splice(0,30),l.push(a,c,t),this.__publish(a,c,h)}else{var m=this.options.locking?3:0,v=Math.abs(o-this.__initialTouchLeft),g=Math.abs(s-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&v>=m,this.__enableScrollY=this.options.scrollingY&&g>=m,l.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(v>=5||g>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=s,this.__lastTouchMove=t,this.__lastScale=i}},doTouchEnd:function(e){if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){for(var t=this.__positions,i=t.length-1,o=i,s=i;s>0&&t[s]>this.__lastTouchMove-100;s-=3)o=s;if(o!==i){var l=t[i]-t[o],r=this.__scrollLeft-t[o-2],n=this.__scrollTop-t[o-1];this.__decelerationVelocityX=r/l*(1e3/60),this.__decelerationVelocityY=n/l*(1e3/60);var a=this.options.paging||this.options.snapping?4:1;Math.abs(this.__decelerationVelocityX)>a||Math.abs(this.__decelerationVelocityY)>a?this.__refreshActive||this.__loadActive||this.__startDeceleration(e):this.options.scrollingComplete()}else this.options.scrollingComplete()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||(this.__refreshActive&&this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):this.__loadActive&&this.__loadStart?(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart()):((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):this.__loadActive&&(this.__loadActive=!1,this.__loadDeactivate&&this.__loadDeactivate()))),this.__positions.length=0}},onScroll:w,stop:function(){this.__disable=!0},start:function(){self.__disable=!0},__publish:function(e,t,i,o){var s=this;if(!s.__disable){var l=s.__isAnimating;if(l&&(T.effect.Animate.stop(l),s.__isAnimating=!1),o&&s.options.animating){s.__scheduledLeft=e,s.__scheduledTop=t,s.__scheduledZoom=i;var r=s.__scrollLeft,n=s.__scrollTop,a=s.__zoomLevel,c=e-r,h=t-n,_=i-a;s.__isAnimating=T.effect.Animate.start(function(e,t,i){i&&(s.__scrollLeft=r+c*e,s.__scrollTop=n+h*e,s.__zoomLevel=a+_*e,s.__callback&&(s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel),s.onScroll()))},function(e){return s.__isAnimating===e},function(e,t,i){t===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||i)&&s.options.scrollingComplete(),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))},s.options.animationDuration,l?M:O)}else s.__scheduledLeft=s.__scrollLeft=e,s.__scheduledTop=s.__scrollTop=t,s.__scheduledZoom=s.__zoomLevel=i,s.__callback&&(s.__callback(e,t,i),s.onScroll()),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))}},__computeScrollMax:function(e){null==e&&(e=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)},__startDeceleration:function(){var e=this;if(e.options.paging){var t=Math.max(Math.min(e.__scrollLeft,e.__maxScrollLeft),0),i=Math.max(Math.min(e.__scrollTop,e.__maxScrollTop),0),o=e.__clientWidth,s=e.__clientHeight;e.__minDecelerationScrollLeft=Math.floor(t/o)*o,e.__minDecelerationScrollTop=Math.floor(i/s)*s,e.__maxDecelerationScrollLeft=Math.ceil(t/o)*o,e.__maxDecelerationScrollTop=Math.ceil(i/s)*s}else e.__minDecelerationScrollLeft=0,e.__minDecelerationScrollTop=0,e.__maxDecelerationScrollLeft=e.__maxScrollLeft,e.__maxDecelerationScrollTop=e.__maxScrollTop;var l=e.options.snapping?4:.001;e.__isDecelerating=T.effect.Animate.start(function(t,i,o){e.__stepThroughDeceleration(o)},function(){var t=Math.abs(e.__decelerationVelocityX)>=l||Math.abs(e.__decelerationVelocityY)>=l;return t||(e.__didDecelerationComplete=!0),t},function(){e.__isDecelerating=!1,e.__didDecelerationComplete&&e.options.scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,e.options.snapping)})},__stepThroughDeceleration:function(e){var t=this.__scrollLeft+this.__decelerationVelocityX,i=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);var s=Math.max(Math.min(this.__maxDecelerationScrollTop,i),this.__minDecelerationScrollTop);s!==i&&(i=s,this.__decelerationVelocityY=0)}if(e?this.__publish(t,i,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=i),!this.options.paging){this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95}if(this.options.bouncing){var l=0,r=0,n=this.options.penetrationDeceleration,a=this.options.penetrationAcceleration;tthis.__maxDecelerationScrollLeft&&(l=this.__maxDecelerationScrollLeft-t),ithis.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-i),0!==l&&(l*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=l*n:this.__decelerationVelocityX=l*a),0!==r&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*n:this.__decelerationVelocityY=r*a)}}};for(var B in $)z.prototype[B]=$[B];var A=function(){this.vuescroll.state.refreshStage="active"},k=function(){var e=this;e.vuescroll.state.refreshStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},C=function(e){this.vuescroll.state.refreshStage="beforeDeactive",setTimeout(function(){e()},500)},P=function(){this.vuescroll.state.refreshStage="deactive"},E=function(){this.vuescroll.state.loadStage="active"},H=function(){var e=this;e.vuescroll.state.loadStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},R=function(e){this.vuescroll.state.loadStage="beforeDeactive",setTimeout(function(){e()},500)},X=function(){this.vuescroll.state.loadStage="deactive"},Y={methods:{updateScroller:function(){var e=this.$el.clientWidth,t=this.$el.clientHeight,i=this.scrollPanelElm.scrollWidth,o=this.scrollPanelElm.scrollHeight,s=0;if(this.mergedOptions.vuescroll.pullRefresh.enable){var l=this.$refs.refreshDom.elm||this.$refs.refreshDom;s=l.scrollHeight,l.style.marginTop||(l.style.marginTop=-s+"px",o-=s)}this.mergedOptions.vuescroll.pushLoad.enable&&(o-=(this.$refs.loadDom.elm||this.$refs.loadDom).scrollHeight);this.scroller.setDimensions(e,t,i,o)},registryScroller:function(){var e=this,t=this.mergedOptions.vuescroll.paging,i=this.mergedOptions.vuescroll.snapping.enable,o=!this.refreshLoad&&!t&&!i,s=this.mergedOptions.scrollPanel,l=s.scrollingY,r=s.scrollingX;this.scroller=new z(function(e,t){var i,o=document.documentElement.style;t.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?i="presto":"MozAppearance"in o?i="gecko":"WebkitAppearance"in o?i="webkit":"string"==typeof navigator.cpuClass&&(i="trident");var s={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[i],l=document.createElement("div"),r=s+"Perspective",n=s+"Transform";return void 0!==l.style[r]?function(t,i,o){e.style[n]="translate3d("+-t+"px,"+-i+"px,0) scale("+o+")"}:void 0!==l.style[n]?function(t,i,o){e.style[n]="translate("+-t+"px,"+-i+"px) scale("+o+")"}:function(t,i,o){e.style.marginLeft=t?-t/o+"px":"",e.style.marginTop=i?-i/o+"px":"",e.style.zoom=o||""}}(this.scrollPanelElm,window),{zooming:o,scrollingY:l,scrollingX:r&&!this.refreshLoad,animationDuration:this.mergedOptions.scrollPanel.speed,paging:t,snapping:i}),i&&this.scroller.setSnapSize(this.mergedOptions.vuescroll.snapping.width,this.mergedOptions.vuescroll.snapping.height);var n=this.$el.getBoundingClientRect();this.scroller.setPosition(n.left+this.$el.clientLeft,n.top+this.$el.clientTop);var a=function(e,t,i,o){var s=null;function l(e){e.touches[0]&&e.touches[0].target&&e.touches[0].target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart(e.touches,e.timeStamp),e.preventDefault())}function r(e){i("mousemove"),t.doTouchMove(e.touches,e.timeStamp,e.scale)}function n(e){i("mouseup"),t.doTouchEnd(e.timeStamp)}function a(e){t.doTouchEnd(e.timeStamp)}function c(e){e.target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),p=!0)}function h(e){p&&(i("mousemove"),t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),p=!0)}function _(e){p&&(i("mouseup"),t.doTouchEnd(e.timeStamp),p=!1)}function u(e){t.doMouseZoom(e.detail?-120*e.detail:e.wheelDelta,e.timeStamp,e.pageX,e.pageY)}if("ontouchstart"in window)e.addEventListener("touchstart",l,!1),document.addEventListener("touchmove",r,!1),document.addEventListener("touchend",n,!1),document.addEventListener("touchcancel",a,!1),s=function(){e.removeEventListener("touchstart",l,!1),document.removeEventListener("touchmove",r,!1),document.removeEventListener("touchend",n,!1),document.removeEventListener("touchcancel",a,!1)};else{var p=!1;e.addEventListener("mousedown",c,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",_,!1),o&&e.addEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",u,!1),s=function(){e.removeEventListener("mousedown",c,!1),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",_,!1),e.removeEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",u,!1)}}return t.onScroll=function(){i("onscroll")},s}(this.$el,this.scroller,function(t){switch(t){case"mousedown":e.vuescroll.state.isDragging=!0;break;case"onscroll":e.handleScroll(!1);break;case"mouseup":e.vuescroll.state.isDragging=!1}},o);if(this.mergedOptions.vuescroll.pullRefresh.enable){var c=this.$refs.refreshDom.elm||this.$refs.refreshDom;this.$listeners["refresh-activate"]&&(A=function(){e.vuescroll.state.refreshStage="active",e.$emit("refresh-activate",e,c)}),this.$listeners["refresh-before-deactivate"]&&(C=function(t){e.vuescroll.state.refreshStage="beforeDeactive",e.$emit("refresh-before-deactivate",e,c,t.bind(e.scroller))}),this.$listeners["refresh-deactivate"]&&(P=function(){e.vuescroll.state.refreshStage="deactive",e.$emit("refresh-deactivate",e,c)}),this.$listeners["refresh-start"]&&(k=function(){e.vuescroll.state.refreshStage="start",e.$emit("refresh-start",e,c,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var h=c.scrollHeight;this.scroller.activatePullToRefresh(h,A.bind(this),P.bind(this),k.bind(this),C.bind(this))}if(this.mergedOptions.vuescroll.pushLoad.enable){var _=this.$refs.loadDom.elm||this.$refs.loadDom;this.$listeners["load-activate"]&&(E=function(){e.vuescroll.state.loadStage="active",e.$emit("load-activate",e,_)}),this.$listeners["load-before-deactivate"]&&(R=function(t){e.vuescroll.state.loadStage="beforeDeactive",e.$emit("load-before-deactivate",e,_,t.bind(e.scroller))}),this.$listeners["load-deactivate"]&&(X=function(){e.vuescroll.state.loadStage="deactive",e.$emit("load-deactivate",e,_)}),this.$listeners["load-start"]&&(H=function(){e.vuescroll.state.loadStage="start",e.$emit("load-start",e,_,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var u=_.scrollHeight;this.scroller.activatePushToLoad(u,E.bind(this),X.bind(this),H.bind(this),R.bind(this))}return this.updateScroller(),a},updateSlideModeBarState:function(){var e,t,i=this.$el,o=this.scroller,s=0,l=0,r=i.clientWidth,n=i.clientHeight,a=r+this.scroller.__maxScrollLeft,c=n+this.scroller.__maxScrollTop,h=ro.__maxScrollLeft&&(s=o.__scrollLeft-o.__maxScrollLeft)),_&&(o.__scrollTop<0?l=-o.__scrollTop:o.__scrollTop>o.__maxScrollTop&&(l=o.__scrollTop-o.__maxScrollTop)),e=100*n/(c+l),t=100*r/(a+s);var u=Math.min(Math.max(0,o.__scrollTop),o.__maxScrollTop),p=Math.min(Math.max(0,o.__scrollLeft),o.__maxScrollLeft);this.bar.vBar.state.posValue=100*(u+l)/i.clientHeight,this.bar.hBar.state.posValue=100*(p+s)/i.clientWidth,o.__scrollLeft<0&&(this.bar.hBar.state.posValue=0),o.__scrollTop<0&&(this.bar.vBar.state.posValue=0),this.bar.vBar.state.size=e<100?e+"%":0,this.bar.hBar.state.size=t<100?t+"%":0}}},V=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;"native"==this.mode||"pure-native"==this.mode?this.updateNativeModeBarState():"slide"==this.mode&&this.updateSlideModeBarState(),e&&this.emitEvent(e,t)},updateMode:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{var t=this.vuescroll.state.internalScrollLeft,i=this.vuescroll.state.internalScrollTop;this.destroyScroller&&(this.scroller.stop(),this.destroyScroller(),this.destroyScroller=null),"slide"==this.mode?this.destroyScroller=this.registryScroller():"native"!=this.mode&&"pure-native"!=this.mode||(this.scrollPanelElm.style.transform="",this.scrollPanelElm.style.transformOrigin=""),this.scrollTo({x:t,y:i},!1,!0)}},handleScroll:function(e){this.recordCurrentPos(),this.update("handle-scroll",e),this.showAndDefferedHideBar()},setBarClick:function(e){this.isClickingBar=e},showAndDefferedHideBar:function(){var e=this;this.showBar(),this.vuescroll.state.timeoutId&&clearTimeout(this.vuescroll.state.timeoutId),this.vuescroll.state.timeoutId=setTimeout(function(){e.vuescroll.state.timeoutId=0,e.hideBar()},500)},emitEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.scrollPanelElm,o={type:"vertical"},s={type:"horizontal"},l=i.scrollTop,r=i.scrollLeft;"slide"==this.mode&&(l=this.scroller.__scrollTop,r=this.scroller.__scrollLeft),o.process=l/(i.scrollHeight-i.clientHeight),s.process=r/(i.scrollWidth-i.clientWidth),o.barSize=this.bar.vBar.state.size,s.barSize=this.bar.hBar.state.size,this.$emit(e,o,s,t)},showBar:function(){this.bar.vBar.state.opacity=this.mergedOptions.bar.vBar.opacity,this.bar.hBar.state.opacity=this.mergedOptions.bar.hBar.opacity},hideBar:function(){this.vuescroll.state.isDragging||(this.mergedOptions.bar.vBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.vBar.state.opacity=0),this.mergedOptions.bar.hBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.hBar.state.opacity=0))},registryResize:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{this.destroyResize&&this.destroyResize();var t=null;"slide"==this.mode||"pure-native"==this.mode?t=this.scrollPanelElm:"native"==this.mode&&(t=this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent),window.addEventListener("resize",function(){e.update(),e.showAndDefferedHideBar(),"slide"==e.mode&&e.updateScroller()},!1);var i,o,s,l=[function(){var t={};"slide"==e.mode?(e.updateScroller(),t.width=e.scroller.__contentWidth,t.height=e.scroller.__contentHeight):"native"==e.mode&&(t.width=e.scrollPanelElm.scrollWidth,t.height=e.scrollPanelElm.scrollHeight),e.update("handle-resize",t),e.showAndDefferedHideBar()}];this.destroyResize=(i=t,o=l,(s=document.createElement("object")).style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",s.tabIndex=-1,s.type="text/html",s.onload=function(){o.forEach(function(e){_(s.contentDocument.defaultView,"resize",e)})},i.appendChild(s),function(){s.contentDocument&&o.forEach(function(e){u(s.contentDocument.defaultView,"resize",e)}),i.removeChild(s)})}},recordCurrentPos:function(){this.mode!==this.lastMode?(this.vuescroll.state.internalScrollLeft=d(this.lastMode,this).x,this.vuescroll.state.internalScrollTop=d(this.lastMode,this).y,this.lastMode=this.mode):(this.vuescroll.state.internalScrollLeft=d(this.mode,this).x,this.vuescroll.state.internalScrollTop=d(this.mode,this).y)},watchChanges:function(){var e=this;this.$watch("mergedOptions",function(){e.recordCurrentPos(),e.$nextTick(function(){e.registryResize(),e.updateMode()})},{deep:!0,sync:!0})},watchSmallChanges:function(){var e=this;F.forEach(function(t){e.$watch(t,function(){e.shouldStop=!0},{sync:!0,deep:!0})})}},mounted:function(){var e=this;this._isDestroyed||this.shouldStopRender||("slide"==this.mode&&(this.destroyScroller=this.registryScroller()),this.lastMode=this.mode,this.registryResize(),this.watchChanges(),this.watchSmallChanges(),this.$nextTick(function(){e.update(),e.showAndDefferedHideBar()}))},updated:function(){var e=this;this.$nextTick(function(){e._isDestroyed||e.showAndDefferedHideBar()})}},Q={install:function(e){Q.isInstalled?console.warn("You should not install the vuescroll again!"):(e.component(Z.name,Z),e.prototype.$vuescrollConfig=s(m,{}),Q.isInstalled=!0,Q.version="4.4.9")}};return void 0!==e&&e.use(Q),Q}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):e.vuescroll=t(e.Vue)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={vertical:{bar:{size:"height",opsSize:"width",posName:"top",page:"pageY",scroll:"scrollTop",scrollSize:"scrollHeight",offset:"offsetHeight",client:"clientY"},axis:"Y"},horizontal:{bar:{size:"width",opsSize:"height",posName:"left",page:"pageX",scroll:"scrollLeft",scrollSize:"scrollWidth",offset:"offsetWidth",client:"clientX"},axis:"X"}},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e,t){for(var s in t="object"===(void 0===t?"undefined":i(t))&&t||{},e)t[s]="object"===i(e[s])?o(e[s],t[s]={}):e[s];return t}function s(e,t){for(var l in t=t||{},e)"object"===i(e[l])?void 0===t[l]?(t[l]={},o(e[l],t[l])):s(e[l],t[l]):void 0===t[l]&&(t[l]=e[l]);return t}function l(e,t,i,o){var s=null;(i[t]||"function"==typeof i)&&(o=o||t,"function"==typeof i&&(s=i),Object.defineProperty(e,t,{get:s||function(){return i[o]},configurable:!0}))}var r=void 0;function n(){if(e.prototype.$isServer)return 0;if(void 0!==r)return r;var t=document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);var i=t.offsetWidth;t.style.overflow="scroll";var o=document.createElement("div");o.style.width="100%",t.appendChild(o);var s=o.offsetWidth;return t.parentNode.removeChild(t),r=i-s,n.isUsed=!1,r}var a=!1,c=!1,h=!1;function _(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.addEventListener(t,i,o)}function u(e,t,i){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,i,o)}function p(e,t){var i=null;return"easeInQuad"===e&&(i=t*t),"easeOutQuad"===e&&(i=t*(2-t)),"easeInOutQuad"===e&&(i=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e&&(i=t*t*t),"easeOutCubic"===e&&(i=--t*t*t+1),"easeInOutCubic"===e&&(i=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e&&(i=t*t*t*t),"easeOutQuart"===e&&(i=1- --t*t*t*t),"easeInOutQuart"===e&&(i=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e&&(i=t*t*t*t*t),"easeOutQuint"===e&&(i=1+--t*t*t*t*t),"easeInOutQuint"===e&&(i=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),i||t}function d(e,t){var i={};switch(e){case"native":case"pure-native":i={x:t.scrollPanelElm.scrollLeft,y:t.scrollPanelElm.scrollTop};break;case"slide":i={x:t.scroller.__scrollLeft,y:t.scroller.__scrollTop}}return i}var f=["slide","native","pure-native"],m={vuescroll:{mode:"native",pullRefresh:{enable:!1,tips:{deactive:"Pull to Refresh",active:"Release to Refresh",start:"Refreshing...",beforeDeactive:"Refresh Successfully!"}},pushLoad:{enable:!1,tips:{deactive:"Push to Load",active:"Release to Load",start:"Loading...",beforeDeactive:"Load Successfully!"}},paging:!1,snapping:{enable:!1,width:100,height:100}},scrollPanel:{initialScrollY:!1,initialScrollX:!1,scrollingX:!0,scrollingY:!0,speed:300,easing:void 0},scrollContent:{tag:"div",padding:!0,props:{},attrs:{}},rail:{vRail:{width:"5px",pos:"right",background:"#a5d6a7",opacity:0},hRail:{height:"5px",pos:"bottom",background:"#a5d6a7",opacity:0}},bar:{vBar:{background:"#4caf50",deltaY:100,keepShow:!1,opacity:1,hover:!1},hBar:{background:"#4caf50",keepShow:!1,opacity:1,hover:!1}}};var v={data:function(){return{shouldStopRender:!1}},created:function(){(function(){var e=this;if("vueScroll"===e.$options.name){var t=s(e.$vuescrollConfig,{}),i=s(m,t);e.$options.propsData.ops=e.$options.propsData.ops||{},Object.keys(e.$options.propsData.ops).forEach(function(t){l(e.mergedOptions,t,e.$options.propsData.ops)}),s(i,e.mergedOptions),l(e.mergedOptions.bar.vBar,"pos",e.mergedOptions.rail.vRail),l(e.mergedOptions.bar.vBar,"width",e.mergedOptions.rail.vRail),l(e.mergedOptions.bar.hBar,"pos",e.mergedOptions.rail.hRail),l(e.mergedOptions.bar.hBar,"height",e.mergedOptions.rail.hRail),l(e.mergedOptions.scrollContent,"paddPos",function(){return"padding-"+e.mergedOptions.rail.vRail.pos}),l(e.mergedOptions.scrollContent,"paddValue",function(){return e.mergedOptions.rail.vRail.width})}}).call(this),this.shouldStopRender=function(e){var t=!1,i=e.vuescroll,o=e.scrollPanel;~f.indexOf(i.mode)||(console.error('[vuescroll][ops]: The vuescroll\'s option "mode" should be one of the '+f),t=!0),i.paging==i.snapping.enable&&i.paging&&(i.pullRefresh||i.pushLoad)&&console.error("[vuescroll][ops]: paging, snapping, (pullRefresh with pushLoad) can only one of them to be true.");var s=o.initialScrollY,l=o.initialScrollX;return s&&!String(s).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollY` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),l&&!String(l).match(/^\d+(\.\d+)?(%)?$/)&&console.error("[vuescroll][ops]: The prop `initialScrollX` should be a percent number like 10% or an exact number that greater than or equal to 0 like 100."),t}(this.mergedOptions)}};function g(e,t){var i=void 0;return i=(i=/(-?\d+(?:\.\d+?)?)%$/.exec(e))?t*(i=i[1]-0)/100:e-0}var b={methods:{scrollTo:function(e){var t=e.x,i=e.y,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=void 0===t?this.vuescroll.state.internalScrollLeft:g(t,this.scrollPanelElm.scrollWidth),i=void 0===i?this.vuescroll.state.internalScrollTop:g(i,this.scrollPanelElm.scrollHeight),this.internalScrollTo(t,i,o,s)},scrollBy:function(e){var t=e.dx,i=e.dy,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=this.vuescroll.state,l=s.internalScrollLeft,r=s.internalScrollTop;t&&(l+=g(t,this.scrollPanelElm.scrollWidth)),i&&(r+=g(i,this.scrollPanelElm.scrollHeight)),this.internalScrollTo(l,r,o)},internalScrollTo:function(e,t,i,o){var s,l,r,n,a,c,h,_,u,d;"native"==this.mode||"pure-native"==this.mode?i?(s=this.$refs.scrollPanel.$el,l=e-this.$refs.scrollPanel.$el.scrollLeft,r=t-this.$refs.scrollPanel.$el.scrollTop,n=this.mergedOptions.scrollPanel.speed,a=this.mergedOptions.scrollPanel.easing,c=null,h=null,_=null,u=s.scrollTop,d=s.scrollLeft,u+r<0&&(r=-u),u+r>s.scrollHeight&&(r=s.scrollHeight-u),d+l<0&&(l=-d),d+l>s.scrollWidth&&(l=s.scrollWidth-d),requestAnimationFrame(function e(t){c||(c=t);var i=t-c,o=i/n>1?1:i/n;h=d+l*p(a,o),_=u+r*p(a,o),(Math.abs(_-u)<=Math.abs(r)||Math.abs(h-d)<=Math.abs(l))&&(s.scrollTop=Math.floor(_),s.scrollLeft=Math.floor(h),o<1&&requestAnimationFrame(e))})):(this.$refs.scrollPanel.$el.scrollTop=t,this.$refs.scrollPanel.$el.scrollLeft=e):"slide"==this.mode&&this.scroller.scrollTo(e,t,i,void 0,o)},forceUpdate:function(){var e=this;this.$forceUpdate(),Object.keys(this.$refs).forEach(function(t){var i=e.$refs[t];i._isVue&&i.$forceUpdate()})}}},S=Date.now||function(){return+new Date},y={},x=1,T={effect:{}},L=window;T.effect.Animate={requestAnimationFrame:function(){var e=L.requestAnimationFrame||L.webkitRequestAnimationFrame||L.mozRequestAnimationFrame||L.oRequestAnimationFrame,t=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(t=!1),t)return function(t,i){e(t,i)};var i={},o=1,s=null,l=+new Date;return function(e){var t=o++;return i[t]=e,requestCount++,null===s&&(s=setInterval(function(){var e=+new Date,t=i;for(var o in i={},requestCount=0,t)t.hasOwnProperty(o)&&(t[o](e),l=e);e-l>2500&&(clearInterval(s),s=null)},1e3/60)),t}}(),stop:function(e){var t=null!=y[e];return t&&(y[e]=null),t},isRunning:function(e){return null!=y[e]},start:function(e,t,i,o,s,l){var r=S(),n=r,a=0,c=0,h=x++;if(l||(l=document.body),h%20==0){var _={};for(var u in y)_[u]=!0;y=_}return y[h]=!0,T.effect.Animate.requestAnimationFrame(function _(u){var p=!0!==u,d=S();if(!y[h]||t&&!t(h))return y[h]=null,void(i&&i(60-c/((d-r)/1e3),h,!1));if(p)for(var f=Math.round((d-n)/(1e3/60))-1,m=0;m1&&(a=1);var v=s?s(a):a;!1!==e(v,d,p)&&1!==a||!p?p&&(n=d,T.effect.Animate.requestAnimationFrame(_,l)):(y[h]=null,i&&i(60-c/((d-r)/1e3),h,1===a||null==o))},l),h}};var w=function(){};function D(e){return function(t){return p(e,t)}}var M=null,O=null;function z(e,t){for(var i in this.__callback=e,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:w,animatingEasing:"easeOutCubic",noAnimatingEasing:"easeInOutCubic",penetrationDeceleration:.03,penetrationAcceleration:.08},t)this.options[i]=t[i];M=D(this.options.animatingEasing),O=D(this.options.noAnimatingEasing)}var $={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__loadHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshBeforeDeactivate:null,__refreshDeactivate:null,__refreshStart:null,__loadActive:null,__loadActivate:null,__loadBeforeDeactivate:null,__loadDeactivate:null,__loadStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__disable:!1,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(e,t,i,o){e===+e&&(this.__clientWidth=e),t===+t&&(this.__clientHeight=t),i===+i&&(this.__contentWidth=i),o===+o&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(e,t){this.__clientLeft=e||0,this.__clientTop=t||0},setSnapSize:function(e,t){this.__snapWidth=e,this.__snapHeight=t},activatePullToRefresh:function(e,t,i,o,s){this.__refreshHeight=e,this.__refreshActivate=t,this.__refreshBeforeDeactivate=s,this.__refreshDeactivate=i,this.__refreshStart=o},activatePushToLoad:function(e,t,i,o,s){this.__loadHeight=e,this.__loadActivate=t,this.__loadBeforeDeactivate=s,this.__loadDeactivate=i,this.__loadStart=o},triggerRefreshOrLoad:function(){"refresh"==(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"refresh")?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart())},finishRefreshOrLoad:function(){var e=this;e.__refreshBeforeDeactivate&&e.__refreshActive?(e.__refreshActive=!1,e.__refreshBeforeDeactivate(function(){e.__refreshDeactivate&&e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__refreshDeactivate&&e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)),e.__loadBeforeDeactivate&&e.__loadActive?(e.__loadActive=!1,e.__loadBeforeDeactivate(function(){e.__loadDeactivate&&e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)})):e.__loadDeactivate&&e.__loadActive&&(e.__loadActive=!1,e.__loadDeactivate(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0))},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(e,t,i,o,s){if(!this.options.zooming)throw new Error("Zooming is not enabled!");s&&(this.__zoomComplete=s),this.__isDecelerating&&(T.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1);var l=this.__zoomLevel;null==i&&(i=this.__clientWidth/2),null==o&&(o=this.__clientHeight/2),e=Math.max(Math.min(e,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(e);var r=(i+this.__scrollLeft)*e/l-i,n=(o+this.__scrollTop)*e/l-o;r>this.__maxScrollLeft?r=this.__maxScrollLeft:r<0&&(r=0),n>this.__maxScrollTop?n=this.__maxScrollTop:n<0&&(n=0),this.__publish(r,n,e,t)},zoomBy:function(e,t,i,o,s){this.zoomTo(this.__zoomLevel*e,t,i,o,s)},scrollTo:function(e,t,i,o,s){if(this.__isDecelerating&&(T.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1),null!=o&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");e*=o,t*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX||s?this.options.paging?e=Math.round(e/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(e=Math.round(e/this.__snapWidth)*this.__snapWidth):e=this.__scrollLeft,this.options.scrollingY||s?this.options.paging?t=Math.round(t/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(t=Math.round(t/this.__snapHeight)*this.__snapHeight):t=this.__scrollTop,e=Math.max(Math.min(this.__maxScrollLeft,e),0),t=Math.max(Math.min(this.__maxScrollTop,t),0),e===this.__scrollLeft&&t===this.__scrollTop&&(i=!1),this.__isTracking||this.__publish(e,t,o,i)},scrollBy:function(e,t,i){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,s=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(e||0),s+(t||0),i)},doMouseZoom:function(e,t,i,o){var s=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*s,!1,i-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(e,t){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var i,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(T.effect.Animate.stop(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(T.effect.Animate.stop(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var s=1===e.length;s?(i=e[0].pageX,o=e[0].pageY):(i=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),this.__initialTouchLeft=i,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=i,this.__lastTouchTop=o,this.__lastTouchMove=t,this.__lastScale=1,this.__enableScrollX=!s&&this.options.scrollingX,this.__enableScrollY=!s&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!s,this.__isSingleTouch=s,this.__positions=[]},doTouchMove:function(e,t,i){if(null==e.length)throw new Error("Invalid touch list: "+e);if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){var o,s;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,s=Math.abs(e[0].pageY+e[1].pageY)/2):(o=e[0].pageX,s=e[0].pageY);var l=this.__positions;if(this.__isDragging){var r=o-this.__lastTouchLeft,n=s-this.__lastTouchTop,a=this.__scrollLeft,c=this.__scrollTop,h=this.__zoomLevel;if(null!=i&&this.options.zooming){var _=h;if(h=h/this.__lastScale*i,_!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var u=o-this.__clientLeft,p=s-this.__clientTop;a=(u+a)*h/_-u,c=(p+c)*h/_-p,this.__computeScrollMax(h)}}if(this.__enableScrollX){a-=r*this.options.speedMultiplier;var d=this.__maxScrollLeft;(a>d||a<0)&&(this.options.bouncing?a+=r/2*this.options.speedMultiplier:a=a>d?d:0)}if(this.__enableScrollY){c-=n*this.options.speedMultiplier;var f=this.__maxScrollTop;(c>f||c<0)&&(this.options.bouncing?(c+=n/2*this.options.speedMultiplier,this.__enableScrollX||null==this.__refreshHeight&&null==this.__loadHeight||(!this.__refreshActive&&c<=-this.__refreshHeight?(this.__refreshActive=!0,this.__refreshActivate&&this.__refreshActivate()):this.__refreshActive&&c>-this.__refreshHeight?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):!this.__loadActive&&c>=this.__maxScrollTop+this.__loadHeight?(this.__loadActive=!0,this.__loadActivate&&this.__loadActivate()):this.__refreshActive&&cf?f:0)}l.length>60&&l.splice(0,30),l.push(a,c,t),this.__publish(a,c,h)}else{var m=this.options.locking?3:0,v=Math.abs(o-this.__initialTouchLeft),g=Math.abs(s-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&v>=m,this.__enableScrollY=this.options.scrollingY&&g>=m,l.push(this.__scrollLeft,this.__scrollTop,t),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(v>=5||g>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=s,this.__lastTouchMove=t,this.__lastScale=i}},doTouchEnd:function(e){if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&e-this.__lastTouchMove<=100){for(var t=this.__positions,i=t.length-1,o=i,s=i;s>0&&t[s]>this.__lastTouchMove-100;s-=3)o=s;if(o!==i){var l=t[i]-t[o],r=this.__scrollLeft-t[o-2],n=this.__scrollTop-t[o-1];this.__decelerationVelocityX=r/l*(1e3/60),this.__decelerationVelocityY=n/l*(1e3/60);var a=this.options.paging||this.options.snapping?4:1;Math.abs(this.__decelerationVelocityX)>a||Math.abs(this.__decelerationVelocityY)>a?this.__refreshActive||this.__loadActive||this.__startDeceleration(e):this.options.scrollingComplete()}else this.options.scrollingComplete()}else e-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||(this.__refreshActive&&this.__refreshStart?(this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()):this.__loadActive&&this.__loadStart?(this.__publish(this.__scrollLeft,this.__maxScrollTop+this.__loadHeight,this.__zoomLevel,!0),this.__loadStart&&this.__loadStart()):((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel),this.__refreshActive?(this.__refreshActive=!1,this.__refreshDeactivate&&this.__refreshDeactivate()):this.__loadActive&&(this.__loadActive=!1,this.__loadDeactivate&&this.__loadDeactivate()))),this.__positions.length=0}},onScroll:w,stop:function(){this.__disable=!0},start:function(){self.__disable=!0},__publish:function(e,t,i,o){var s=this;if(!s.__disable){var l=s.__isAnimating;if(l&&(T.effect.Animate.stop(l),s.__isAnimating=!1),o&&s.options.animating){s.__scheduledLeft=e,s.__scheduledTop=t,s.__scheduledZoom=i;var r=s.__scrollLeft,n=s.__scrollTop,a=s.__zoomLevel,c=e-r,h=t-n,_=i-a;s.__isAnimating=T.effect.Animate.start(function(e,t,i){i&&(s.__scrollLeft=r+c*e,s.__scrollTop=n+h*e,s.__zoomLevel=a+_*e,s.__callback&&(s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel),s.onScroll()))},function(e){return s.__isAnimating===e},function(e,t,i){t===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||i)&&s.options.scrollingComplete(),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))},s.options.animationDuration,l?M:O)}else s.__scheduledLeft=s.__scrollLeft=e,s.__scheduledTop=s.__scrollTop=t,s.__scheduledZoom=s.__zoomLevel=i,s.__callback&&(s.__callback(e,t,i),s.onScroll()),s.options.zooming&&(s.__computeScrollMax(),s.__zoomComplete&&(s.__zoomComplete(),s.__zoomComplete=null))}},__computeScrollMax:function(e){null==e&&(e=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*e-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*e-this.__clientHeight,0)},__startDeceleration:function(){var e=this;if(e.options.paging){var t=Math.max(Math.min(e.__scrollLeft,e.__maxScrollLeft),0),i=Math.max(Math.min(e.__scrollTop,e.__maxScrollTop),0),o=e.__clientWidth,s=e.__clientHeight;e.__minDecelerationScrollLeft=Math.floor(t/o)*o,e.__minDecelerationScrollTop=Math.floor(i/s)*s,e.__maxDecelerationScrollLeft=Math.ceil(t/o)*o,e.__maxDecelerationScrollTop=Math.ceil(i/s)*s}else e.__minDecelerationScrollLeft=0,e.__minDecelerationScrollTop=0,e.__maxDecelerationScrollLeft=e.__maxScrollLeft,e.__maxDecelerationScrollTop=e.__maxScrollTop;var l=e.options.snapping?4:.001;e.__isDecelerating=T.effect.Animate.start(function(t,i,o){e.__stepThroughDeceleration(o)},function(){var t=Math.abs(e.__decelerationVelocityX)>=l||Math.abs(e.__decelerationVelocityY)>=l;return t||(e.__didDecelerationComplete=!0),t},function(){e.__isDecelerating=!1,e.__didDecelerationComplete&&e.options.scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,e.options.snapping)})},__stepThroughDeceleration:function(e){var t=this.__scrollLeft+this.__decelerationVelocityX,i=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,t),this.__minDecelerationScrollLeft);o!==t&&(t=o,this.__decelerationVelocityX=0);var s=Math.max(Math.min(this.__maxDecelerationScrollTop,i),this.__minDecelerationScrollTop);s!==i&&(i=s,this.__decelerationVelocityY=0)}if(e?this.__publish(t,i,this.__zoomLevel):(this.__scrollLeft=t,this.__scrollTop=i),!this.options.paging){this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95}if(this.options.bouncing){var l=0,r=0,n=this.options.penetrationDeceleration,a=this.options.penetrationAcceleration;tthis.__maxDecelerationScrollLeft&&(l=this.__maxDecelerationScrollLeft-t),ithis.__maxDecelerationScrollTop&&(r=this.__maxDecelerationScrollTop-i),0!==l&&(l*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=l*n:this.__decelerationVelocityX=l*a),0!==r&&(r*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=r*n:this.__decelerationVelocityY=r*a)}}};for(var B in $)z.prototype[B]=$[B];var A=function(){this.vuescroll.state.refreshStage="active"},k=function(){var e=this;e.vuescroll.state.refreshStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},C=function(e){this.vuescroll.state.refreshStage="beforeDeactive",setTimeout(function(){e()},500)},P=function(){this.vuescroll.state.refreshStage="deactive"},E=function(){this.vuescroll.state.loadStage="active"},H=function(){var e=this;e.vuescroll.state.loadStage="start",setTimeout(function(){e.scroller.finishRefreshOrLoad()},2e3)},R=function(e){this.vuescroll.state.loadStage="beforeDeactive",setTimeout(function(){e()},500)},X=function(){this.vuescroll.state.loadStage="deactive"},Y={methods:{updateScroller:function(){var e=this.$el.clientWidth,t=this.$el.clientHeight,i=this.scrollPanelElm.scrollWidth,o=this.scrollPanelElm.scrollHeight,s=0;if(this.mergedOptions.vuescroll.pullRefresh.enable){var l=this.$refs.refreshDom.elm||this.$refs.refreshDom;s=l.scrollHeight,l.style.marginTop||(l.style.marginTop=-s+"px",o-=s)}this.mergedOptions.vuescroll.pushLoad.enable&&(o-=(this.$refs.loadDom.elm||this.$refs.loadDom).scrollHeight);this.scroller.setDimensions(e,t,i,o)},registryScroller:function(){var e=this,t=this.mergedOptions.vuescroll.paging,i=this.mergedOptions.vuescroll.snapping.enable,o=!this.refreshLoad&&!t&&!i,s=this.mergedOptions.scrollPanel,l=s.scrollingY,r=s.scrollingX;this.scroller=new z(function(e,t){var i,o=document.documentElement.style;t.opera&&"[object Opera]"===Object.prototype.toString.call(opera)?i="presto":"MozAppearance"in o?i="gecko":"WebkitAppearance"in o?i="webkit":"string"==typeof navigator.cpuClass&&(i="trident");var s={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[i],l=document.createElement("div"),r=s+"Perspective",n=s+"Transform";return void 0!==l.style[r]?function(t,i,o){e.style[n]="translate3d("+-t+"px,"+-i+"px,0) scale("+o+")"}:void 0!==l.style[n]?function(t,i,o){e.style[n]="translate("+-t+"px,"+-i+"px) scale("+o+")"}:function(t,i,o){e.style.marginLeft=t?-t/o+"px":"",e.style.marginTop=i?-i/o+"px":"",e.style.zoom=o||""}}(this.scrollPanelElm,window),{zooming:o,scrollingY:l,scrollingX:r&&!this.refreshLoad,animationDuration:this.mergedOptions.scrollPanel.speed,paging:t,snapping:i}),i&&this.scroller.setSnapSize(this.mergedOptions.vuescroll.snapping.width,this.mergedOptions.vuescroll.snapping.height);var n=this.$el.getBoundingClientRect();this.scroller.setPosition(n.left+this.$el.clientLeft,n.top+this.$el.clientTop);var a=function(e,t,i,o){var s=null;function l(e){e.touches[0]&&e.touches[0].target&&e.touches[0].target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart(e.touches,e.timeStamp),e.preventDefault())}function r(e){i("mousemove"),t.doTouchMove(e.touches,e.timeStamp,e.scale)}function n(e){i("mouseup"),t.doTouchEnd(e.timeStamp)}function a(e){t.doTouchEnd(e.timeStamp)}function c(e){e.target.tagName.match(/input|textarea|select/i)||(i("mousedown"),t.doTouchStart([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),p=!0)}function h(e){p&&(i("mousemove"),t.doTouchMove([{pageX:e.pageX,pageY:e.pageY}],e.timeStamp),p=!0)}function _(e){p&&(i("mouseup"),t.doTouchEnd(e.timeStamp),p=!1)}function u(e){t.doMouseZoom(e.detail?-120*e.detail:e.wheelDelta,e.timeStamp,e.pageX,e.pageY)}if("ontouchstart"in window)e.addEventListener("touchstart",l,!1),document.addEventListener("touchmove",r,!1),document.addEventListener("touchend",n,!1),document.addEventListener("touchcancel",a,!1),s=function(){e.removeEventListener("touchstart",l,!1),document.removeEventListener("touchmove",r,!1),document.removeEventListener("touchend",n,!1),document.removeEventListener("touchcancel",a,!1)};else{var p=!1;e.addEventListener("mousedown",c,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("mouseup",_,!1),o&&e.addEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",u,!1),s=function(){e.removeEventListener("mousedown",c,!1),document.removeEventListener("mousemove",h,!1),document.removeEventListener("mouseup",_,!1),e.removeEventListener(navigator.userAgent.indexOf("Firefox")>-1?"DOMMouseScroll":"mousewheel",u,!1)}}return t.onScroll=function(){i("onscroll")},s}(this.$el,this.scroller,function(t){switch(t){case"mousedown":e.vuescroll.state.isDragging=!0;break;case"onscroll":e.handleScroll(!1);break;case"mouseup":e.vuescroll.state.isDragging=!1}},o);if(this.mergedOptions.vuescroll.pullRefresh.enable){var c=this.$refs.refreshDom.elm||this.$refs.refreshDom;this.$listeners["refresh-activate"]&&(A=function(){e.vuescroll.state.refreshStage="active",e.$emit("refresh-activate",e,c)}),this.$listeners["refresh-before-deactivate"]&&(C=function(t){e.vuescroll.state.refreshStage="beforeDeactive",e.$emit("refresh-before-deactivate",e,c,t.bind(e.scroller))}),this.$listeners["refresh-deactivate"]&&(P=function(){e.vuescroll.state.refreshStage="deactive",e.$emit("refresh-deactivate",e,c)}),this.$listeners["refresh-start"]&&(k=function(){e.vuescroll.state.refreshStage="start",e.$emit("refresh-start",e,c,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var h=c.scrollHeight;this.scroller.activatePullToRefresh(h,A.bind(this),P.bind(this),k.bind(this),C.bind(this))}if(this.mergedOptions.vuescroll.pushLoad.enable){var _=this.$refs.loadDom.elm||this.$refs.loadDom;this.$listeners["load-activate"]&&(E=function(){e.vuescroll.state.loadStage="active",e.$emit("load-activate",e,_)}),this.$listeners["load-before-deactivate"]&&(R=function(t){e.vuescroll.state.loadStage="beforeDeactive",e.$emit("load-before-deactivate",e,_,t.bind(e.scroller))}),this.$listeners["load-deactivate"]&&(X=function(){e.vuescroll.state.loadStage="deactive",e.$emit("load-deactivate",e,_)}),this.$listeners["load-start"]&&(H=function(){e.vuescroll.state.loadStage="start",e.$emit("load-start",e,_,e.scroller.finishRefreshOrLoad.bind(e.scroller))});var u=_.scrollHeight;this.scroller.activatePushToLoad(u,E.bind(this),X.bind(this),H.bind(this),R.bind(this))}return this.updateScroller(),a},updateSlideModeBarState:function(){var e,t,i=this.$el,o=this.scroller,s=0,l=0,r=i.clientWidth,n=i.clientHeight,a=r+this.scroller.__maxScrollLeft,c=n+this.scroller.__maxScrollTop,h=ro.__maxScrollLeft&&(s=o.__scrollLeft-o.__maxScrollLeft)),_&&(o.__scrollTop<0?l=-o.__scrollTop:o.__scrollTop>o.__maxScrollTop&&(l=o.__scrollTop-o.__maxScrollTop)),e=100*n/(c+l),t=100*r/(a+s);var u=Math.min(Math.max(0,o.__scrollTop),o.__maxScrollTop),p=Math.min(Math.max(0,o.__scrollLeft),o.__maxScrollLeft);this.bar.vBar.state.posValue=100*(u+l)/i.clientHeight,this.bar.hBar.state.posValue=100*(p+s)/i.clientWidth,o.__scrollLeft<0&&(this.bar.hBar.state.posValue=0),o.__scrollTop<0&&(this.bar.vBar.state.posValue=0),this.bar.vBar.state.size=e<100?e+"%":0,this.bar.hBar.state.size=t<100?t+"%":0}}},V=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;"native"==this.mode||"pure-native"==this.mode?this.updateNativeModeBarState():"slide"==this.mode&&this.updateSlideModeBarState(),e&&this.emitEvent(e,t)},updateMode:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{var t=this.vuescroll.state.internalScrollLeft,i=this.vuescroll.state.internalScrollTop;this.destroyScroller&&(this.scroller.stop(),this.destroyScroller(),this.destroyScroller=null),"slide"==this.mode?this.destroyScroller=this.registryScroller():"native"!=this.mode&&"pure-native"!=this.mode||(this.scrollPanelElm.style.transform="",this.scrollPanelElm.style.transformOrigin=""),this.scrollTo({x:t,y:i},!1,!0)}},handleScroll:function(e){this.recordCurrentPos(),this.update("handle-scroll",e),this.showAndDefferedHideBar()},setBarClick:function(e){this.isClickingBar=e},showAndDefferedHideBar:function(){var e=this;this.showBar(),this.vuescroll.state.timeoutId&&clearTimeout(this.vuescroll.state.timeoutId),this.vuescroll.state.timeoutId=setTimeout(function(){e.vuescroll.state.timeoutId=0,e.hideBar()},500)},emitEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.scrollPanelElm,o={type:"vertical"},s={type:"horizontal"},l=i.scrollTop,r=i.scrollLeft;"slide"==this.mode&&(l=this.scroller.__scrollTop,r=this.scroller.__scrollLeft),o.process=l/(i.scrollHeight-i.clientHeight),s.process=r/(i.scrollWidth-i.clientWidth),o.barSize=this.bar.vBar.state.size,s.barSize=this.bar.hBar.state.size,this.$emit(e,o,s,t)},showBar:function(){this.bar.vBar.state.opacity=this.mergedOptions.bar.vBar.opacity,this.bar.hBar.state.opacity=this.mergedOptions.bar.hBar.opacity},hideBar:function(){this.vuescroll.state.isDragging||(this.mergedOptions.bar.vBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.vBar.state.opacity=0),this.mergedOptions.bar.hBar.keepShow||this.vuescroll.state.isClickingBar||!this.vuescroll.state.pointerLeave||(this.bar.hBar.state.opacity=0))},registryResize:function(){var e=this;if(this.shouldStop)this.$nextTick(function(){e.shouldStop=!1});else{this.destroyResize&&this.destroyResize();var t=null;"slide"==this.mode||"pure-native"==this.mode?t=this.scrollPanelElm:"native"==this.mode&&(t=this.$refs.scrollContent._isVue?this.$refs.scrollContent.$el:this.$refs.scrollContent),window.addEventListener("resize",function(){e.update(),e.showAndDefferedHideBar(),"slide"==e.mode&&e.updateScroller()},!1);var i,o,s,l=[function(){var t={};"slide"==e.mode?(e.updateScroller(),t.width=e.scroller.__contentWidth,t.height=e.scroller.__contentHeight):"native"==e.mode&&(t.width=e.scrollPanelElm.scrollWidth,t.height=e.scrollPanelElm.scrollHeight),e.update("handle-resize",t),e.showAndDefferedHideBar()}];this.destroyResize=(i=t,o=l,(s=document.createElement("object")).style.cssText="display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;",s.tabIndex=-1,s.type="text/html",s.onload=function(){o.forEach(function(e){_(s.contentDocument.defaultView,"resize",e)})},i.appendChild(s),function(){s.contentDocument&&o.forEach(function(e){u(s.contentDocument.defaultView,"resize",e)}),i.removeChild(s)})}},recordCurrentPos:function(){this.mode!==this.lastMode?(this.vuescroll.state.internalScrollLeft=d(this.lastMode,this).x,this.vuescroll.state.internalScrollTop=d(this.lastMode,this).y,this.lastMode=this.mode):(this.vuescroll.state.internalScrollLeft=d(this.mode,this).x,this.vuescroll.state.internalScrollTop=d(this.mode,this).y)},watchChanges:function(){var e=this;this.$watch("mergedOptions",function(){e.recordCurrentPos(),e.$nextTick(function(){e.registryResize(),e.updateMode()})},{deep:!0,sync:!0})},watchSmallChanges:function(){var e=this;F.forEach(function(t){e.$watch(t,function(){e.shouldStop=!0},{sync:!0,deep:!0})})}},mounted:function(){var e=this;this._isDestroyed||this.shouldStopRender||("slide"==this.mode&&(this.destroyScroller=this.registryScroller()),this.lastMode=this.mode,this.registryResize(),this.watchChanges(),this.watchSmallChanges(),this.$nextTick(function(){e.update(),e.showAndDefferedHideBar()}))},updated:function(){var e=this;this.$nextTick(function(){e._isDestroyed||e.showAndDefferedHideBar()})}},Q={install:function(e){Q.isInstalled?console.warn("You should not install the vuescroll again!"):(e.component(Z.name,Z),e.prototype.$vuescrollConfig=s(m,{}),Q.isInstalled=!0,Q.version="4.5.0")}};return void 0!==e&&e.use(Q),Q}); \ No newline at end of file diff --git a/package.json b/package.json index df7bb6af..8891137f 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "test:cover": "karma start test/karma.conf.js", "report-coverage": "codecov" }, - "version": "4.4.9", + "version": "4.5.0", "devDependencies": { "babel-core": "^6.26.0", "babel-helper-vue-jsx-merge-props": "^2.0.3", diff --git a/src/config/global-config.js b/src/config/global-config.js index a98e5e13..02b23842 100644 --- a/src/config/global-config.js +++ b/src/config/global-config.js @@ -44,10 +44,8 @@ export default { // customize tag of scrollContent tag: "div", padding: true, - props: { - }, - attrs: { - } + props: { }, + attrs: { } }, // rail: { diff --git a/src/util/index.js b/src/util/index.js index f2b8d2bb..5ed53bb1 100644 --- a/src/util/index.js +++ b/src/util/index.js @@ -47,11 +47,7 @@ export function deepMerge(from, to) { */ export function defineReactive(target, key, source, souceKey) { let getter = null; - if( - !source[key] - && typeof source !== "function" - - ) { + if(!source[key] && typeof source !== "function") { return; } souceKey = souceKey || key; @@ -72,7 +68,6 @@ export function getGutter() { /* istanbul ignore next */ if (Vue.prototype.$isServer) return 0; if (scrollBarWidth !== undefined) return scrollBarWidth; - const outer = document.createElement("div"); outer.style.visibility = "hidden"; outer.style.width = "100px"; @@ -82,17 +77,14 @@ export function getGutter() { const widthNoScroll = outer.offsetWidth; outer.style.overflow = "scroll"; - const inner = document.createElement("div"); inner.style.width = "100%"; outer.appendChild(inner); - + const widthWithScroll = inner.offsetWidth; outer.parentNode.removeChild(outer); scrollBarWidth = widthNoScroll - widthWithScroll; - getGutter.isUsed = false; - return scrollBarWidth; }