-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvueScrollbar.umd.min.js
8 lines (8 loc) · 23.1 KB
/
vueScrollbar.umd.min.js
1
2
3
4
5
6
7
8
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vueScrollbar"]=e():t["vueScrollbar"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"3ae1":function(t,e,n){"use strict";n("e386")},"7da8":function(t,e,n){},8875:function(t,e,n){var r,i,l;(function(n,o){i=[],r=o,l="function"===typeof r?r.apply(e,i):r,void 0===l||(t.exports=l)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var n,r,i,l=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,o=/@([^@]*):(\d+):(\d+)\s*$/gi,s=l.exec(f.stack)||o.exec(f.stack),a=s&&s[1]||!1,c=s&&s[2]||!1,h=document.location.href.replace(document.location.hash,""),u=document.getElementsByTagName("script");a===h&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(c-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(r,"$1").trim());for(var d=0;d<u.length;d++){if("interactive"===u[d].readyState)return u[d];if(u[d].src===a)return u[d];if(a===h&&u[d].innerHTML&&u[d].innerHTML.trim()===i)return u[d]}return null}}return t}))},e386:function(t,e,n){},fb15:function(t,e,n){"use strict";if(n.r(e),"undefined"!==typeof window){var r=window.document.currentScript,i=n("8875");r=i(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:i});var l=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);l&&(n.p=l[1])}var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n(t.$props.tagname,{tag:"section",staticClass:"ps-container",on:{"ps-scroll-y":t.scrollHandle,"ps-scroll-x":t.scrollHandle,"ps-scroll-up":t.scrollHandle,"ps-scroll-down":t.scrollHandle,"ps-scroll-left":t.scrollHandle,"ps-scroll-right":t.scrollHandle,"ps-y-reach-start":t.scrollHandle,"ps-y-reach-end":t.scrollHandle,"ps-x-reach-start":t.scrollHandle,"ps-x-reach-end":t.scrollHandle}},[t._t("default")],2)},s=[];n("7da8");
/*!
* perfect-scrollbar v1.5.3
* Copyright 2021 Hyunje Jun, MDBootstrap and Contributors
* Licensed under MIT
*/
function a(t){return getComputedStyle(t)}function c(t,e){for(var n in e){var r=e[n];"number"===typeof r&&(r+="px"),t.style[n]=r}return t}function h(t){var e=document.createElement("div");return e.className=t,e}var u="undefined"!==typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function d(t,e){if(!u)throw new Error("No element matching method supported");return u.call(t,e)}function f(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function p(t,e){return Array.prototype.filter.call(t.children,(function(t){return d(t,e)}))}var b={main:"ps",rtl:"ps__rtl",element:{thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}}},g={x:null,y:null};function v(t,e){var n=t.element.classList,r=b.state.scrolling(e);n.contains(r)?clearTimeout(g[e]):n.add(r)}function m(t,e){g[e]=setTimeout((function(){return t.isAlive&&t.element.classList.remove(b.state.scrolling(e))}),t.settings.scrollingThreshold)}function y(t,e){v(t,e),m(t,e)}var w=function(t){this.element=t,this.handlers={}},Y={isEmpty:{configurable:!0}};w.prototype.bind=function(t,e){"undefined"===typeof this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},w.prototype.unbind=function(t,e){var n=this;this.handlers[t]=this.handlers[t].filter((function(r){return!(!e||r===e)||(n.element.removeEventListener(t,r,!1),!1)}))},w.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},Y.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every((function(e){return 0===t.handlers[e].length}))},Object.defineProperties(w.prototype,Y);var X=function(){this.eventElements=[]};function W(t){if("function"===typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}function S(t,e,n,r,i){var l;if(void 0===r&&(r=!0),void 0===i&&(i=!1),"top"===e)l=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");l=["contentWidth","containerWidth","scrollLeft","x","left","right"]}L(t,n,l,r,i)}function L(t,e,n,r,i){var l=n[0],o=n[1],s=n[2],a=n[3],c=n[4],h=n[5];void 0===r&&(r=!0),void 0===i&&(i=!1);var u=t.element;t.reach[a]=null,u[s]<1&&(t.reach[a]="start"),u[s]>t[l]-t[o]-1&&(t.reach[a]="end"),e&&(u.dispatchEvent(W("ps-scroll-"+a)),e<0?u.dispatchEvent(W("ps-scroll-"+c)):e>0&&u.dispatchEvent(W("ps-scroll-"+h)),r&&y(t,a)),t.reach[a]&&(e||i)&&u.dispatchEvent(W("ps-"+a+"-reach-"+t.reach[a]))}function T(t){return parseInt(t,10)||0}function H(t){return d(t,"input,[contenteditable]")||d(t,"select,[contenteditable]")||d(t,"textarea,[contenteditable]")||d(t,"button,[contenteditable]")}function R(t){var e=a(t);return T(e.width)+T(e.paddingLeft)+T(e.paddingRight)+T(e.borderLeftWidth)+T(e.borderRightWidth)}X.prototype.eventElement=function(t){var e=this.eventElements.filter((function(e){return e.element===t}))[0];return e||(e=new w(t),this.eventElements.push(e)),e},X.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},X.prototype.unbind=function(t,e,n){var r=this.eventElement(t);r.unbind(e,n),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)},X.prototype.unbindAll=function(){this.eventElements.forEach((function(t){return t.unbindAll()})),this.eventElements=[]},X.prototype.once=function(t,e,n){var r=this.eventElement(t),i=function(t){r.unbind(e,i),n(t)};r.bind(e,i)};var _={isWebKit:"undefined"!==typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!==typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!==typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!==typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function E(t){var e=t.element,n=Math.floor(e.scrollTop),r=e.getBoundingClientRect();t.containerWidth=Math.round(r.width),t.containerHeight=Math.round(r.height),t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(p(e,b.element.rail("x")).forEach((function(t){return f(t)})),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(p(e,b.element.rail("y")).forEach((function(t){return f(t)})),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.railXRatio=t.containerWidth/t.railXWidth,t.scrollbarXWidth=x(t,T(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=T((t.negativeScrollAdjustment+e.scrollLeft)*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):t.scrollbarXActive=!1,!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.railYRatio=t.containerHeight/t.railYHeight,t.scrollbarYHeight=x(t,T(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=T(n*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):t.scrollbarYActive=!1,t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),M(e,t),t.scrollbarXActive?e.classList.add(b.state.active("x")):(e.classList.remove(b.state.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=!0===t.isRtl?t.contentWidth:0),t.scrollbarYActive?e.classList.add(b.state.active("y")):(e.classList.remove(b.state.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)}function x(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function M(t,e){var n={width:e.railXWidth},r=Math.floor(t.scrollTop);e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft,e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-r:n.top=e.scrollbarXTop+r,c(e.scrollbarXRail,n);var i={top:r,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?i.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:i.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?i.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:i.left=e.scrollbarYLeft+t.scrollLeft,c(e.scrollbarYRail,i),c(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),c(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}function A(t){t.element;t.event.bind(t.scrollbarY,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarYRail,"mousedown",(function(e){var n=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top,r=n>t.scrollbarYTop?1:-1;t.element.scrollTop+=r*t.containerHeight,E(t),e.stopPropagation()})),t.event.bind(t.scrollbarX,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarXRail,"mousedown",(function(e){var n=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left,r=n>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=r*t.containerWidth,E(t),e.stopPropagation()}))}function P(t){C(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),C(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])}function C(t,e){var n=e[0],r=e[1],i=e[2],l=e[3],o=e[4],s=e[5],a=e[6],c=e[7],h=e[8],u=t.element,d=null,f=null,p=null;function g(e){e.touches&&e.touches[0]&&(e[i]=e.touches[0].pageY),u[a]=d+p*(e[i]-f),v(t,c),E(t),e.stopPropagation(),e.type.startsWith("touch")&&e.changedTouches.length>1&&e.preventDefault()}function y(){m(t,c),t[h].classList.remove(b.state.clicking),t.event.unbind(t.ownerDocument,"mousemove",g)}function w(e,o){d=u[a],o&&e.touches&&(e[i]=e.touches[0].pageY),f=e[i],p=(t[r]-t[n])/(t[l]-t[s]),o?t.event.bind(t.ownerDocument,"touchmove",g):(t.event.bind(t.ownerDocument,"mousemove",g),t.event.once(t.ownerDocument,"mouseup",y),e.preventDefault()),t[h].classList.add(b.state.clicking),e.stopPropagation()}t.event.bind(t[o],"mousedown",(function(t){w(t)})),t.event.bind(t[o],"touchstart",(function(t){w(t,!0)}))}function k(t){var e=t.element,n=function(){return d(e,":hover")},r=function(){return d(t.scrollbarX,":focus")||d(t.scrollbarY,":focus")};function i(n,r){var i=Math.floor(e.scrollTop);if(0===n){if(!t.scrollbarYActive)return!1;if(0===i&&r>0||i>=t.contentHeight-t.containerHeight&&r<0)return!t.settings.wheelPropagation}var l=e.scrollLeft;if(0===r){if(!t.scrollbarXActive)return!1;if(0===l&&n<0||l>=t.contentWidth-t.containerWidth&&n>0)return!t.settings.wheelPropagation}return!0}t.event.bind(t.ownerDocument,"keydown",(function(l){if(!(l.isDefaultPrevented&&l.isDefaultPrevented()||l.defaultPrevented)&&(n()||r())){var o=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(o){if("IFRAME"===o.tagName)o=o.contentDocument.activeElement;else while(o.shadowRoot)o=o.shadowRoot.activeElement;if(H(o))return}var s=0,a=0;switch(l.which){case 37:s=l.metaKey?-t.contentWidth:l.altKey?-t.containerWidth:-30;break;case 38:a=l.metaKey?t.contentHeight:l.altKey?t.containerHeight:30;break;case 39:s=l.metaKey?t.contentWidth:l.altKey?t.containerWidth:30;break;case 40:a=l.metaKey?-t.contentHeight:l.altKey?-t.containerHeight:-30;break;case 32:a=l.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:a=t.containerHeight;break;case 34:a=-t.containerHeight;break;case 36:a=t.contentHeight;break;case 35:a=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==s||t.settings.suppressScrollY&&0!==a||(e.scrollTop-=a,e.scrollLeft+=s,E(t),i(s,a)&&l.preventDefault())}}))}function D(t){var e=t.element;function n(n,r){var i,l=Math.floor(e.scrollTop),o=0===e.scrollTop,s=l+e.offsetHeight===e.scrollHeight,a=0===e.scrollLeft,c=e.scrollLeft+e.offsetWidth===e.scrollWidth;return i=Math.abs(r)>Math.abs(n)?o||s:a||c,!i||!t.settings.wheelPropagation}function r(t){var e=t.deltaX,n=-1*t.deltaY;return"undefined"!==typeof e&&"undefined"!==typeof n||(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!==e&&n!==n&&(e=0,n=t.wheelDelta),t.shiftKey?[-n,-e]:[e,n]}function i(t,n,r){if(!_.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;var i=t;while(i&&i!==e){if(i.classList.contains(b.element.consuming))return!0;var l=a(i);if(r&&l.overflowY.match(/(scroll|auto)/)){var o=i.scrollHeight-i.clientHeight;if(o>0&&(i.scrollTop>0&&r<0||i.scrollTop<o&&r>0))return!0}if(n&&l.overflowX.match(/(scroll|auto)/)){var s=i.scrollWidth-i.clientWidth;if(s>0&&(i.scrollLeft>0&&n<0||i.scrollLeft<s&&n>0))return!0}i=i.parentNode}return!1}function l(l){var o=r(l),s=o[0],a=o[1];if(!i(l.target,s,a)){var c=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(a?e.scrollTop-=a*t.settings.wheelSpeed:e.scrollTop+=s*t.settings.wheelSpeed,c=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(s?e.scrollLeft+=s*t.settings.wheelSpeed:e.scrollLeft-=a*t.settings.wheelSpeed,c=!0):(e.scrollTop-=a*t.settings.wheelSpeed,e.scrollLeft+=s*t.settings.wheelSpeed),E(t),c=c||n(s,a),c&&!l.ctrlKey&&(l.stopPropagation(),l.preventDefault())}}"undefined"!==typeof window.onwheel?t.event.bind(e,"wheel",l):"undefined"!==typeof window.onmousewheel&&t.event.bind(e,"mousewheel",l)}function O(t){if(_.supportsTouch||_.supportsIePointer){var e=t.element,n={},r=0,i={},l=null;_.supportsTouch?(t.event.bind(e,"touchstart",u),t.event.bind(e,"touchmove",f),t.event.bind(e,"touchend",p)):_.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",u),t.event.bind(e,"pointermove",f),t.event.bind(e,"pointerup",p)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",u),t.event.bind(e,"MSPointerMove",f),t.event.bind(e,"MSPointerUp",p)))}function o(n,r){var i=Math.floor(e.scrollTop),l=e.scrollLeft,o=Math.abs(n),s=Math.abs(r);if(s>o){if(r<0&&i===t.contentHeight-t.containerHeight||r>0&&0===i)return 0===window.scrollY&&r>0&&_.isChrome}else if(o>s&&(n<0&&l===t.contentWidth-t.containerWidth||n>0&&0===l))return!0;return!0}function s(n,r){e.scrollTop-=r,e.scrollLeft-=n,E(t)}function c(t){return t.targetTouches?t.targetTouches[0]:t}function h(t){return(!t.pointerType||"pen"!==t.pointerType||0!==t.buttons)&&(!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function u(t){if(h(t)){var e=c(t);n.pageX=e.pageX,n.pageY=e.pageY,r=(new Date).getTime(),null!==l&&clearInterval(l)}}function d(t,n,r){if(!e.contains(t))return!1;var i=t;while(i&&i!==e){if(i.classList.contains(b.element.consuming))return!0;var l=a(i);if(r&&l.overflowY.match(/(scroll|auto)/)){var o=i.scrollHeight-i.clientHeight;if(o>0&&(i.scrollTop>0&&r<0||i.scrollTop<o&&r>0))return!0}if(n&&l.overflowX.match(/(scroll|auto)/)){var s=i.scrollWidth-i.clientWidth;if(s>0&&(i.scrollLeft>0&&n<0||i.scrollLeft<s&&n>0))return!0}i=i.parentNode}return!1}function f(t){if(h(t)){var e=c(t),l={pageX:e.pageX,pageY:e.pageY},a=l.pageX-n.pageX,u=l.pageY-n.pageY;if(d(t.target,a,u))return;s(a,u),n=l;var f=(new Date).getTime(),p=f-r;p>0&&(i.x=a/p,i.y=u/p,r=f),o(a,u)&&t.preventDefault()}}function p(){t.settings.swipeEasing&&(clearInterval(l),l=setInterval((function(){t.isInitialized?clearInterval(l):i.x||i.y?Math.abs(i.x)<.01&&Math.abs(i.y)<.01?clearInterval(l):t.element?(s(30*i.x,30*i.y),i.x*=.8,i.y*=.8):clearInterval(l):clearInterval(l)}),10))}}var j=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},N={"click-rail":A,"drag-thumb":P,keyboard:k,wheel:D,touch:O},B=function(t,e){var n=this;if(void 0===e&&(e={}),"string"===typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var r in this.element=t,t.classList.add(b.main),this.settings=j(),e)this.settings[r]=e[r];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var i=function(){return t.classList.add(b.state.focus)},l=function(){return t.classList.remove(b.state.focus)};this.isRtl="rtl"===a(t).direction,!0===this.isRtl&&t.classList.add(b.rtl),this.isNegativeScroll=function(){var e=t.scrollLeft,n=null;return t.scrollLeft=-1,n=t.scrollLeft<0,t.scrollLeft=e,n}(),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new X,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=h(b.element.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=h(b.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",i),this.event.bind(this.scrollbarX,"blur",l),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var o=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(o.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=T(o.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=T(o.borderLeftWidth)+T(o.borderRightWidth),c(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=T(o.marginLeft)+T(o.marginRight),c(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=h(b.element.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=h(b.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",i),this.event.bind(this.scrollbarY,"blur",l),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var s=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(s.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=T(s.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?R(this.scrollbarY):null,this.railBorderYWidth=T(s.borderTopWidth)+T(s.borderBottomWidth),c(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=T(s.marginTop)+T(s.marginBottom),c(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach((function(t){return N[t](n)})),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",(function(t){return n.onScroll(t)})),E(this)};B.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,c(this.scrollbarXRail,{display:"block"}),c(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=T(a(this.scrollbarXRail).marginLeft)+T(a(this.scrollbarXRail).marginRight),this.railYMarginHeight=T(a(this.scrollbarYRail).marginTop)+T(a(this.scrollbarYRail).marginBottom),c(this.scrollbarXRail,{display:"none"}),c(this.scrollbarYRail,{display:"none"}),E(this),S(this,"top",0,!1,!0),S(this,"left",0,!1,!0),c(this.scrollbarXRail,{display:""}),c(this.scrollbarYRail,{display:""}))},B.prototype.onScroll=function(t){this.isAlive&&(E(this),S(this,"top",this.element.scrollTop-this.lastScrollTop),S(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},B.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),f(this.scrollbarX),f(this.scrollbarY),f(this.scrollbarXRail),f(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},B.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter((function(t){return!t.match(/^ps([-_].+|)$/)})).join(" ")};var $=B,I={name:"vue-custom-scrollbar",props:{settings:{default:null},swicher:{type:Boolean,default:!0},tagname:{type:String,default:"section"}},data:function(){return{ps:null}},methods:{scrollHandle:function(t){this.$emit(t.type,t)},update:function(){this.ps&&this.ps.update()},__init:function(){this.swicher&&(this._ps_inited?this.ps.update():(this._ps_inited=!0,this.ps=new $(this.$el,this.settings)))},__uninit:function(){this.ps&&(this.ps.destroy(),this.ps=null,this._ps_inited=!1)}},watch:{swicher:function(t){t&&!this._ps_inited&&this.__init(),!t&&this._ps_inited&&this.__uninit()},settings:{deep:!0,handler:function(){this.__uninit(),this.__init()}},$route:function(){this.update()}},mounted:function(){this.$isServer||this.__init()},updated:function(){this.$nextTick(this.update)},activated:function(){this.__init()},deactivated:function(){this.__uninit()},beforeDestroy:function(){this.__uninit()}},K=I;n("3ae1");function U(t,e,n,r,i,l,o,s){var a,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),l&&(c._scopeId="data-v-"+l),o?(a=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=a):i&&(a=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(c.functional){c._injectStyles=a;var h=c.render;c.render=function(t,e){return a.call(e),h(t,e)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,a):[a]}return{exports:t,options:c}}var z=U(K,o,s,!1,null,null,null),q=z.exports;e["default"]=q}})["default"]}));
//# sourceMappingURL=vueScrollbar.umd.min.js.map