Socket
Socket
Sign inDemoInstall

react-custom-scrollbars

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-custom-scrollbars - npm Package Compare versions

Comparing version 4.1.1 to 4.1.2

2

dist/react-custom-scrollbars.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactCustomScrollbars=t(require("react")):e.ReactCustomScrollbars=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Scrollbars=void 0;var o=r(5),i=n(o);t["default"]=i["default"],t.Scrollbars=i["default"]},function(e,t,r){function n(e,t,r){var n=c[t];if("undefined"==typeof n&&(n=i(t)),n){if(void 0===r)return e.style[n];e.style[n]=s(n,r)}}function o(e,t){for(var r in t)t.hasOwnProperty(r)&&n(e,r,t[r])}function i(e){var t=u(e),r=l(t);return c[t]=c[e]=c[r]=r,r}function a(){2===arguments.length?"string"==typeof arguments[1]?arguments[0].style.cssText=arguments[1]:o(arguments[0],arguments[1]):n(arguments[0],arguments[1],arguments[2])}var l=r(15),u=r(20),c={"float":"cssFloat"},s=r(3);e.exports=a,e.exports.set=a,e.exports.get=function(e,t){return Array.isArray(t)?t.reduce(function(t,r){return t[r]=n(e,r||""),t},{}):n(e,t||"")}},function(t,r){t.exports=e},function(e,t){var r={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=function(e,t){return"number"!=typeof t||r[e]?t:t+"px"}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e){return f["default"].createElement("div",e)}function a(e){var t=e.style,r=o(e,["style"]),n=s({},t,{right:2,bottom:2,left:2,borderRadius:3});return f["default"].createElement("div",s({style:n},r))}function l(e){var t=e.style,r=o(e,["style"]),n=s({},t,{right:2,bottom:2,top:2,borderRadius:3});return f["default"].createElement("div",s({style:n},r))}function u(e){var t=e.style,r=o(e,["style"]),n=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return f["default"].createElement("div",s({style:n},r))}function c(e){var t=e.style,r=o(e,["style"]),n=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return f["default"].createElement("div",s({style:n},r))}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};t.renderViewDefault=i,t.renderTrackHorizontalDefault=a,t.renderTrackVerticalDefault=l,t.renderThumbHorizontalDefault=u,t.renderThumbVerticalDefault=c;var d=r(2),f=n(d)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(19),d=n(s),f=r(1),h=n(f),v=r(2),p=r(18),m=n(p),g=r(10),y=n(g),b=r(9),T=n(b),k=r(11),w=n(k),S=r(8),H=n(S),M=r(7),D=n(M),z=r(6),L=r(4),x=function(e){function t(e){var r;i(this,t);for(var n=arguments.length,o=Array(n>1?n-1:0),l=1;l<n;l++)o[l-1]=arguments[l];var u=a(this,(r=t.__proto__||Object.getPrototypeOf(t)).call.apply(r,[this,e].concat(o)));return u.handleTrackMouseEnter=u.handleTrackMouseEnter.bind(u),u.handleTrackMouseLeave=u.handleTrackMouseLeave.bind(u),u.handleHorizontalTrackMouseDown=u.handleHorizontalTrackMouseDown.bind(u),u.handleVerticalTrackMouseDown=u.handleVerticalTrackMouseDown.bind(u),u.handleHorizontalThumbMouseDown=u.handleHorizontalThumbMouseDown.bind(u),u.handleVerticalThumbMouseDown=u.handleVerticalThumbMouseDown.bind(u),u.handleWindowResize=u.handleWindowResize.bind(u),u.handleScroll=u.handleScroll.bind(u),u.handleDrag=u.handleDrag.bind(u),u.handleDragEnd=u.handleDragEnd.bind(u),u.state={didMountUniversal:!1},u}return l(t,e),c(t,[{key:"componentDidMount",value:function(){this.addListeners(),this.update(),this.componentDidMountUniversal()}},{key:"componentDidMountUniversal",value:function(){var e=this.props.universal;e&&this.setState({didMountUniversal:!0})}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"componentWillUnmount",value:function(){this.removeListeners(),(0,s.cancel)(this.requestFrame),clearTimeout(this.hideTracksTimeout),clearInterval(this.detectScrollingInterval)}},{key:"getScrollLeft",value:function(){var e=this.refs.view;return e.scrollLeft}},{key:"getScrollTop",value:function(){var e=this.refs.view;return e.scrollTop}},{key:"getScrollWidth",value:function(){var e=this.refs.view;return e.scrollWidth}},{key:"getScrollHeight",value:function(){var e=this.refs.view;return e.scrollHeight}},{key:"getClientWidth",value:function(){var e=this.refs.view;return e.clientWidth}},{key:"getClientHeight",value:function(){var e=this.refs.view;return e.clientHeight}},{key:"getValues",value:function(){var e=this.refs.view,t=e.scrollLeft,r=e.scrollTop,n=e.scrollWidth,o=e.scrollHeight,i=e.clientWidth,a=e.clientHeight;return{left:t/(n-i)||0,top:r/(o-a)||0,scrollLeft:t,scrollTop:r,scrollWidth:n,scrollHeight:o,clientWidth:i,clientHeight:a}}},{key:"getThumbHorizontalWidth",value:function(){var e=this.props,t=e.thumbSize,r=e.thumbMinSize,n=this.refs,o=n.view,i=n.trackHorizontal,a=o.scrollWidth,l=o.clientWidth,u=(0,H["default"])(i),c=Math.ceil(l/a*u);return u===c?0:t?t:Math.max(c,r)}},{key:"getThumbVerticalHeight",value:function(){var e=this.props,t=e.thumbSize,r=e.thumbMinSize,n=this.refs,o=n.view,i=n.trackVertical,a=o.scrollHeight,l=o.clientHeight,u=(0,D["default"])(i),c=Math.ceil(l/a*u);return u===c?0:t?t:Math.max(c,r)}},{key:"getScrollLeftForOffset",value:function(e){var t=this.refs,r=t.view,n=t.trackHorizontal,o=r.scrollWidth,i=r.clientWidth,a=(0,H["default"])(n),l=this.getThumbHorizontalWidth();return e/(a-l)*(o-i)}},{key:"getScrollTopForOffset",value:function(e){var t=this.refs,r=t.view,n=t.trackVertical,o=r.scrollHeight,i=r.clientHeight,a=(0,D["default"])(n),l=this.getThumbVerticalHeight();return e/(a-l)*(o-i)}},{key:"scrollLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.refs.view;t.scrollLeft=e}},{key:"scrollTop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.refs.view;t.scrollTop=e}},{key:"scrollToLeft",value:function(){var e=this.refs.view;e.scrollLeft=0}},{key:"scrollToTop",value:function(){var e=this.refs.view;e.scrollTop=0}},{key:"scrollToRight",value:function(){var e=this.refs.view;e.scrollLeft=e.scrollWidth}},{key:"scrollToBottom",value:function(){var e=this.refs.view;e.scrollTop=e.scrollHeight}},{key:"addListeners",value:function(){if("undefined"!=typeof document){var e=this.refs,t=e.view,r=e.trackHorizontal,n=e.trackVertical,o=e.thumbHorizontal,i=e.thumbVertical;t.addEventListener("scroll",this.handleScroll),(0,T["default"])()&&(r.addEventListener("mouseenter",this.handleTrackMouseEnter),r.addEventListener("mouseleave",this.handleTrackMouseLeave),r.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.addEventListener("mouseenter",this.handleTrackMouseEnter),n.addEventListener("mouseleave",this.handleTrackMouseLeave),n.addEventListener("mousedown",this.handleVerticalTrackMouseDown),o.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),i.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}}},{key:"removeListeners",value:function(){if("undefined"!=typeof document){var e=this.refs,t=e.view,r=e.trackHorizontal,n=e.trackVertical,o=e.thumbHorizontal,i=e.thumbVertical;t.removeEventListener("scroll",this.handleScroll),(0,T["default"])()&&(r.removeEventListener("mouseenter",this.handleTrackMouseEnter),r.removeEventListener("mouseleave",this.handleTrackMouseLeave),r.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.removeEventListener("mouseenter",this.handleTrackMouseEnter),n.removeEventListener("mouseleave",this.handleTrackMouseLeave),n.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),o.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),i.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}}},{key:"handleScroll",value:function(e){var t=this,r=this.props,n=r.onScroll,o=r.onScrollFrame;n&&n(e),this.update(function(e){var r=e.scrollLeft,n=e.scrollTop;t.viewScrollLeft=r,t.viewScrollTop=n,o&&o(e)}),this.detectScrolling()}},{key:"handleScrollStart",value:function(){var e=this.props.onScrollStart;e&&e(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){var e=this.props.autoHide;e&&this.showTracks()}},{key:"handleScrollStop",value:function(){var e=this.props.onScrollStop;e&&e(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){var e=this.props.autoHide;e&&this.hideTracks()}},{key:"handleWindowResize",value:function(){this.update()}},{key:"handleHorizontalTrackMouseDown",value:function(e){e.preventDefault();var t=this.refs.view,r=e.target,n=e.clientX,o=r.getBoundingClientRect(),i=o.left,a=this.getThumbHorizontalWidth(),l=Math.abs(i-n)-a/2;t.scrollLeft=this.getScrollLeftForOffset(l)}},{key:"handleVerticalTrackMouseDown",value:function(e){e.preventDefault();var t=this.refs.view,r=e.target,n=e.clientY,o=r.getBoundingClientRect(),i=o.top,a=this.getThumbVerticalHeight(),l=Math.abs(i-n)-a/2;t.scrollTop=this.getScrollTopForOffset(l)}},{key:"handleHorizontalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,r=e.clientX,n=t.offsetWidth,o=t.getBoundingClientRect(),i=o.left;this.prevPageX=n-(r-i)}},{key:"handleVerticalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,r=e.clientY,n=t.offsetHeight,o=t.getBoundingClientRect(),i=o.top;this.prevPageY=n-(r-i)}},{key:"setupDragging",value:function(){(0,h["default"])(document.body,z.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=w["default"]}},{key:"teardownDragging",value:function(){(0,h["default"])(document.body,z.disableSelectStyleReset),document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleDragEnd),document.onselectstart=void 0}},{key:"handleDragStart",value:function(e){this.dragging=!0,e.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(e){if(this.prevPageX){var t=e.clientX,r=this.refs,n=r.view,o=r.trackHorizontal,i=o.getBoundingClientRect(),a=i.left,l=this.getThumbHorizontalWidth(),u=l-this.prevPageX,c=-a+t-u;n.scrollLeft=this.getScrollLeftForOffset(c)}if(this.prevPageY){var s=e.clientY,d=this.refs,f=d.view,h=d.trackVertical,v=h.getBoundingClientRect(),p=v.top,m=this.getThumbVerticalHeight(),g=m-this.prevPageY,y=-p+s-g;f.scrollTop=this.getScrollTopForOffset(y)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){var e=this.props.autoHide;e&&this.hideTracks()}},{key:"handleTrackMouseEnter",value:function(){this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide()}},{key:"handleTrackMouseEnterAutoHide",value:function(){var e=this.props.autoHide;e&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide()}},{key:"handleTrackMouseLeaveAutoHide",value:function(){var e=this.props.autoHide;e&&this.hideTracks()}},{key:"showTracks",value:function(){var e=this.refs,t=e.trackHorizontal,r=e.trackVertical;clearTimeout(this.hideTracksTimeout),(0,h["default"])(t,{opacity:1}),(0,h["default"])(r,{opacity:1})}},{key:"hideTracks",value:function(){if(!this.dragging&&!this.scrolling&&!this.trackMouseOver){var e=this.props.autoHideTimeout,t=this.refs,r=t.trackHorizontal,n=t.trackVertical;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout(function(){(0,h["default"])(r,{opacity:0}),(0,h["default"])(n,{opacity:0})},e)}}},{key:"detectScrolling",value:function(){var e=this;this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval(function(){e.lastViewScrollLeft===e.viewScrollLeft&&e.lastViewScrollTop===e.viewScrollTop&&(clearInterval(e.detectScrollingInterval),e.scrolling=!1,e.handleScrollStop()),e.lastViewScrollLeft=e.viewScrollLeft,e.lastViewScrollTop=e.viewScrollTop},100))}},{key:"raf",value:function(e){var t=this;this.requestFrame&&d["default"].cancel(this.requestFrame),this.requestFrame=(0,d["default"])(function(){t.requestFrame=void 0,e()})}},{key:"update",value:function(e){var t=this;this.raf(function(){return t._update(e)})}},{key:"_update",value:function(e){var t=this.props,r=t.onUpdate,n=t.hideTracksWhenNotNeeded,o=this.getValues();if((0,T["default"])()){var i=this.refs,a=i.thumbHorizontal,l=i.thumbVertical,u=i.trackHorizontal,c=i.trackVertical,s=o.scrollLeft,d=o.clientWidth,f=o.scrollWidth,v=(0,H["default"])(u),p=this.getThumbHorizontalWidth(),m=s/(f-d)*(v-p),g={width:p,transform:"translateX("+m+"px)"},y=o.scrollTop,b=o.clientHeight,k=o.scrollHeight,w=(0,D["default"])(c),S=this.getThumbVerticalHeight(),M=y/(k-b)*(w-S),z={height:S,transform:"translateY("+M+"px)"};if(n){var L={visibility:f>d?"visible":"hidden"},x={visibility:k>b?"visible":"hidden"};(0,h["default"])(u,L),(0,h["default"])(c,x)}(0,h["default"])(a,g),(0,h["default"])(l,z)}r&&r(o),"function"==typeof e&&e(o)}},{key:"render",value:function(){var e=(0,T["default"])(),t=this.props,r=(t.onScroll,t.onScrollFrame,t.onScrollStart,t.onScrollStop,t.onUpdate,t.renderView),n=t.renderTrackHorizontal,i=t.renderTrackVertical,a=t.renderThumbHorizontal,l=t.renderThumbVertical,c=t.tagName,s=(t.hideTracksWhenNotNeeded,t.autoHide),d=(t.autoHideTimeout,t.autoHideDuration),f=(t.thumbSize,t.thumbMinSize,t.universal),h=t.autoHeight,p=t.autoHeightMin,m=t.autoHeightMax,g=t.style,b=t.children,k=o(t,["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","universal","autoHeight","autoHeightMin","autoHeightMax","style","children"]),w=this.state.didMountUniversal,S=u({},z.containerStyleDefault,h&&u({},z.containerStyleAutoHeight,{minHeight:p,maxHeight:m}),g),H=u({},z.viewStyleDefault,{marginRight:e?-e:0,marginBottom:e?-e:0},h&&u({},z.viewStyleAutoHeight,{minHeight:(0,y["default"])(p)?"calc("+p+" + "+e+"px)":p+e,maxHeight:(0,y["default"])(m)?"calc("+m+" + "+e+"px)":m+e}),h&&f&&!w&&{minHeight:p,maxHeight:m},f&&!w&&z.viewStyleUniversalInitial),M={transition:"opacity "+d+"ms",opacity:0},D=u({},z.trackHorizontalStyleDefault,s&&M,(!e||f&&!w)&&{display:"none"}),L=u({},z.trackVerticalStyleDefault,s&&M,(!e||f&&!w)&&{display:"none"});return(0,v.createElement)(c,u({},k,{style:S,ref:"container"}),[(0,v.cloneElement)(r({style:H}),{key:"view",ref:"view"},b),(0,v.cloneElement)(n({style:D}),{key:"trackHorizontal",ref:"trackHorizontal"},(0,v.cloneElement)(a({style:z.thumbHorizontalStyleDefault}),{ref:"thumbHorizontal"})),(0,v.cloneElement)(i({style:L}),{key:"trackVertical",ref:"trackVertical"},(0,v.cloneElement)(l({style:z.thumbVerticalStyleDefault}),{ref:"thumbVertical"}))])}}]),t}(v.Component);t["default"]=x,x.propTypes={onScroll:m["default"].func,onScrollFrame:m["default"].func,onScrollStart:m["default"].func,onScrollStop:m["default"].func,onUpdate:m["default"].func,renderView:m["default"].func,renderTrackHorizontal:m["default"].func,renderTrackVertical:m["default"].func,renderThumbHorizontal:m["default"].func,renderThumbVertical:m["default"].func,tagName:m["default"].string,thumbSize:m["default"].number,thumbMinSize:m["default"].number,hideTracksWhenNotNeeded:m["default"].bool,autoHide:m["default"].bool,autoHideTimeout:m["default"].number,autoHideDuration:m["default"].number,autoHeight:m["default"].bool,autoHeightMin:m["default"].oneOfType([m["default"].number,m["default"].string]),autoHeightMax:m["default"].oneOfType([m["default"].number,m["default"].string]),universal:m["default"].bool,style:m["default"].object,children:m["default"].node},x.defaultProps={renderView:L.renderViewDefault,renderTrackHorizontal:L.renderTrackHorizontalDefault,renderTrackVertical:L.renderTrackVerticalDefault,renderThumbHorizontal:L.renderThumbHorizontalDefault,renderThumbVertical:L.renderThumbVerticalDefault,tagName:"div",thumbMinSize:30,hideTracksWhenNotNeeded:!1,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,universal:!1}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},t.containerStyleAutoHeight={height:"auto"},t.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"},t.viewStyleAutoHeight={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0},t.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0},t.trackHorizontalStyleDefault={position:"absolute",height:6},t.trackVerticalStyleDefault={position:"absolute",width:6},t.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"},t.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"},t.disableSelectStyle={userSelect:"none"},t.disableSelectStyleReset={userSelect:""}},function(e,t){"use strict";function r(e){var t=e.clientHeight,r=getComputedStyle(e),n=r.paddingTop,o=r.paddingBottom;return t-parseFloat(n)-parseFloat(o)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(e){var t=e.clientWidth,r=getComputedStyle(e),n=r.paddingLeft,o=r.paddingRight;return t-parseFloat(n)-parseFloat(o)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){if(l!==!1)return l;if("undefined"!=typeof document){var e=document.createElement("div");(0,a["default"])(e,{width:100,height:100,position:"absolute",top:-9999,overflow:"scroll",MsOverflowStyle:"scrollbar"}),document.body.appendChild(e),l=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}else l=0;return l||0}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var i=r(1),a=n(i),l=!1},function(e,t){"use strict";function r(e){return"string"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(){return!1}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t){"use strict";function r(e){return function(){return e}}var n=function(){};n.thatReturns=r,n.thatReturnsFalse=r(!1),n.thatReturnsTrue=r(!0),n.thatReturnsNull=r(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},function(e,t,r){"use strict";function n(e,t,r,n,i,a,l,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,i,a,l,u],d=0;c=new Error(t.replace(/%s/g,function(){return s[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=n},function(e,t,r){(function(t){(function(){var r,n,o;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(r()-o)/1e6},n=t.hrtime,r=function(){var e;return e=n(),1e9*e[0]+e[1]},o=r()):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(t,r(16))},function(e,t){var r=null,n=["Webkit","Moz","O","ms"];e.exports=function(e){r||(r=document.createElement("div"));var t=r.style;if(e in t)return e;for(var o=e.charAt(0).toUpperCase()+e.slice(1),i=n.length;i>=0;i--){var a=n[i]+o;if(a in t)return a}return!1}},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(s===setTimeout)return setTimeout(e,0);if((s===r||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===n||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){p&&h&&(p=!1,h.length?v=h.concat(v):m=-1,v.length&&l())}function l(){if(!p){var e=o(a);p=!0;for(var t=v.length;t;){for(h=v,v=[];++m<t;)h&&h[m].run();m=-1,t=v.length}h=null,p=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var s,d,f=e.exports={};!function(){try{s="function"==typeof setTimeout?setTimeout:r}catch(e){s=r}try{d="function"==typeof clearTimeout?clearTimeout:n}catch(e){d=n}}();var h,v=[],p=!1,m=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];v.push(new u(e,t)),1!==v.length||p||o(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=c,f.addListener=c,f.once=c,f.off=c,f.removeListener=c,f.removeAllListeners=c,f.emit=c,f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(12),o=r(13);e.exports=function(){function e(){o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){e.exports=r(17)()},function(e,t,r){(function(t){for(var n=r(14),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",l=o["request"+a],u=o["cancel"+a]||o["cancelRequest"+a],c=0;!l&&c<i.length;c++)l=o[i[c]+"Request"+a],u=o[i[c]+"Cancel"+a]||o[i[c]+"CancelRequest"+a];if(!l||!u){var s=0,d=0,f=[],h=1e3/60;l=function(e){if(0===f.length){var t=n(),r=Math.max(0,h-(t-s));s=r+t,setTimeout(function(){var e=f.slice(0);f.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(s)}catch(e){setTimeout(function(){throw e},0)}},Math.round(r))}return f.push({handle:++d,callback:e,cancelled:!1}),d},u=function(e){for(var t=0;t<f.length;t++)f[t].handle===e&&(f[t].cancelled=!0)}}e.exports=function(e){return l.call(o,e)},e.exports.cancel=function(){u.apply(o,arguments)},e.exports.polyfill=function(){o.requestAnimationFrame=l,o.cancelAnimationFrame=u}}).call(t,function(){return this}())},function(e,t,r){function n(e){return o(e).replace(/\s(\w)/g,function(e,t){return t.toUpperCase()})}var o=r(22);e.exports=n},function(e,t){function r(e){return i.test(e)?e.toLowerCase():a.test(e)?(n(e)||e).toLowerCase():l.test(e)?o(e).toLowerCase():e.toLowerCase()}function n(e){return e.replace(u,function(e,t){return t?" "+t:""})}function o(e){return e.replace(c,function(e,t,r){return t+" "+r.toLowerCase().split("").join(" ")})}e.exports=r;var i=/\s/,a=/(_|-|\.|:)/,l=/([a-z][A-Z]|[A-Z][a-z])/,u=/[\W_]+(.|$)/g,c=/(.)([A-Z]+)/g},function(e,t,r){function n(e){return o(e).replace(/[\W_]+(.|$)/g,function(e,t){return t?" "+t:""}).trim()}var o=r(21);e.exports=n}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactCustomScrollbars=t(require("react")):e.ReactCustomScrollbars=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Scrollbars=void 0;var o=n(5),i=r(o);t["default"]=i["default"],t.Scrollbars=i["default"]},function(e,t,n){function r(e,t,n){var r=c[t];if("undefined"==typeof r&&(r=i(t)),r){if(void 0===n)return e.style[r];e.style[r]=s(r,n)}}function o(e,t){for(var n in t)t.hasOwnProperty(n)&&r(e,n,t[n])}function i(e){var t=u(e),n=a(t);return c[t]=c[e]=c[n]=n,n}function l(){2===arguments.length?"string"==typeof arguments[1]?arguments[0].style.cssText=arguments[1]:o(arguments[0],arguments[1]):r(arguments[0],arguments[1],arguments[2])}var a=n(15),u=n(21),c={"float":"cssFloat"},s=n(3);e.exports=l,e.exports.set=l,e.exports.get=function(e,t){return Array.isArray(t)?t.reduce(function(t,n){return t[n]=r(e,n||""),t},{}):r(e,t||"")}},function(t,n){t.exports=e},function(e,t){var n={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=function(e,t){return"number"!=typeof t||n[e]?t:t+"px"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){return h["default"].createElement("div",e)}function l(e){var t=e.style,n=o(e,["style"]),r=s({},t,{right:2,bottom:2,left:2,borderRadius:3});return h["default"].createElement("div",s({style:r},n))}function a(e){var t=e.style,n=o(e,["style"]),r=s({},t,{right:2,bottom:2,top:2,borderRadius:3});return h["default"].createElement("div",s({style:r},n))}function u(e){var t=e.style,n=o(e,["style"]),r=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return h["default"].createElement("div",s({style:r},n))}function c(e){var t=e.style,n=o(e,["style"]),r=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return h["default"].createElement("div",s({style:r},n))}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.renderViewDefault=i,t.renderTrackHorizontalDefault=l,t.renderTrackVerticalDefault=a,t.renderThumbHorizontalDefault=u,t.renderThumbVerticalDefault=c;var d=n(2),h=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(20),d=r(s),h=n(1),f=r(h),v=n(2),p=n(18),m=r(p),g=n(10),y=r(g),b=n(9),T=r(b),k=n(11),w=r(k),S=n(8),H=r(S),M=n(7),D=r(M),L=n(6),z=n(4),E=function(e){function t(e){var n;i(this,t);for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];var u=l(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this,e].concat(o)));return u.getScrollLeft=u.getScrollLeft.bind(u),u.getScrollTop=u.getScrollTop.bind(u),u.getScrollWidth=u.getScrollWidth.bind(u),u.getScrollHeight=u.getScrollHeight.bind(u),u.getClientWidth=u.getClientWidth.bind(u),u.getClientHeight=u.getClientHeight.bind(u),u.getValues=u.getValues.bind(u),u.getThumbHorizontalWidth=u.getThumbHorizontalWidth.bind(u),u.getThumbVerticalHeight=u.getThumbVerticalHeight.bind(u),u.getScrollLeftForOffset=u.getScrollLeftForOffset.bind(u),u.getScrollTopForOffset=u.getScrollTopForOffset.bind(u),u.scrollLeft=u.scrollLeft.bind(u),u.scrollTop=u.scrollTop.bind(u),u.scrollToLeft=u.scrollToLeft.bind(u),u.scrollToTop=u.scrollToTop.bind(u),u.scrollToRight=u.scrollToRight.bind(u),u.scrollToBottom=u.scrollToBottom.bind(u),u.handleTrackMouseEnter=u.handleTrackMouseEnter.bind(u),u.handleTrackMouseLeave=u.handleTrackMouseLeave.bind(u),u.handleHorizontalTrackMouseDown=u.handleHorizontalTrackMouseDown.bind(u),u.handleVerticalTrackMouseDown=u.handleVerticalTrackMouseDown.bind(u),u.handleHorizontalThumbMouseDown=u.handleHorizontalThumbMouseDown.bind(u),u.handleVerticalThumbMouseDown=u.handleVerticalThumbMouseDown.bind(u),u.handleWindowResize=u.handleWindowResize.bind(u),u.handleScroll=u.handleScroll.bind(u),u.handleDrag=u.handleDrag.bind(u),u.handleDragEnd=u.handleDragEnd.bind(u),u.state={didMountUniversal:!1},u}return a(t,e),c(t,[{key:"componentDidMount",value:function(){this.addListeners(),this.update(),this.componentDidMountUniversal()}},{key:"componentDidMountUniversal",value:function(){var e=this.props.universal;e&&this.setState({didMountUniversal:!0})}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"componentWillUnmount",value:function(){this.removeListeners(),(0,s.cancel)(this.requestFrame),clearTimeout(this.hideTracksTimeout),clearInterval(this.detectScrollingInterval)}},{key:"getScrollLeft",value:function(){return this.view.scrollLeft}},{key:"getScrollTop",value:function(){return this.view.scrollTop}},{key:"getScrollWidth",value:function(){return this.view.scrollWidth}},{key:"getScrollHeight",value:function(){return this.view.scrollHeight}},{key:"getClientWidth",value:function(){return this.view.clientWidth}},{key:"getClientHeight",value:function(){return this.view.clientHeight}},{key:"getValues",value:function(){var e=this.view,t=e.scrollLeft,n=e.scrollTop,r=e.scrollWidth,o=e.scrollHeight,i=e.clientWidth,l=e.clientHeight;return{left:t/(r-i)||0,top:n/(o-l)||0,scrollLeft:t,scrollTop:n,scrollWidth:r,scrollHeight:o,clientWidth:i,clientHeight:l}}},{key:"getThumbHorizontalWidth",value:function(){var e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,o=r.scrollWidth,i=r.clientWidth,l=(0,H["default"])(this.trackHorizontal),a=Math.ceil(i/o*l);return l===a?0:t?t:Math.max(a,n)}},{key:"getThumbVerticalHeight",value:function(){var e=this.props,t=e.thumbSize,n=e.thumbMinSize,r=this.view,o=r.scrollHeight,i=r.clientHeight,l=(0,D["default"])(this.trackVertical),a=Math.ceil(i/o*l);return l===a?0:t?t:Math.max(a,n)}},{key:"getScrollLeftForOffset",value:function(e){var t=this.view,n=t.scrollWidth,r=t.clientWidth,o=(0,H["default"])(this.trackHorizontal),i=this.getThumbHorizontalWidth();return e/(o-i)*(n-r)}},{key:"getScrollTopForOffset",value:function(e){var t=this.view,n=t.scrollHeight,r=t.clientHeight,o=(0,D["default"])(this.trackVertical),i=this.getThumbVerticalHeight();return e/(o-i)*(n-r)}},{key:"scrollLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view.scrollLeft=e}},{key:"scrollTop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.view.scrollTop=e}},{key:"scrollToLeft",value:function(){this.view.scrollLeft=0}},{key:"scrollToTop",value:function(){this.view.scrollTop=0}},{key:"scrollToRight",value:function(){this.view.scrollLeft=this.view.scrollWidth}},{key:"scrollToBottom",value:function(){this.view.scrollTop=this.view.scrollHeight}},{key:"addListeners",value:function(){if("undefined"!=typeof document){var e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,o=this.thumbVertical;e.addEventListener("scroll",this.handleScroll),(0,T["default"])()&&(t.addEventListener("mouseenter",this.handleTrackMouseEnter),t.addEventListener("mouseleave",this.handleTrackMouseLeave),t.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.addEventListener("mouseenter",this.handleTrackMouseEnter),n.addEventListener("mouseleave",this.handleTrackMouseLeave),n.addEventListener("mousedown",this.handleVerticalTrackMouseDown),r.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),o.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}}},{key:"removeListeners",value:function(){if("undefined"!=typeof document){var e=this.view,t=this.trackHorizontal,n=this.trackVertical,r=this.thumbHorizontal,o=this.thumbVertical;e.removeEventListener("scroll",this.handleScroll),(0,T["default"])()&&(t.removeEventListener("mouseenter",this.handleTrackMouseEnter),t.removeEventListener("mouseleave",this.handleTrackMouseLeave),t.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),n.removeEventListener("mouseenter",this.handleTrackMouseEnter),n.removeEventListener("mouseleave",this.handleTrackMouseLeave),n.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),r.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),o.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}}},{key:"handleScroll",value:function(e){var t=this,n=this.props,r=n.onScroll,o=n.onScrollFrame;r&&r(e),this.update(function(e){var n=e.scrollLeft,r=e.scrollTop;t.viewScrollLeft=n,t.viewScrollTop=r,o&&o(e)}),this.detectScrolling()}},{key:"handleScrollStart",value:function(){var e=this.props.onScrollStart;e&&e(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){var e=this.props.autoHide;e&&this.showTracks()}},{key:"handleScrollStop",value:function(){var e=this.props.onScrollStop;e&&e(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){var e=this.props.autoHide;e&&this.hideTracks()}},{key:"handleWindowResize",value:function(){this.update()}},{key:"handleHorizontalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,n=e.clientX,r=t.getBoundingClientRect(),o=r.left,i=this.getThumbHorizontalWidth(),l=Math.abs(o-n)-i/2;this.view.scrollLeft=this.getScrollLeftForOffset(l)}},{key:"handleVerticalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,n=e.clientY,r=t.getBoundingClientRect(),o=r.top,i=this.getThumbVerticalHeight(),l=Math.abs(o-n)-i/2;this.view.scrollTop=this.getScrollTopForOffset(l)}},{key:"handleHorizontalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,n=e.clientX,r=t.offsetWidth,o=t.getBoundingClientRect(),i=o.left;this.prevPageX=r-(n-i)}},{key:"handleVerticalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,n=e.clientY,r=t.offsetHeight,o=t.getBoundingClientRect(),i=o.top;this.prevPageY=r-(n-i)}},{key:"setupDragging",value:function(){(0,f["default"])(document.body,L.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=w["default"]}},{key:"teardownDragging",value:function(){(0,f["default"])(document.body,L.disableSelectStyleReset),document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleDragEnd),document.onselectstart=void 0}},{key:"handleDragStart",value:function(e){this.dragging=!0,e.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(e){if(this.prevPageX){var t=e.clientX,n=this.trackHorizontal.getBoundingClientRect(),r=n.left,o=this.getThumbHorizontalWidth(),i=o-this.prevPageX,l=-r+t-i;this.view.scrollLeft=this.getScrollLeftForOffset(l)}if(this.prevPageY){var a=e.clientY,u=this.trackVertical.getBoundingClientRect(),c=u.top,s=this.getThumbVerticalHeight(),d=s-this.prevPageY,h=-c+a-d;this.view.scrollTop=this.getScrollTopForOffset(h)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){var e=this.props.autoHide;e&&this.hideTracks()}},{key:"handleTrackMouseEnter",value:function(){this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide()}},{key:"handleTrackMouseEnterAutoHide",value:function(){var e=this.props.autoHide;e&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide()}},{key:"handleTrackMouseLeaveAutoHide",value:function(){var e=this.props.autoHide;e&&this.hideTracks()}},{key:"showTracks",value:function(){clearTimeout(this.hideTracksTimeout),(0,f["default"])(this.trackHorizontal,{opacity:1}),(0,f["default"])(this.trackVertical,{opacity:1})}},{key:"hideTracks",value:function(){var e=this;if(!this.dragging&&!this.scrolling&&!this.trackMouseOver){var t=this.props.autoHideTimeout;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout(function(){(0,f["default"])(e.trackHorizontal,{opacity:0}),(0,f["default"])(e.trackVertical,{opacity:0})},t)}}},{key:"detectScrolling",value:function(){var e=this;this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval(function(){e.lastViewScrollLeft===e.viewScrollLeft&&e.lastViewScrollTop===e.viewScrollTop&&(clearInterval(e.detectScrollingInterval),e.scrolling=!1,e.handleScrollStop()),e.lastViewScrollLeft=e.viewScrollLeft,e.lastViewScrollTop=e.viewScrollTop},100))}},{key:"raf",value:function(e){var t=this;this.requestFrame&&d["default"].cancel(this.requestFrame),this.requestFrame=(0,d["default"])(function(){t.requestFrame=void 0,e()})}},{key:"update",value:function(e){var t=this;this.raf(function(){return t._update(e)})}},{key:"_update",value:function(e){var t=this.props,n=t.onUpdate,r=t.hideTracksWhenNotNeeded,o=this.getValues();if((0,T["default"])()){var i=o.scrollLeft,l=o.clientWidth,a=o.scrollWidth,u=(0,H["default"])(this.trackHorizontal),c=this.getThumbHorizontalWidth(),s=i/(a-l)*(u-c),d={width:c,transform:"translateX("+s+"px)"},h=o.scrollTop,v=o.clientHeight,p=o.scrollHeight,m=(0,D["default"])(this.trackVertical),g=this.getThumbVerticalHeight(),y=h/(p-v)*(m-g),b={height:g,transform:"translateY("+y+"px)"};if(r){var k={visibility:a>l?"visible":"hidden"},w={visibility:p>v?"visible":"hidden"};(0,f["default"])(this.trackHorizontal,k),(0,f["default"])(this.trackVertical,w)}(0,f["default"])(this.thumbHorizontal,d),(0,f["default"])(this.thumbVertical,b)}n&&n(o),"function"==typeof e&&e(o)}},{key:"render",value:function(){var e=this,t=(0,T["default"])(),n=this.props,r=(n.onScroll,n.onScrollFrame,n.onScrollStart,n.onScrollStop,n.onUpdate,n.renderView),i=n.renderTrackHorizontal,l=n.renderTrackVertical,a=n.renderThumbHorizontal,c=n.renderThumbVertical,s=n.tagName,d=(n.hideTracksWhenNotNeeded,n.autoHide),h=(n.autoHideTimeout,n.autoHideDuration),f=(n.thumbSize,n.thumbMinSize,n.universal),p=n.autoHeight,m=n.autoHeightMin,g=n.autoHeightMax,b=n.style,k=n.children,w=o(n,["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","universal","autoHeight","autoHeightMin","autoHeightMax","style","children"]),S=this.state.didMountUniversal,H=u({},L.containerStyleDefault,p&&u({},L.containerStyleAutoHeight,{minHeight:m,maxHeight:g}),b),M=u({},L.viewStyleDefault,{marginRight:t?-t:0,marginBottom:t?-t:0},p&&u({},L.viewStyleAutoHeight,{minHeight:(0,y["default"])(m)?"calc("+m+" + "+t+"px)":m+t,maxHeight:(0,y["default"])(g)?"calc("+g+" + "+t+"px)":g+t}),p&&f&&!S&&{minHeight:m,maxHeight:g},f&&!S&&L.viewStyleUniversalInitial),D={transition:"opacity "+h+"ms",opacity:0},z=u({},L.trackHorizontalStyleDefault,d&&D,(!t||f&&!S)&&{display:"none"}),E=u({},L.trackVerticalStyleDefault,d&&D,(!t||f&&!S)&&{display:"none"});return(0,v.createElement)(s,u({},w,{style:H,ref:function(t){e.container=t}}),[(0,v.cloneElement)(r({style:M}),{key:"view",ref:function(t){e.view=t}},k),(0,v.cloneElement)(i({style:z}),{key:"trackHorizontal",ref:function(t){e.trackHorizontal=t}},(0,v.cloneElement)(a({style:L.thumbHorizontalStyleDefault}),{ref:function(t){e.thumbHorizontal=t}})),(0,v.cloneElement)(l({style:E}),{key:"trackVertical",ref:function(t){e.trackVertical=t}},(0,v.cloneElement)(c({style:L.thumbVerticalStyleDefault}),{ref:function(t){e.thumbVertical=t}}))])}}]),t}(v.Component);t["default"]=E,E.propTypes={onScroll:m["default"].func,onScrollFrame:m["default"].func,onScrollStart:m["default"].func,onScrollStop:m["default"].func,onUpdate:m["default"].func,renderView:m["default"].func,renderTrackHorizontal:m["default"].func,renderTrackVertical:m["default"].func,renderThumbHorizontal:m["default"].func,renderThumbVertical:m["default"].func,tagName:m["default"].string,thumbSize:m["default"].number,thumbMinSize:m["default"].number,hideTracksWhenNotNeeded:m["default"].bool,autoHide:m["default"].bool,autoHideTimeout:m["default"].number,autoHideDuration:m["default"].number,autoHeight:m["default"].bool,autoHeightMin:m["default"].oneOfType([m["default"].number,m["default"].string]),autoHeightMax:m["default"].oneOfType([m["default"].number,m["default"].string]),universal:m["default"].bool,style:m["default"].object,children:m["default"].node},E.defaultProps={renderView:z.renderViewDefault,renderTrackHorizontal:z.renderTrackHorizontalDefault,renderTrackVertical:z.renderTrackVerticalDefault,renderThumbHorizontal:z.renderThumbHorizontalDefault,renderThumbVertical:z.renderThumbVerticalDefault,tagName:"div",thumbMinSize:30,hideTracksWhenNotNeeded:!1,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,universal:!1}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},t.containerStyleAutoHeight={height:"auto"},t.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"},t.viewStyleAutoHeight={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0},t.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0},t.trackHorizontalStyleDefault={position:"absolute",height:6},t.trackVerticalStyleDefault={position:"absolute",width:6},t.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"},t.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"},t.disableSelectStyle={userSelect:"none"},t.disableSelectStyleReset={userSelect:""}},function(e,t){"use strict";function n(e){var t=e.clientHeight,n=getComputedStyle(e),r=n.paddingTop,o=n.paddingBottom;return t-parseFloat(r)-parseFloat(o)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t){"use strict";function n(e){var t=e.clientWidth,n=getComputedStyle(e),r=n.paddingLeft,o=n.paddingRight;return t-parseFloat(r)-parseFloat(o)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){if(a!==!1)return a;if("undefined"!=typeof document){var e=document.createElement("div");(0,l["default"])(e,{width:100,height:100,position:"absolute",top:-9999,overflow:"scroll",MsOverflowStyle:"scrollbar"}),document.body.appendChild(e),a=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}else a=0;return a||0}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o;var i=n(1),l=r(i),a=!1},function(e,t){"use strict";function n(e){return"string"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t){"use strict";function n(){return!1}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,i,l,a,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,i,l,a,u],d=0;c=new Error(t.replace(/%s/g,function(){return s[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){(function(t){(function(){var n,r,o,i,l,a;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-l)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},i=n(),a=1e9*t.uptime(),l=i-a):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(t,n(16))},function(e,t){var n=null,r=["Webkit","Moz","O","ms"];e.exports=function(e){n||(n=document.createElement("div"));var t=n.style;if(e in t)return e;for(var o=e.charAt(0).toUpperCase()+e.slice(1),i=r.length;i>=0;i--){var l=r[i]+o;if(l in t)return l}return!1}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(s===setTimeout)return setTimeout(e,0);if((s===n||!s)&&setTimeout)return s=setTimeout,setTimeout(e,0);try{return s(e,0)}catch(t){try{return s.call(null,e,0)}catch(t){return s.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function l(){p&&f&&(p=!1,f.length?v=f.concat(v):m=-1,v.length&&a())}function a(){if(!p){var e=o(l);p=!0;for(var t=v.length;t;){for(f=v,v=[];++m<t;)f&&f[m].run();m=-1,t=v.length}f=null,p=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var s,d,h=e.exports={};!function(){try{s="function"==typeof setTimeout?setTimeout:n}catch(e){s=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var f,v=[],p=!1,m=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];v.push(new u(e,t)),1!==v.length||p||o(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(12),o=n(13),i=n(19);e.exports=function(){function e(e,t,n,r,l,a){a!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){e.exports=n(17)()},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){for(var r=n(14),o="undefined"==typeof window?t:window,i=["moz","webkit"],l="AnimationFrame",a=o["request"+l],u=o["cancel"+l]||o["cancelRequest"+l],c=0;!a&&c<i.length;c++)a=o[i[c]+"Request"+l],u=o[i[c]+"Cancel"+l]||o[i[c]+"CancelRequest"+l];if(!a||!u){var s=0,d=0,h=[],f=1e3/60;a=function(e){if(0===h.length){var t=r(),n=Math.max(0,f-(t-s));s=n+t,setTimeout(function(){var e=h.slice(0);h.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(s)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return h.push({handle:++d,callback:e,cancelled:!1}),d},u=function(e){for(var t=0;t<h.length;t++)h[t].handle===e&&(h[t].cancelled=!0)}}e.exports=function(e){return a.call(o,e)},e.exports.cancel=function(){u.apply(o,arguments)},e.exports.polyfill=function(){o.requestAnimationFrame=a,o.cancelAnimationFrame=u}}).call(t,function(){return this}())},function(e,t,n){function r(e){return o(e).replace(/\s(\w)/g,function(e,t){return t.toUpperCase()})}var o=n(23);e.exports=r},function(e,t){function n(e){return i.test(e)?e.toLowerCase():l.test(e)?(r(e)||e).toLowerCase():a.test(e)?o(e).toLowerCase():e.toLowerCase()}function r(e){return e.replace(u,function(e,t){return t?" "+t:""})}function o(e){return e.replace(c,function(e,t,n){return t+" "+n.toLowerCase().split("").join(" ")})}e.exports=n;var i=/\s/,l=/(_|-|\.|:)/,a=/([a-z][A-Z]|[A-Z][a-z])/,u=/[\W_]+(.|$)/g,c=/(.)([A-Z]+)/g},function(e,t,n){function r(e){return o(e).replace(/[\W_]+(.|$)/g,function(e,t){return t?" "+t:""}).trim()}var o=n(22);e.exports=r}])});

