Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

tt-react-custom-scrollbars

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tt-react-custom-scrollbars - npm Package Compare versions

Comparing version 4.0.1-tt3 to 4.0.1-tt4

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(r){if(i[r])return i[r].exports;var n=i[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Scrollbars=void 0;var n=i(5),o=r(n);t["default"]=o["default"],t.Scrollbars=o["default"]},function(e,t,i){function r(e,t,i){var r=c[t];if("undefined"==typeof r&&(r=o(t)),r){if(void 0===i)return e.style[r];e.style[r]=s(r,i)}}function n(e,t){for(var i in t)t.hasOwnProperty(i)&&r(e,i,t[i])}function o(e){var t=u(e),i=a(t);return c[t]=c[e]=c[i]=i,i}function l(){2===arguments.length?"string"==typeof arguments[1]?arguments[0].style.cssText=arguments[1]:n(arguments[0],arguments[1]):r(arguments[0],arguments[1],arguments[2])}var a=i(15),u=i(21),c={"float":"cssFloat"},s=i(3);e.exports=l,e.exports.set=l,e.exports.get=function(e,t){return Array.isArray(t)?t.reduce(function(t,i){return t[i]=r(e,i||""),t},{}):r(e,t||"")}},function(t,i){t.exports=e},function(e,t){var i={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||i[e]?t:t+"px"}},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){var i={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i}function o(e){return h["default"].createElement("div",e)}function l(e){var t=e.style,i=n(e,["style"]),r=s({},t,{right:2,bottom:2,left:2,borderRadius:3});return h["default"].createElement("div",s({style:r},i))}function a(e){var t=e.style,i=n(e,["style"]),r=s({},t,{right:2,bottom:2,top:2,borderRadius:3});return h["default"].createElement("div",s({style:r},i))}function u(e){var t=e.style,i=n(e,["style"]),r=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return h["default"].createElement("div",s({style:r},i))}function c(e){var t=e.style,i=n(e,["style"]),r=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return h["default"].createElement("div",s({style:r},i))}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e};t.renderViewDefault=o,t.renderTrackHorizontalDefault=l,t.renderTrackVerticalDefault=a,t.renderThumbHorizontalDefault=u,t.renderThumbVerticalDefault=c;var d=i(2),h=r(d)},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){var i={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i}function o(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 i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},c=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=i(20),d=r(s),h=i(1),f=r(h),v=i(2),p=i(18),g=r(p),m=i(10),b=r(m),y=i(9),T=i(11),w=r(T),S=i(8),k=r(S),H=i(7),W=r(H),D=i(6),M=i(4),z=5e3,L=function(e){function t(e){var i;o(this,t);for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var u=l(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this,e].concat(n)));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.getPaddingWidth=u.getPaddingWidth.bind(u),u.getPaddingHeight=u.getPaddingHeight.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.detectScrollbarWidthChange=u.detectScrollbarWidthChange.bind(u),u.pollScrollbarWidth=u.pollScrollbarWidth.bind(u),u.state={didMountUniversal:!1,scrollbarWidth:(0,y.getScrollbarWidth)()},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-this.getPaddingWidth()}},{key:"getScrollHeight",value:function(){return this.view.scrollHeight-this.getPaddingHeight()}},{key:"getClientWidth",value:function(){return this.view.clientWidth-this.getPaddingWidth()}},{key:"getClientHeight",value:function(){return this.view.clientHeight-this.getPaddingHeight()}},{key:"getPaddingWidth",value:function(){return D.scrollbarSize}},{key:"getPaddingHeight",value:function(){return D.scrollbarSize}},{key:"getValues",value:function(){var e=this.view,t=e.scrollLeft,i=e.scrollTop,r=this.view.scrollWidth-this.getPaddingWidth(),n=this.view.scrollHeight-this.getPaddingHeight(),o=this.view.clientWidth-this.getPaddingWidth(),l=this.view.clientHeight-this.getPaddingHeight();return{left:t/(r-o)||0,top:i/(n-l)||0,scrollLeft:t,scrollTop:i,scrollWidth:r,scrollHeight:n,clientWidth:o,clientHeight:l}}},{key:"getThumbHorizontalWidth",value:function(){var e=this.props,t=e.thumbSize,i=e.thumbMinSize,r=this.view.scrollWidth-this.getPaddingWidth(),n=this.view.clientWidth-this.getPaddingWidth(),o=(0,k["default"])(this.trackHorizontal),l=n/r*o;return r<=n?0:t?t:Math.max(l,i)}},{key:"getThumbVerticalHeight",value:function(){var e=this.props,t=e.thumbSize,i=e.thumbMinSize,r=this.view.scrollHeight-this.getPaddingHeight(),n=this.view.clientHeight-this.getPaddingHeight(),o=(0,W["default"])(this.trackVertical),l=n/r*o;return r<=n?0:t?t:Math.max(l,i)}},{key:"getScrollLeftForOffset",value:function(e){var t=this.view.scrollWidth-this.getPaddingWidth(),i=this.view.clientWidth-this.getPaddingWidth(),r=(0,k["default"])(this.trackHorizontal),n=this.getThumbHorizontalWidth();return e/(r-n)*(t-i)}},{key:"getScrollTopForOffset",value:function(e){var t=this.view.scrollHeight-this.getPaddingHeight(),i=this.view.clientHeight-this.getPaddingHeight(),r=(0,W["default"])(this.trackVertical),n=this.getThumbVerticalHeight();return e/(r-n)*(t-i)}},{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-this.getPaddingWidth()}},{key:"scrollToBottom",value:function(){this.view.scrollTop=this.view.scrollHeight-this.getPaddingHeight()}},{key:"addListeners",value:function(){if("undefined"!=typeof document){var e=this.view,t=this.trackHorizontal,i=this.trackVertical,r=this.thumbHorizontal,n=this.thumbVertical;e.addEventListener("scroll",this.handleScroll),t.addEventListener("mouseenter",this.handleTrackMouseEnter),t.addEventListener("mouseleave",this.handleTrackMouseLeave),t.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),i.addEventListener("mouseenter",this.handleTrackMouseEnter),i.addEventListener("mouseleave",this.handleTrackMouseLeave),i.addEventListener("mousedown",this.handleVerticalTrackMouseDown),r.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),n.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize),this.pollScrollbarWidthTimer=setTimeout(this.pollScrollbarWidth,z)}}},{key:"removeListeners",value:function(){if("undefined"!=typeof document){var e=this.view,t=this.trackHorizontal,i=this.trackVertical,r=this.thumbHorizontal,n=this.thumbVertical;e.removeEventListener("scroll",this.handleScroll),t.removeEventListener("mouseenter",this.handleTrackMouseEnter),t.removeEventListener("mouseleave",this.handleTrackMouseLeave),t.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),i.removeEventListener("mouseenter",this.handleTrackMouseEnter),i.removeEventListener("mouseleave",this.handleTrackMouseLeave),i.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),r.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),n.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.pollScrollbarWidthTimer&&clearTimeout(this.pollScrollbarWidthTimer),this.teardownDragging()}}},{key:"pollScrollbarWidth",value:function(){var e=this;this.detectScrollbarWidthChange()?this._update(function(){e.pollScrollbarWidthTimer=setTimeout(e.pollScrollbarWidth,z)}):this.pollScrollbarWidthTimer=setTimeout(this.pollScrollbarWidth,z)}},{key:"detectScrollbarWidthChange",value:function(){(0,y.invalidateScrollbarWidth)();var e=(0,y.getScrollbarWidth)(),t=e!==this.state.scrollbarWidth;return t&&this.setState({scrollbarWidth:e}),t}},{key:"handleScroll",value:function(e){var t=this,i=this.props,r=i.onScroll,n=i.onScrollFrame;r&&r(e),this.update(function(e){var i=e.scrollLeft,r=e.scrollTop;t.viewScrollLeft=i,t.viewScrollTop=r,n&&n(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.detectScrollbarWidthChange(),this.update()}},{key:"handleHorizontalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,i=e.clientX,r=t.getBoundingClientRect(),n=r.left,o=this.getThumbHorizontalWidth(),l=Math.abs(n-i)-o/2;this.view.scrollLeft=this.getScrollLeftForOffset(l)}},{key:"handleVerticalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,i=e.clientY,r=t.getBoundingClientRect(),n=r.top,o=this.getThumbVerticalHeight(),l=Math.abs(n-i)-o/2;this.view.scrollTop=this.getScrollTopForOffset(l)}},{key:"handleHorizontalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,i=e.clientX,r=t.offsetWidth,n=t.getBoundingClientRect(),o=n.left;this.prevPageX=r-(i-o)}},{key:"handleVerticalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,i=e.clientY,r=t.offsetHeight,n=t.getBoundingClientRect(),o=n.top;this.prevPageY=r-(i-o)}},{key:"setupDragging",value:function(){(0,f["default"])(document.body,D.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=w["default"]}},{key:"teardownDragging",value:function(){(0,f["default"])(document.body,D.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,i=this.trackHorizontal.getBoundingClientRect(),r=i.left,n=this.getThumbHorizontalWidth(),o=n-this.prevPageX,l=-r+t-o;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,i=t.onUpdate,r=t.hideTracksWhenNotNeeded;this.container.scrollTop=0,this.container.scrollLeft=0;var n=this.getValues(),o=n.scrollLeft,l=n.clientWidth,a=n.scrollWidth,u=(0,k["default"])(this.trackHorizontal),c=this.getThumbHorizontalWidth(),s=o/(a-l)*(u-c),d={width:c,transform:"translateX("+s+"px)"},h=n.scrollTop,v=n.clientHeight,p=n.scrollHeight,g=(0,W["default"])(this.trackVertical),m=this.getThumbVerticalHeight(),b=h/(p-v)*(g-m),y={height:m,transform:"translateY("+b+"px)"};if(r){var T={visibility:a>l?"visible":"hidden"},w={visibility:p>v?"visible":"hidden"};(0,f["default"])(this.trackHorizontal,T),(0,f["default"])(this.trackVertical,w)}(0,f["default"])(this.thumbHorizontal,d),(0,f["default"])(this.thumbVertical,y),i&&i(n),"function"==typeof e&&e(n)}},{key:"render",value:function(){var e=this,t=this.props,i=(t.onScroll,t.onScrollFrame,t.onScrollStart,t.onScrollStop,t.onUpdate,t.renderView),r=t.renderTrackHorizontal,o=t.renderTrackVertical,l=t.renderThumbHorizontal,a=t.renderThumbVertical,c=t.tagName,s=(t.hideTracksWhenNotNeeded,t.autoHide),d=(t.autoHideTimeout,t.autoHideDuration),h=(t.thumbSize,t.thumbMinSize,t.universal),f=t.autoHeight,p=t.autoHeightMin,g=t.autoHeightMax,m=t.style,y=t.children,T=n(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,S=w.didMountUniversal,k=w.scrollbarWidth,H=u({},D.containerStyleDefault,f&&u({},D.containerStyleAutoHeight,{minHeight:p,maxHeight:g}),m),W=u({},D.viewStyleDefault,{marginRight:-this.getPaddingWidth()+(k?-k:0),marginBottom:-this.getPaddingHeight()+(k?-k:0),width:"calc(100% + "+(D.scrollbarSize+k)+"px)"},f&&u({},D.viewStyleAutoHeight,{minHeight:(0,b["default"])(p)?"calc("+p+" + "+(this.getPaddingHeight()+k)+"px)":p+this.getPaddingHeight()+k,maxHeight:(0,b["default"])(g)?"calc("+g+" + "+(this.getPaddingHeight()+k)+"px)":g+this.getPaddingHeight()+k}),f&&h&&!S&&{minHeight:p,maxHeight:g},h&&!S&&D.viewStyleUniversalInitial),M=u({},D.viewWrapperStyleDefault,f&&u({},D.viewWrapperStyleAutoHeight)),z=u({},D.viewWrappedStyleDefault),L={transition:"opacity "+d+"ms",opacity:0},x=u({},D.trackHorizontalStyleDefault,s&&L,h&&!S&&{display:"none"}),E=u({},D.trackVerticalStyleDefault,s&&L,h&&!S&&{display:"none"});return(0,v.createElement)(c,{className:T.className?T.className:"",style:H,ref:function(t){e.container=t}},[(0,v.createElement)("div",{style:W,key:"view",ref:function(t){e.view=t}},[(0,v.createElement)("div",{style:M,key:"viewWrapper",ref:function(t){e.viewWrapper=t}},[(0,v.cloneElement)(i({style:z}),{key:"viewWrapped",ref:function(t){e.viewWrapped=t}},y)])]),(0,v.cloneElement)(r({style:x}),{key:"trackHorizontal",ref:function(t){e.trackHorizontal=t}},(0,v.cloneElement)(l({style:D.thumbHorizontalStyleDefault}),{ref:function(t){e.thumbHorizontal=t}})),(0,v.cloneElement)(o({style:E}),{key:"trackVertical",ref:function(t){e.trackVertical=t}},(0,v.cloneElement)(a({style:D.thumbVerticalStyleDefault}),{ref:function(t){e.thumbVertical=t}}))])}}]),t}(v.Component);t["default"]=L,L.propTypes={onScroll:g["default"].func,onScrollFrame:g["default"].func,onScrollStart:g["default"].func,onScrollStop:g["default"].func,onUpdate:g["default"].func,renderView:g["default"].func,renderTrackHorizontal:g["default"].func,renderTrackVertical:g["default"].func,renderThumbHorizontal:g["default"].func,renderThumbVertical:g["default"].func,tagName:g["default"].string,thumbSize:g["default"].number,thumbMinSize:g["default"].number,hideTracksWhenNotNeeded:g["default"].bool,autoHide:g["default"].bool,autoHideTimeout:g["default"].number,autoHideDuration:g["default"].number,autoHeight:g["default"].bool,autoHeightMin:g["default"].oneOfType([g["default"].number,g["default"].string]),autoHeightMax:g["default"].oneOfType([g["default"].number,g["default"].string]),universal:g["default"].bool,style:g["default"].object,children:g["default"].node},L.defaultProps={renderView:M.renderViewDefault,renderTrackHorizontal:M.renderTrackHorizontalDefault,renderTrackVertical:M.renderTrackVerticalDefault,renderThumbHorizontal:M.renderThumbHorizontalDefault,renderThumbVertical:M.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});var i=t.scrollbarSize=100;t.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},t.viewWrapperStyleDefault={paddingRight:i,paddingBottom:i,width:"100%",minWidth:"100%",boxSizing:"border-box",verticalAlign:"top",display:"inline-block"},t.viewWrappedStyleDefault={position:"relative",display:"block",verticalAlign:"top",width:"100%",boxSizing:"border-box"},t.containerStyleAutoHeight={height:"auto"},t.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch",height:"auto",width:"auto",boxSizing:"content-box"},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 i(e){var t=e.clientHeight,i=getComputedStyle(e),r=i.paddingTop,n=i.paddingBottom;return t-parseFloat(r)-parseFloat(n)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t){"use strict";function i(e){var t=e.clientWidth,i=getComputedStyle(e),r=i.paddingLeft,n=i.paddingRight;return t-parseFloat(r)-parseFloat(n)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(){u=!1}function o(){if(u!==!1)return u;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),u=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}else u=0;return u||0}Object.defineProperty(t,"__esModule",{value:!0}),t.getScrollbarWidth=void 0,t.invalidateScrollbarWidth=n;var l=i(1),a=r(l),u=!1;t["default"]=o,t.getScrollbarWidth=o},function(e,t){"use strict";function i(e){return"string"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t){"use strict";function i(){return!1}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t){"use strict";function i(e){return function(){return e}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,i){"use strict";function r(e,t,i,r,o,l,a,u){if(n(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=[i,r,o,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 n=function(e){};e.exports=r},function(e,t,i){(function(t){(function(){var i,r,n,o,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(i()-l)/1e6},r=t.hrtime,i=function(){var e;return e=r(),1e9*e[0]+e[1]},o=i(),a=1e9*t.uptime(),l=o-a):Date.now?(e.exports=function(){return Date.now()-n},n=Date.now()):(e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(this)}).call(t,i(16))},function(e,t){var i=null,r=["Webkit","Moz","O","ms"];e.exports=function(e){i||(i=document.createElement("div"));var t=i.style;if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),o=r.length;o>=0;o--){var l=r[o]+n;if(l in t)return l}return!1}},function(e,t){function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function n(e){if(s===setTimeout)return setTimeout(e,0);if((s===i||!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 o(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):g=-1,v.length&&a())}function a(){if(!p){var e=n(l);p=!0;for(var t=v.length;t;){for(f=v,v=[];++g<t;)f&&f[g].run();g=-1,t=v.length}f=null,p=!1,o(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:i}catch(e){s=i}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var f,v=[],p=!1,g=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];v.push(new u(e,t)),1!==v.length||p||n(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,i){"use strict";var r=i(12),n=i(13),o=i(19);e.exports=function(){function e(e,t,i,r,l,a){a!==o&&n(!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 i={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 i.checkPropTypes=r,i.PropTypes=i,i}},function(e,t,i){e.exports=i(17)()},function(e,t){"use strict";var i="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=i},function(e,t,i){(function(t){for(var r=i(14),n="undefined"==typeof window?t:window,o=["moz","webkit"],l="AnimationFrame",a=n["request"+l],u=n["cancel"+l]||n["cancelRequest"+l],c=0;!a&&c<o.length;c++)a=n[o[c]+"Request"+l],u=n[o[c]+"Cancel"+l]||n[o[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(),i=Math.max(0,f-(t-s));s=i+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(i))}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(n,e)},e.exports.cancel=function(){u.apply(n,arguments)},e.exports.polyfill=function(){n.requestAnimationFrame=a,n.cancelAnimationFrame=u}}).call(t,function(){return this}())},function(e,t,i){function r(e){return n(e).replace(/\s(\w)/g,function(e,t){return t.toUpperCase()})}var n=i(23);e.exports=r},function(e,t){function i(e){return o.test(e)?e.toLowerCase():l.test(e)?(r(e)||e).toLowerCase():a.test(e)?n(e).toLowerCase():e.toLowerCase()}function r(e){return e.replace(u,function(e,t){return t?" "+t:""})}function n(e){return e.replace(c,function(e,t,i){return t+" "+i.toLowerCase().split("").join(" ")})}e.exports=i;var o=/\s/,l=/(_|-|\.|:)/,a=/([a-z][A-Z]|[A-Z][a-z])/,u=/[\W_]+(.|$)/g,c=/(.)([A-Z]+)/g},function(e,t,i){function r(e){return n(e).replace(/[\W_]+(.|$)/g,function(e,t){return t?" "+t:""}).trim()}var n=i(22);e.exports=r}])});
!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(i[r])return i[r].exports;var n=i[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Scrollbars=void 0;var n=i(5),o=r(n);t["default"]=o["default"],t.Scrollbars=o["default"]},function(e,t,i){function r(e,t,i){var r=c[t];if("undefined"==typeof r&&(r=o(t)),r){if(void 0===i)return e.style[r];e.style[r]=s(r,i)}}function n(e,t){for(var i in t)t.hasOwnProperty(i)&&r(e,i,t[i])}function o(e){var t=u(e),i=a(t);return c[t]=c[e]=c[i]=i,i}function l(){2===arguments.length?"string"==typeof arguments[1]?arguments[0].style.cssText=arguments[1]:n(arguments[0],arguments[1]):r(arguments[0],arguments[1],arguments[2])}var a=i(15),u=i(21),c={"float":"cssFloat"},s=i(3);e.exports=l,e.exports.set=l,e.exports.get=function(e,t){return Array.isArray(t)?t.reduce(function(t,i){return t[i]=r(e,i||""),t},{}):r(e,t||"")}},function(t,i){t.exports=e},function(e,t){var i={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||i[e]?t:t+"px"}},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){var i={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i}function o(e){return h["default"].createElement("div",e)}function l(e){var t=e.style,i=n(e,["style"]),r=s({},t,{right:2,bottom:2,left:2,borderRadius:3});return h["default"].createElement("div",s({style:r},i))}function a(e){var t=e.style,i=n(e,["style"]),r=s({},t,{right:2,bottom:2,top:2,borderRadius:3});return h["default"].createElement("div",s({style:r},i))}function u(e){var t=e.style,i=n(e,["style"]),r=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return h["default"].createElement("div",s({style:r},i))}function c(e){var t=e.style,i=n(e,["style"]),r=s({},t,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return h["default"].createElement("div",s({style:r},i))}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e};t.renderViewDefault=o,t.renderTrackHorizontalDefault=l,t.renderTrackVerticalDefault=a,t.renderThumbHorizontalDefault=u,t.renderThumbVerticalDefault=c;var d=i(2),h=r(d)},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){var i={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i}function o(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 i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},c=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),s=i(20),d=r(s),h=i(1),f=r(h),v=i(2),p=i(18),g=r(p),m=i(10),b=r(m),y=i(9),T=i(11),w=r(T),S=i(8),k=r(S),H=i(7),W=r(H),D=i(6),M=i(4),z=5e3,L=function(e){function t(e){var i;o(this,t);for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var u=l(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this,e].concat(n)));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.getPaddingWidth=u.getPaddingWidth.bind(u),u.getPaddingHeight=u.getPaddingHeight.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.detectScrollbarWidthChange=u.detectScrollbarWidthChange.bind(u),u.pollScrollbarWidth=u.pollScrollbarWidth.bind(u),u.state={didMountUniversal:!1,scrollbarWidth:(0,y.getScrollbarWidth)()},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-this.getPaddingWidth()}},{key:"getScrollHeight",value:function(){return this.view.scrollHeight-this.getPaddingHeight()}},{key:"getClientWidth",value:function(){return this.view.clientWidth-this.getPaddingWidth()}},{key:"getClientHeight",value:function(){return this.view.clientHeight-this.getPaddingHeight()}},{key:"getPaddingWidth",value:function(){return D.scrollbarSize}},{key:"getPaddingHeight",value:function(){return D.scrollbarSize}},{key:"getValues",value:function(){var e=this.view,t=e.scrollLeft,i=e.scrollTop,r=this.view.scrollWidth-this.getPaddingWidth(),n=this.view.scrollHeight-this.getPaddingHeight(),o=this.view.clientWidth-this.getPaddingWidth(),l=this.view.clientHeight-this.getPaddingHeight();return{left:t/(r-o)||0,top:i/(n-l)||0,scrollLeft:t,scrollTop:i,scrollWidth:r,scrollHeight:n,clientWidth:o,clientHeight:l}}},{key:"getThumbHorizontalWidth",value:function(){var e=this.props,t=e.thumbSize,i=e.thumbMinSize,r=this.view.scrollWidth-this.getPaddingWidth(),n=this.view.clientWidth-this.getPaddingWidth(),o=(0,k["default"])(this.trackHorizontal),l=n/r*o;return r<=n?0:t?t:Math.max(l,i)}},{key:"getThumbVerticalHeight",value:function(){var e=this.props,t=e.thumbSize,i=e.thumbMinSize,r=this.view.scrollHeight-this.getPaddingHeight(),n=this.view.clientHeight-this.getPaddingHeight(),o=(0,W["default"])(this.trackVertical),l=n/r*o;return r<=n?0:t?t:Math.max(l,i)}},{key:"getScrollLeftForOffset",value:function(e){var t=this.view.scrollWidth-this.getPaddingWidth(),i=this.view.clientWidth-this.getPaddingWidth(),r=(0,k["default"])(this.trackHorizontal),n=this.getThumbHorizontalWidth();return e/(r-n)*(t-i)}},{key:"getScrollTopForOffset",value:function(e){var t=this.view.scrollHeight-this.getPaddingHeight(),i=this.view.clientHeight-this.getPaddingHeight(),r=(0,W["default"])(this.trackVertical),n=this.getThumbVerticalHeight();return e/(r-n)*(t-i)}},{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-this.getPaddingWidth()}},{key:"scrollToBottom",value:function(){this.view.scrollTop=this.view.scrollHeight-this.getPaddingHeight()}},{key:"addListeners",value:function(){if("undefined"!=typeof document){var e=this.view,t=this.trackHorizontal,i=this.trackVertical,r=this.thumbHorizontal,n=this.thumbVertical;e.addEventListener("scroll",this.handleScroll),t.addEventListener("mouseenter",this.handleTrackMouseEnter),t.addEventListener("mouseleave",this.handleTrackMouseLeave),t.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),i.addEventListener("mouseenter",this.handleTrackMouseEnter),i.addEventListener("mouseleave",this.handleTrackMouseLeave),i.addEventListener("mousedown",this.handleVerticalTrackMouseDown),r.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),n.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize),this.pollScrollbarWidthTimer=setTimeout(this.pollScrollbarWidth,z)}}},{key:"removeListeners",value:function(){if("undefined"!=typeof document){var e=this.view,t=this.trackHorizontal,i=this.trackVertical,r=this.thumbHorizontal,n=this.thumbVertical;e.removeEventListener("scroll",this.handleScroll),t.removeEventListener("mouseenter",this.handleTrackMouseEnter),t.removeEventListener("mouseleave",this.handleTrackMouseLeave),t.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),i.removeEventListener("mouseenter",this.handleTrackMouseEnter),i.removeEventListener("mouseleave",this.handleTrackMouseLeave),i.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),r.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),n.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.pollScrollbarWidthTimer&&clearTimeout(this.pollScrollbarWidthTimer),this.teardownDragging()}}},{key:"pollScrollbarWidth",value:function(){var e=this;this.detectScrollbarWidthChange()?this._update(function(){e.pollScrollbarWidthTimer=setTimeout(e.pollScrollbarWidth,z)}):this.pollScrollbarWidthTimer=setTimeout(this.pollScrollbarWidth,z)}},{key:"detectScrollbarWidthChange",value:function(){(0,y.invalidateScrollbarWidth)();var e=(0,y.getScrollbarWidth)(),t=e!==this.state.scrollbarWidth;return t&&this.setState({scrollbarWidth:e}),t}},{key:"handleScroll",value:function(e){var t=this,i=this.props,r=i.onScroll,n=i.onScrollFrame;r&&r(e),this.update(function(e){var i=e.scrollLeft,r=e.scrollTop;t.viewScrollLeft=i,t.viewScrollTop=r,n&&n(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.detectScrollbarWidthChange(),this.update()}},{key:"handleHorizontalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,i=e.clientX,r=t.getBoundingClientRect(),n=r.left,o=this.getThumbHorizontalWidth(),l=Math.abs(n-i)-o/2;this.view.scrollLeft=this.getScrollLeftForOffset(l)}},{key:"handleVerticalTrackMouseDown",value:function(e){e.preventDefault();var t=e.target,i=e.clientY,r=t.getBoundingClientRect(),n=r.top,o=this.getThumbVerticalHeight(),l=Math.abs(n-i)-o/2;this.view.scrollTop=this.getScrollTopForOffset(l)}},{key:"handleHorizontalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,i=e.clientX,r=t.offsetWidth,n=t.getBoundingClientRect(),o=n.left;this.prevPageX=r-(i-o)}},{key:"handleVerticalThumbMouseDown",value:function(e){e.preventDefault(),this.handleDragStart(e);var t=e.target,i=e.clientY,r=t.offsetHeight,n=t.getBoundingClientRect(),o=n.top;this.prevPageY=r-(i-o)}},{key:"setupDragging",value:function(){(0,f["default"])(document.body,D.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=w["default"]}},{key:"teardownDragging",value:function(){(0,f["default"])(document.body,D.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,i=this.trackHorizontal.getBoundingClientRect(),r=i.left,n=this.getThumbHorizontalWidth(),o=n-this.prevPageX,l=-r+t-o;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,i=t.onUpdate,r=t.hideTracksWhenNotNeeded;if(this.container.scrollTop=0,this.container.scrollLeft=0,!this.view)return void("function"==typeof e&&e());var n=this.getValues(),o=n.scrollLeft,l=n.clientWidth,a=n.scrollWidth,u=(0,k["default"])(this.trackHorizontal),c=this.getThumbHorizontalWidth(),s=o/(a-l)*(u-c),d={width:c,transform:"translateX("+s+"px)"},h=n.scrollTop,v=n.clientHeight,p=n.scrollHeight,g=(0,W["default"])(this.trackVertical),m=this.getThumbVerticalHeight(),b=h/(p-v)*(g-m),y={height:m,transform:"translateY("+b+"px)"};if(r){var T={visibility:a>l?"visible":"hidden"},w={visibility:p>v?"visible":"hidden"};(0,f["default"])(this.trackHorizontal,T),(0,f["default"])(this.trackVertical,w)}(0,f["default"])(this.thumbHorizontal,d),(0,f["default"])(this.thumbVertical,y),i&&i(n),"function"==typeof e&&e(n)}},{key:"render",value:function(){var e=this,t=this.props,i=(t.onScroll,t.onScrollFrame,t.onScrollStart,t.onScrollStop,t.onUpdate,t.renderView),r=t.renderTrackHorizontal,o=t.renderTrackVertical,l=t.renderThumbHorizontal,a=t.renderThumbVertical,c=t.tagName,s=(t.hideTracksWhenNotNeeded,t.autoHide),d=(t.autoHideTimeout,t.autoHideDuration),h=(t.thumbSize,t.thumbMinSize,t.universal),f=t.autoHeight,p=t.autoHeightMin,g=t.autoHeightMax,m=t.style,y=t.children,T=n(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,S=w.didMountUniversal,k=w.scrollbarWidth,H=u({},D.containerStyleDefault,f&&u({},D.containerStyleAutoHeight,{minHeight:p,maxHeight:g}),m),W=u({},D.viewStyleDefault,{marginRight:-this.getPaddingWidth()+(k?-k:0),marginBottom:-this.getPaddingHeight()+(k?-k:0),width:"calc(100% + "+(D.scrollbarSize+k)+"px)"},f&&u({},D.viewStyleAutoHeight,{minHeight:(0,b["default"])(p)?"calc("+p+" + "+(this.getPaddingHeight()+k)+"px)":p+this.getPaddingHeight()+k,maxHeight:(0,b["default"])(g)?"calc("+g+" + "+(this.getPaddingHeight()+k)+"px)":g+this.getPaddingHeight()+k}),f&&h&&!S&&{minHeight:p,maxHeight:g},h&&!S&&D.viewStyleUniversalInitial),M=u({},D.viewWrapperStyleDefault,f&&u({},D.viewWrapperStyleAutoHeight)),z=u({},D.viewWrappedStyleDefault),L={transition:"opacity "+d+"ms",opacity:0},x=u({},D.trackHorizontalStyleDefault,s&&L,h&&!S&&{display:"none"}),E=u({},D.trackVerticalStyleDefault,s&&L,h&&!S&&{display:"none"});return(0,v.createElement)(c,{className:T.className?T.className:"",style:H,ref:function(t){e.container=t}},[(0,v.createElement)("div",{style:W,key:"view",ref:function(t){e.view=t}},[(0,v.createElement)("div",{style:M,key:"viewWrapper",ref:function(t){e.viewWrapper=t}},[(0,v.cloneElement)(i({style:z}),{key:"viewWrapped",ref:function(t){e.viewWrapped=t}},y)])]),(0,v.cloneElement)(r({style:x}),{key:"trackHorizontal",ref:function(t){e.trackHorizontal=t}},(0,v.cloneElement)(l({style:D.thumbHorizontalStyleDefault}),{ref:function(t){e.thumbHorizontal=t}})),(0,v.cloneElement)(o({style:E}),{key:"trackVertical",ref:function(t){e.trackVertical=t}},(0,v.cloneElement)(a({style:D.thumbVerticalStyleDefault}),{ref:function(t){e.thumbVertical=t}}))])}}]),t}(v.Component);t["default"]=L,L.propTypes={onScroll:g["default"].func,onScrollFrame:g["default"].func,onScrollStart:g["default"].func,onScrollStop:g["default"].func,onUpdate:g["default"].func,renderView:g["default"].func,renderTrackHorizontal:g["default"].func,renderTrackVertical:g["default"].func,renderThumbHorizontal:g["default"].func,renderThumbVertical:g["default"].func,tagName:g["default"].string,thumbSize:g["default"].number,thumbMinSize:g["default"].number,hideTracksWhenNotNeeded:g["default"].bool,autoHide:g["default"].bool,autoHideTimeout:g["default"].number,autoHideDuration:g["default"].number,autoHeight:g["default"].bool,autoHeightMin:g["default"].oneOfType([g["default"].number,g["default"].string]),autoHeightMax:g["default"].oneOfType([g["default"].number,g["default"].string]),universal:g["default"].bool,style:g["default"].object,children:g["default"].node},L.defaultProps={renderView:M.renderViewDefault,renderTrackHorizontal:M.renderTrackHorizontalDefault,renderTrackVertical:M.renderTrackVerticalDefault,renderThumbHorizontal:M.renderThumbHorizontalDefault,renderThumbVertical:M.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});var i=t.scrollbarSize=100;t.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"},t.viewWrapperStyleDefault={paddingRight:i,paddingBottom:i,width:"100%",minWidth:"100%",boxSizing:"border-box",verticalAlign:"top",display:"inline-block"},t.viewWrappedStyleDefault={position:"relative",display:"block",verticalAlign:"top",width:"100%",boxSizing:"border-box"},t.containerStyleAutoHeight={height:"auto"},t.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch",height:"auto",width:"auto",boxSizing:"content-box"},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 i(e){var t=e.clientHeight,i=getComputedStyle(e),r=i.paddingTop,n=i.paddingBottom;return t-parseFloat(r)-parseFloat(n)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t){"use strict";function i(e){var t=e.clientWidth,i=getComputedStyle(e),r=i.paddingLeft,n=i.paddingRight;return t-parseFloat(r)-parseFloat(n)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(){u=!1}function o(){if(u!==!1)return u;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),u=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}else u=0;return u||0}Object.defineProperty(t,"__esModule",{value:!0}),t.getScrollbarWidth=void 0,t.invalidateScrollbarWidth=n;var l=i(1),a=r(l),u=!1;t["default"]=o,t.getScrollbarWidth=o},function(e,t){"use strict";function i(e){return"string"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t){"use strict";function i(){return!1}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i},function(e,t){"use strict";function i(e){return function(){return e}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,i){"use strict";function r(e,t,i,r,o,l,a,u){if(n(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=[i,r,o,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 n=function(e){};e.exports=r},function(e,t,i){(function(t){(function(){var i,r,n,o,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(i()-l)/1e6},r=t.hrtime,i=function(){var e;return e=r(),1e9*e[0]+e[1]},o=i(),a=1e9*t.uptime(),l=o-a):Date.now?(e.exports=function(){return Date.now()-n},n=Date.now()):(e.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(this)}).call(t,i(16))},function(e,t){var i=null,r=["Webkit","Moz","O","ms"];e.exports=function(e){i||(i=document.createElement("div"));var t=i.style;if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),o=r.length;o>=0;o--){var l=r[o]+n;if(l in t)return l}return!1}},function(e,t){function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function n(e){if(s===setTimeout)return setTimeout(e,0);if((s===i||!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 o(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):g=-1,v.length&&a())}function a(){if(!p){var e=n(l);p=!0;for(var t=v.length;t;){for(f=v,v=[];++g<t;)f&&f[g].run();g=-1,t=v.length}f=null,p=!1,o(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:i}catch(e){s=i}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var f,v=[],p=!1,g=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];v.push(new u(e,t)),1!==v.length||p||n(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,i){"use strict";var r=i(12),n=i(13),o=i(19);e.exports=function(){function e(e,t,i,r,l,a){a!==o&&n(!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 i={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 i.checkPropTypes=r,i.PropTypes=i,i}},function(e,t,i){e.exports=i(17)()},function(e,t){"use strict";var i="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=i},function(e,t,i){(function(t){for(var r=i(14),n="undefined"==typeof window?t:window,o=["moz","webkit"],l="AnimationFrame",a=n["request"+l],u=n["cancel"+l]||n["cancelRequest"+l],c=0;!a&&c<o.length;c++)a=n[o[c]+"Request"+l],u=n[o[c]+"Cancel"+l]||n[o[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(),i=Math.max(0,f-(t-s));s=i+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(i))}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(n,e)},e.exports.cancel=function(){u.apply(n,arguments)},e.exports.polyfill=function(){n.requestAnimationFrame=a,n.cancelAnimationFrame=u}}).call(t,function(){return this}())},function(e,t,i){function r(e){return n(e).replace(/\s(\w)/g,function(e,t){return t.toUpperCase()})}var n=i(23);e.exports=r},function(e,t){function i(e){return o.test(e)?e.toLowerCase():l.test(e)?(r(e)||e).toLowerCase():a.test(e)?n(e).toLowerCase():e.toLowerCase()}function r(e){return e.replace(u,function(e,t){return t?" "+t:""})}function n(e){return e.replace(c,function(e,t,i){return t+" "+i.toLowerCase().split("").join(" ")})}e.exports=i;var o=/\s/,l=/(_|-|\.|:)/,a=/([a-z][A-Z]|[A-Z][a-z])/,u=/[\W_]+(.|$)/g,c=/(.)([A-Z]+)/g},function(e,t,i){function r(e){return n(e).replace(/[\W_]+(.|$)/g,function(e,t){return t?" "+t:""}).trim()}var n=i(22);e.exports=r}])});

@@ -639,2 +639,6 @@ 'use strict';

this.container.scrollLeft = 0;
if (!this.view) {
if (typeof callback === 'function') callback();
return;
}
var values = this.getValues();

@@ -641,0 +645,0 @@ var scrollLeft = values.scrollLeft,

{
"name": "tt-react-custom-scrollbars",
"version": "4.0.1-tt3",
"version": "4.0.1-tt4",
"description": "React scrollbars component",

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

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

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