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-tt1 to 4.0.1-tt2

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

@@ -105,3 +105,3 @@ 'use strict';

_this.detectScrollbarWidthChange = _this.detectScrollbarWidthChange.bind(_this);
_this.pollScrollbarWidthTimer = _this.pollScrollbarWidthTimer.bind(_this);
_this.pollScrollbarWidth = _this.pollScrollbarWidth.bind(_this);

@@ -108,0 +108,0 @@ _this.state = {

{
"name": "tt-react-custom-scrollbars",
"version": "4.0.1-tt1",
"version": "4.0.1-tt2",
"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