@@ -55,3 +55,3 @@ # Customization

renderTrackHorizontal={({ style, ...props }) =>
<div {...props} style={{ ...style, backgroundColor: 'blue' }}>
<div {...props} style={{ ...style, backgroundColor: 'blue' }}/>
}>

@@ -58,0 +58,0 @@ {this.props.children}

@@ -47,5 +47,5 @@ # Usage

// Called when scrolling stops
onScrollStop={this.handlenScrollStop}>
onScrollStop={this.handlenScrollStop}
// Called when ever the component is updated. Runs inside the animation frame
onUpdate={this.handleUpdate}
onUpdate={this.handleUpdate}>
<p>Some great content...</p>

@@ -52,0 +52,0 @@ </Scrollbars>

@@ -73,2 +73,21 @@ 'use strict';

_this.getScrollLeft = _this.getScrollLeft.bind(_this);
_this.getScrollTop = _this.getScrollTop.bind(_this);
_this.getScrollWidth = _this.getScrollWidth.bind(_this);
_this.getScrollHeight = _this.getScrollHeight.bind(_this);
_this.getClientWidth = _this.getClientWidth.bind(_this);
_this.getClientHeight = _this.getClientHeight.bind(_this);
_this.getValues = _this.getValues.bind(_this);
_this.getThumbHorizontalWidth = _this.getThumbHorizontalWidth.bind(_this);
_this.getThumbVerticalHeight = _this.getThumbVerticalHeight.bind(_this);
_this.getScrollLeftForOffset = _this.getScrollLeftForOffset.bind(_this);
_this.getScrollTopForOffset = _this.getScrollTopForOffset.bind(_this);
_this.scrollLeft = _this.scrollLeft.bind(_this);
_this.scrollTop = _this.scrollTop.bind(_this);
_this.scrollToLeft = _this.scrollToLeft.bind(_this);
_this.scrollToTop = _this.scrollToTop.bind(_this);
_this.scrollToRight = _this.scrollToRight.bind(_this);
_this.scrollToBottom = _this.scrollToBottom.bind(_this);
_this.handleTrackMouseEnter = _this.handleTrackMouseEnter.bind(_this);

@@ -123,5 +142,3 @@ _this.handleTrackMouseLeave = _this.handleTrackMouseLeave.bind(_this);

value: function getScrollLeft() {
var view = this.refs.view;
return view.scrollLeft;
return this.view.scrollLeft;
}

@@ -131,5 +148,3 @@ }, {

value: function getScrollTop() {
var view = this.refs.view;
return view.scrollTop;
return this.view.scrollTop;
}

@@ -139,5 +154,3 @@ }, {

value: function getScrollWidth() {
var view = this.refs.view;
return view.scrollWidth;
return this.view.scrollWidth;
}

@@ -147,5 +160,3 @@ }, {

value: function getScrollHeight() {
var view = this.refs.view;
return view.scrollHeight;
return this.view.scrollHeight;
}

@@ -155,5 +166,3 @@ }, {

value: function getClientWidth() {
var view = this.refs.view;
return view.clientWidth;
return this.view.clientWidth;
}

@@ -163,5 +172,3 @@ }, {

value: function getClientHeight() {
var view = this.refs.view;
return view.clientHeight;
return this.view.clientHeight;
}

@@ -171,9 +178,9 @@ }, {

value: function getValues() {
var view = this.refs.view;
var scrollLeft = view.scrollLeft,
scrollTop = view.scrollTop,
scrollWidth = view.scrollWidth,
scrollHeight = view.scrollHeight,
clientWidth = view.clientWidth,
clientHeight = view.clientHeight;
var _view = this.view,
scrollLeft = _view.scrollLeft,
scrollTop = _view.scrollTop,
scrollWidth = _view.scrollWidth,
scrollHeight = _view.scrollHeight,
clientWidth = _view.clientWidth,
clientHeight = _view.clientHeight;

@@ -198,9 +205,7 @@

thumbMinSize = _props.thumbMinSize;
var _refs = this.refs,
view = _refs.view,
trackHorizontal = _refs.trackHorizontal;
var scrollWidth = view.scrollWidth,
clientWidth = view.clientWidth;
var _view2 = this.view,
scrollWidth = _view2.scrollWidth,
clientWidth = _view2.clientWidth;
var trackWidth = (0, _getInnerWidth2["default"])(trackHorizontal);
var trackWidth = (0, _getInnerWidth2["default"])(this.trackHorizontal);
var width = Math.ceil(clientWidth / scrollWidth * trackWidth);

@@ -217,9 +222,7 @@ if (trackWidth === width) return 0;

thumbMinSize = _props2.thumbMinSize;
var _refs2 = this.refs,
view = _refs2.view,
trackVertical = _refs2.trackVertical;
var scrollHeight = view.scrollHeight,
clientHeight = view.clientHeight;
var _view3 = this.view,
scrollHeight = _view3.scrollHeight,
clientHeight = _view3.clientHeight;
var trackHeight = (0, _getInnerHeight2["default"])(trackVertical);
var trackHeight = (0, _getInnerHeight2["default"])(this.trackVertical);
var height = Math.ceil(clientHeight / scrollHeight * trackHeight);

@@ -233,9 +236,7 @@ if (trackHeight === height) return 0;

value: function getScrollLeftForOffset(offset) {
var _refs3 = this.refs,
view = _refs3.view,
trackHorizontal = _refs3.trackHorizontal;
var scrollWidth = view.scrollWidth,
clientWidth = view.clientWidth;
var _view4 = this.view,
scrollWidth = _view4.scrollWidth,
clientWidth = _view4.clientWidth;
var trackWidth = (0, _getInnerWidth2["default"])(trackHorizontal);
var trackWidth = (0, _getInnerWidth2["default"])(this.trackHorizontal);
var thumbWidth = this.getThumbHorizontalWidth();

@@ -247,9 +248,7 @@ return offset / (trackWidth - thumbWidth) * (scrollWidth - clientWidth);

value: function getScrollTopForOffset(offset) {
var _refs4 = this.refs,
view = _refs4.view,
trackVertical = _refs4.trackVertical;
var scrollHeight = view.scrollHeight,
clientHeight = view.clientHeight;
var _view5 = this.view,
scrollHeight = _view5.scrollHeight,
clientHeight = _view5.clientHeight;
var trackHeight = (0, _getInnerHeight2["default"])(trackVertical);
var trackHeight = (0, _getInnerHeight2["default"])(this.trackVertical);
var thumbHeight = this.getThumbVerticalHeight();

@@ -262,5 +261,4 @@ return offset / (trackHeight - thumbHeight) * (scrollHeight - clientHeight);

var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var view = this.refs.view;
view.scrollLeft = left;
this.view.scrollLeft = left;
}

@@ -271,5 +269,4 @@ }, {

var top = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var view = this.refs.view;
view.scrollTop = top;
this.view.scrollTop = top;
}

@@ -279,5 +276,3 @@ }, {

value: function scrollToLeft() {
var view = this.refs.view;
view.scrollLeft = 0;
this.view.scrollLeft = 0;
}

@@ -287,5 +282,3 @@ }, {

value: function scrollToTop() {
var view = this.refs.view;
view.scrollTop = 0;
this.view.scrollTop = 0;
}

@@ -295,5 +288,3 @@ }, {

value: function scrollToRight() {
var view = this.refs.view;
view.scrollLeft = view.scrollWidth;
this.view.scrollLeft = this.view.scrollWidth;
}

@@ -303,5 +294,3 @@ }, {

value: function scrollToBottom() {
var view = this.refs.view;
view.scrollTop = view.scrollHeight;
this.view.scrollTop = this.view.scrollHeight;
}

@@ -313,8 +302,7 @@ }, {

if (typeof document === 'undefined') return;
var _refs5 = this.refs,
view = _refs5.view,
trackHorizontal = _refs5.trackHorizontal,
trackVertical = _refs5.trackVertical,
thumbHorizontal = _refs5.thumbHorizontal,
thumbVertical = _refs5.thumbVertical;
var view = this.view,
trackHorizontal = this.trackHorizontal,
trackVertical = this.trackVertical,
thumbHorizontal = this.thumbHorizontal,
thumbVertical = this.thumbVertical;

@@ -338,8 +326,7 @@ view.addEventListener('scroll', this.handleScroll);

if (typeof document === 'undefined') return;
var _refs6 = this.refs,
view = _refs6.view,
trackHorizontal = _refs6.trackHorizontal,
trackVertical = _refs6.trackVertical,
thumbHorizontal = _refs6.thumbHorizontal,
thumbVertical = _refs6.thumbVertical;
var view = this.view,
trackHorizontal = this.trackHorizontal,
trackVertical = this.trackVertical,
thumbHorizontal = this.thumbHorizontal,
thumbVertical = this.thumbVertical;

@@ -421,3 +408,2 @@ view.removeEventListener('scroll', this.handleScroll);

event.preventDefault();
var view = this.refs.view;
var target = event.target,

@@ -431,3 +417,3 @@ clientX = event.clientX;

var offset = Math.abs(targetLeft - clientX) - thumbWidth / 2;
view.scrollLeft = this.getScrollLeftForOffset(offset);
this.view.scrollLeft = this.getScrollLeftForOffset(offset);
}

@@ -438,3 +424,2 @@ }, {

event.preventDefault();
var view = this.refs.view;
var target = event.target,

@@ -448,3 +433,3 @@ clientY = event.clientY;

var offset = Math.abs(targetTop - clientY) - thumbHeight / 2;
view.scrollTop = this.getScrollTopForOffset(offset);
this.view.scrollTop = this.getScrollTopForOffset(offset);
}

@@ -507,7 +492,4 @@ }, {

var clientX = event.clientX;
var _refs7 = this.refs,
view = _refs7.view,
trackHorizontal = _refs7.trackHorizontal;
var _trackHorizontal$getB = trackHorizontal.getBoundingClientRect(),
var _trackHorizontal$getB = this.trackHorizontal.getBoundingClientRect(),
trackLeft = _trackHorizontal$getB.left;

@@ -518,11 +500,8 @@

var offset = -trackLeft + clientX - clickPosition;
view.scrollLeft = this.getScrollLeftForOffset(offset);
this.view.scrollLeft = this.getScrollLeftForOffset(offset);
}
if (this.prevPageY) {
var clientY = event.clientY;
var _refs8 = this.refs,
_view = _refs8.view,
trackVertical = _refs8.trackVertical;
var _trackVertical$getBou = trackVertical.getBoundingClientRect(),
var _trackVertical$getBou = this.trackVertical.getBoundingClientRect(),
trackTop = _trackVertical$getBou.top;

@@ -533,3 +512,3 @@

var _offset = -trackTop + clientY - _clickPosition;
_view.scrollTop = this.getScrollTopForOffset(_offset);
this.view.scrollTop = this.getScrollTopForOffset(_offset);
}

@@ -585,9 +564,5 @@ return false;

value: function showTracks() {
var _refs9 = this.refs,
trackHorizontal = _refs9.trackHorizontal,
trackVertical = _refs9.trackVertical;
clearTimeout(this.hideTracksTimeout);
(0, _domCss2["default"])(trackHorizontal, { opacity: 1 });
(0, _domCss2["default"])(trackVertical, { opacity: 1 });
(0, _domCss2["default"])(this.trackHorizontal, { opacity: 1 });
(0, _domCss2["default"])(this.trackVertical, { opacity: 1 });
}

@@ -597,2 +572,4 @@ }, {

value: function hideTracks() {
var _this3 = this;
if (this.dragging) return;

@@ -602,10 +579,7 @@ if (this.scrolling) return;

var autoHideTimeout = this.props.autoHideTimeout;
var _refs10 = this.refs,
trackHorizontal = _refs10.trackHorizontal,
trackVertical = _refs10.trackVertical;
clearTimeout(this.hideTracksTimeout);
this.hideTracksTimeout = setTimeout(function () {
(0, _domCss2["default"])(trackHorizontal, { opacity: 0 });
(0, _domCss2["default"])(trackVertical, { opacity: 0 });
(0, _domCss2["default"])(_this3.trackHorizontal, { opacity: 0 });
(0, _domCss2["default"])(_this3.trackVertical, { opacity: 0 });
}, autoHideTimeout);

@@ -616,3 +590,3 @@ }

value: function detectScrolling() {
var _this3 = this;
var _this4 = this;

@@ -623,9 +597,9 @@ if (this.scrolling) return;

this.detectScrollingInterval = setInterval(function () {
if (_this3.lastViewScrollLeft === _this3.viewScrollLeft && _this3.lastViewScrollTop === _this3.viewScrollTop) {
clearInterval(_this3.detectScrollingInterval);
_this3.scrolling = false;
_this3.handleScrollStop();
if (_this4.lastViewScrollLeft === _this4.viewScrollLeft && _this4.lastViewScrollTop === _this4.viewScrollTop) {
clearInterval(_this4.detectScrollingInterval);
_this4.scrolling = false;
_this4.handleScrollStop();
}
_this3.lastViewScrollLeft = _this3.viewScrollLeft;
_this3.lastViewScrollTop = _this3.viewScrollTop;
_this4.lastViewScrollLeft = _this4.viewScrollLeft;
_this4.lastViewScrollTop = _this4.viewScrollTop;
}, 100);

@@ -636,7 +610,7 @@ }

value: function raf(callback) {
var _this4 = this;
var _this5 = this;
if (this.requestFrame) _raf3["default"].cancel(this.requestFrame);
this.requestFrame = (0, _raf3["default"])(function () {
_this4.requestFrame = undefined;
_this5.requestFrame = undefined;
callback();

@@ -648,6 +622,6 @@ });

value: function update(callback) {
var _this5 = this;
var _this6 = this;
this.raf(function () {
return _this5._update(callback);
return _this6._update(callback);
});

@@ -664,7 +638,2 @@ }

if ((0, _getScrollbarWidth2["default"])()) {
var _refs11 = this.refs,
thumbHorizontal = _refs11.thumbHorizontal,
thumbVertical = _refs11.thumbVertical,
trackHorizontal = _refs11.trackHorizontal,
trackVertical = _refs11.trackVertical;
var scrollLeft = values.scrollLeft,

@@ -674,3 +643,3 @@ clientWidth = values.clientWidth,

var trackHorizontalWidth = (0, _getInnerWidth2["default"])(trackHorizontal);
var trackHorizontalWidth = (0, _getInnerWidth2["default"])(this.trackHorizontal);
var thumbHorizontalWidth = this.getThumbHorizontalWidth();

@@ -686,3 +655,3 @@ var thumbHorizontalX = scrollLeft / (scrollWidth - clientWidth) * (trackHorizontalWidth - thumbHorizontalWidth);

var trackVerticalHeight = (0, _getInnerHeight2["default"])(trackVertical);
var trackVerticalHeight = (0, _getInnerHeight2["default"])(this.trackVertical);
var thumbVerticalHeight = this.getThumbVerticalHeight();

@@ -701,7 +670,7 @@ var thumbVerticalY = scrollTop / (scrollHeight - clientHeight) * (trackVerticalHeight - thumbVerticalHeight);

};
(0, _domCss2["default"])(trackHorizontal, trackHorizontalStyle);
(0, _domCss2["default"])(trackVertical, trackVerticalStyle);
(0, _domCss2["default"])(this.trackHorizontal, trackHorizontalStyle);
(0, _domCss2["default"])(this.trackVertical, trackVerticalStyle);
}
(0, _domCss2["default"])(thumbHorizontal, thumbHorizontalStyle);
(0, _domCss2["default"])(thumbVertical, thumbVerticalStyle);
(0, _domCss2["default"])(this.thumbHorizontal, thumbHorizontalStyle);
(0, _domCss2["default"])(this.thumbVertical, thumbVerticalStyle);
}

@@ -715,2 +684,4 @@ if (onUpdate) onUpdate(values);

value: function render() {
var _this7 = this;
var scrollbarWidth = (0, _getScrollbarWidth2["default"])();

@@ -780,3 +751,15 @@ /* eslint-disable no-unused-vars */

return (0, _react.createElement)(tagName, _extends({}, props, { style: containerStyle, ref: 'container' }), [(0, _react.cloneElement)(renderView({ style: viewStyle }), { key: 'view', ref: 'view' }, children), (0, _react.cloneElement)(renderTrackHorizontal({ style: trackHorizontalStyle }), { key: 'trackHorizontal', ref: 'trackHorizontal' }, (0, _react.cloneElement)(renderThumbHorizontal({ style: _styles.thumbHorizontalStyleDefault }), { ref: 'thumbHorizontal' })), (0, _react.cloneElement)(renderTrackVertical({ style: trackVerticalStyle }), { key: 'trackVertical', ref: 'trackVertical' }, (0, _react.cloneElement)(renderThumbVertical({ style: _styles.thumbVerticalStyleDefault }), { ref: 'thumbVertical' }))]);
return (0, _react.createElement)(tagName, _extends({}, props, { style: containerStyle, ref: function ref(_ref2) {
_this7.container = _ref2;
} }), [(0, _react.cloneElement)(renderView({ style: viewStyle }), { key: 'view', ref: function ref(_ref3) {
_this7.view = _ref3;
} }, children), (0, _react.cloneElement)(renderTrackHorizontal({ style: trackHorizontalStyle }), { key: 'trackHorizontal', ref: function ref(_ref4) {
_this7.trackHorizontal = _ref4;
} }, (0, _react.cloneElement)(renderThumbHorizontal({ style: _styles.thumbHorizontalStyleDefault }), { ref: function ref(_ref5) {
_this7.thumbHorizontal = _ref5;
} })), (0, _react.cloneElement)(renderTrackVertical({ style: trackVerticalStyle }), { key: 'trackVertical', ref: function ref(_ref6) {
_this7.trackVertical = _ref6;
} }, (0, _react.cloneElement)(renderThumbVertical({ style: _styles.thumbVerticalStyleDefault }), { ref: function ref(_ref7) {
_this7.thumbVertical = _ref7;
} }))]);
}

@@ -783,0 +766,0 @@ }]);

{
"name": "react-custom-scrollbars",
"version": "4.1.1",
"version": "4.1.2",
"description": "React scrollbars component",

@@ -78,5 +78,5 @@ "main": "lib/index.js",

"dom-css": "^2.0.0",
"prop-types": "^15.5.8",
"prop-types": "^15.5.10",
"raf": "^3.1.0"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc