react-custom-scroll
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),function(){try{return require("prop-types")}catch(e){}}()):"function"==typeof define&&define.amd?define(["react","react-dom","prop-types"],t):"object"==typeof exports?exports.ReactCustomScroll=t(require("react"),require("react-dom"),function(){try{return require("prop-types")}catch(e){}}()):e.ReactCustomScroll=t(e.react,e["react-dom"],e["prop-types"])}(this,function(e,t,o){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){e.exports=o(1)},function(e,t,o){"use strict";function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function n(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 i(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)}function s(e,t,o){return t=t||0===t?t:e,o=o||0===o?o:e,t>o?(console.error("min limit is greater than max limit"),e):e<t?t:e>o?o:e}function a(e,t){var o=t.getBoundingClientRect();return c(e,o)}function c(e,t){return e.clientX>t.left&&e.clientX<t.right&&e.clientY>t.top&&e.clientY<t.top+t.height}function h(e){var t=this.props.minScrollHandleHeight;if(e.height>=t)return e;var o=t-e.height,r=this.state.scrollPos/(this.contentHeight-this.visibleHeight),n=o*r,l=e.top-n;return{height:t,top:l}}var u=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),d=o(3),f=function(e){function t(e){n(this,t);var o=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.scrollbarYWidth=0,o.state={scrollPos:0,onDrag:!1},o.onHandleDrag=o.onHandleDrag.bind(o),o.onHandleDragEnd=o.onHandleDragEnd.bind(o),o.blockOuterScroll=o.blockOuterScroll.bind(o),o.onScroll=o.onScroll.bind(o),o.onMouseDown=o.onMouseDown.bind(o),o.onClick=o.onClick.bind(o),o.setCustomScrollbarRef=o.setCustomScrollbarRef.bind(o),o.setRefElement=function(e){return function(t){t&&!o[e]&&(o[e]=t)}},o}return i(t,e),u(t,[{key:"componentDidMount",value:function(){"undefined"!=typeof this.props.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.forceUpdate()}},{key:"componentWillReceiveProps",value:function(){this.externalRender=!0}},{key:"componentDidUpdate",value:function(e,t){var o=this.contentHeight,r=this.visibleHeight,n=this.getScrolledElement(),l=t.scrollPos>=o-r;this.contentHeight=n.scrollHeight,this.scrollbarYWidth=n.offsetWidth-n.clientWidth,this.visibleHeight=n.clientHeight,this.scrollRatio=this.contentHeight?this.visibleHeight/this.contentHeight:1,this.toggleScrollIfNeeded(),(this.props.freezePosition||e.freezePosition)&&this.adjustFreezePosition(e),"undefined"!=typeof this.props.scrollTo&&this.props.scrollTo!==e.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.props.keepAtBottom&&this.externalRender&&l&&this.updateScrollPosition(this.contentHeight-this.visibleHeight),this.externalRender=!1}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"adjustFreezePosition",value:function(e){var t=this.getScrolledElement(),o=this.contentWrapper;this.props.freezePosition&&(o.scrollTop=this.state.scrollPos),e.freezePosition&&(t.scrollTop=this.state.scrollPos)}},{key:"toggleScrollIfNeeded",value:function(){var e=this.contentHeight-this.visibleHeight>1;this.hasScroll!==e&&(this.hasScroll=e,this.forceUpdate())}},{key:"getScrollTop",value:function(){return this.getScrolledElement().scrollTop}},{key:"updateScrollPosition",value:function(e){var t=this.getScrolledElement();t.scrollTop=e,this.setState({scrollPos:e})}},{key:"onClick",value:function(e){if(this.hasScroll&&this.isMouseEventOnCustomScrollbar(e)&&!this.isMouseEventOnScrollHandle(e)){var t=this.calculateNewScrollHandleTop(e),o=this.getScrollValueFromHandlePosition(t);this.updateScrollPosition(o)}}},{key:"isMouseEventOnCustomScrollbar",value:function(e){if(!this.customScrollbarRef)return!1;var t=d.findDOMNode(this),o=t.getBoundingClientRect().toJSON(),r=this.customScrollbarRef.getBoundingClientRect(),n=this.props.rtl?{left:o.left,right:r.right}:{left:r.left,width:o.right},l=Object.assign({},o,n);return c(e,l)}},{key:"isMouseEventOnScrollHandle",value:function(e){if(!this.scrollHandle)return!1;var t=d.findDOMNode(this.scrollHandle);return a(e,t)}},{key:"calculateNewScrollHandleTop",value:function(e){var t=d.findDOMNode(this),o=t.getBoundingClientRect(),r=o.top+window.pageYOffset,n=e.pageY-r,l=this.getScrollHandleStyle().top,i=void 0,s=n>l+this.scrollHandleHeight;return i=s?l+Math.min(this.scrollHandleHeight,this.visibleHeight-this.scrollHandleHeight):l-Math.max(this.scrollHandleHeight,0)}},{key:"getScrollValueFromHandlePosition",value:function(e){return e/this.scrollRatio}},{key:"getScrollHandleStyle",value:function(){var e=this.state.scrollPos*this.scrollRatio;return this.scrollHandleHeight=this.visibleHeight*this.scrollRatio,{height:this.scrollHandleHeight,top:e}}},{key:"adjustCustomScrollPosToContentPos",value:function(e){this.setState({scrollPos:e})}},{key:"onScroll",value:function(e){this.props.freezePosition||(this.adjustCustomScrollPosToContentPos(e.currentTarget.scrollTop),this.props.onScroll&&this.props.onScroll(e))}},{key:"getScrolledElement",value:function(){return this.innerContainer}},{key:"onMouseDown",value:function(e){this.hasScroll&&this.isMouseEventOnScrollHandle(e)&&(this.startDragHandlePos=this.getScrollHandleStyle().top,this.startDragMousePos=e.pageY,this.setState({onDrag:!0}),document.addEventListener("mousemove",this.onHandleDrag),document.addEventListener("mouseup",this.onHandleDragEnd))}},{key:"onHandleDrag",value:function(e){e.preventDefault();var t=e.pageY-this.startDragMousePos,o=s(this.startDragHandlePos+t,0,this.visibleHeight-this.scrollHandleHeight),r=this.getScrollValueFromHandlePosition(o);this.updateScrollPosition(r)}},{key:"onHandleDragEnd",value:function(e){this.setState({onDrag:!1}),e.preventDefault(),document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"blockOuterScroll",value:function(e){if(!this.props.allowOuterScroll){var t=e.currentTarget,o=e.currentTarget.scrollHeight,r=o-e.currentTarget.offsetHeight,n=e.deltaY%3?e.deltaY:10*e.deltaY;t.scrollTop+n<=0?(t.scrollTop=0,e.preventDefault()):t.scrollTop+n>=r&&(t.scrollTop=r,e.preventDefault()),e.stopPropagation()}}},{key:"getInnerContainerClasses",value:function(){var e="inner-container";return this.state.scrollPos&&this.props.addScrolledClass&&(e+=" content-scrolled"),e}},{key:"getScrollStyles",value:function(){var e,t,o=this.scrollbarYWidth||20,n=this.props.rtl?"marginLeft":"marginRight",l=(e={},r(e,n,-1*o),r(e,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),e),i=(t={},r(t,n,this.scrollbarYWidth?0:o),r(t,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),r(t,"overflowY",this.props.freezePosition?"hidden":"visible"),t);return{innerContainer:l,contentWrapper:i}}},{key:"getOuterContainerStyle",value:function(){return{height:this.props.heightRelativeToParent||this.props.flex?"100%":""}}},{key:"getRootStyles",value:function(){var e={};return this.props.heightRelativeToParent?e.height=this.props.heightRelativeToParent:this.props.flex&&(e.flex=this.props.flex),e}},{key:"setCustomScrollbarRef",value:function(e){e&&!this.customScrollbarRef&&(this.customScrollbarRef=e)}},{key:"render",value:function(){var e=this.getScrollStyles(),t=this.getRootStyles(),o=h.call(this,this.getScrollHandleStyle());return p.createElement("div",{className:"custom-scroll "+(this.state.onDrag?"scroll-handle-dragged":""),style:t},p.createElement("div",{className:"outer-container",style:this.getOuterContainerStyle(),onMouseDown:this.onMouseDown,onClick:this.onClick},this.hasScroll&&p.createElement("div",{ref:this.setCustomScrollbarRef,className:"custom-scrollbar"+(this.props.rtl?" custom-scrollbar-rtl":""),key:"scrollbar"},p.createElement("div",{ref:this.setRefElement("scrollHandle"),className:"custom-scroll-handle",style:o},p.createElement("div",{className:this.props.handleClass}))),p.createElement("div",{ref:this.setRefElement("innerContainer"),className:this.getInnerContainerClasses(),style:e.innerContainer,onScroll:this.onScroll,onWheel:this.blockOuterScroll},p.createElement("div",{className:"content-wrapper",ref:this.setRefElement("contentWrapper"),style:e.contentWrapper},this.props.children))))}}]),t}(p.Component);try{var g=o(4);f.propTypes={children:g.any,allowOuterScroll:g.bool,heightRelativeToParent:g.string,onScroll:g.func,addScrolledClass:g.bool,freezePosition:g.bool,handleClass:g.string,minScrollHandleHeight:g.number,flex:g.string,rtl:g.bool,scrollTo:g.number,keepAtBottom:g.bool}}catch(e){}f.defaultProps={handleClass:"inner-handle",minScrollHandleHeight:38},e.exports=f},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){if("undefined"==typeof o){var r=new Error('Cannot find module "prop-types"');throw r.code="MODULE_NOT_FOUND",r}e.exports=o}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),function(){try{return require("prop-types")}catch(e){}}()):"function"==typeof define&&define.amd?define(["react","react-dom","prop-types"],t):"object"==typeof exports?exports.ReactCustomScroll=t(require("react"),require("react-dom"),function(){try{return require("prop-types")}catch(e){}}()):e.ReactCustomScroll=t(e.react,e["react-dom"],e["prop-types"])}(this,function(e,t,o){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){e.exports=o(1)},function(e,t,o){"use strict";function r(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function n(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 i(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)}function s(e,t,o){return t=t||0===t?t:e,o=o||0===o?o:e,t>o?(console.error("min limit is greater than max limit"),e):e<t?t:e>o?o:e}function a(e,t){var o=t.getBoundingClientRect();return c(e,o)}function c(e,t){return e.clientX>t.left&&e.clientX<t.right&&e.clientY>t.top&&e.clientY<t.top+t.height}function h(e){var t=this.props.minScrollHandleHeight;if(e.height>=t)return e;var o=t-e.height,r=this.state.scrollPos/(this.contentHeight-this.visibleHeight),n=o*r,l=e.top-n;return{height:t,top:l}}var u=function(){function e(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,o,r){return o&&e(t.prototype,o),r&&e(t,r),t}}(),p=o(2),d=o(3),f=function(e){function t(e){n(this,t);var o=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.scrollbarYWidth=0,o.state={scrollPos:0,onDrag:!1},o.onHandleDrag=o.onHandleDrag.bind(o),o.onHandleDragEnd=o.onHandleDragEnd.bind(o),o.blockOuterScroll=o.blockOuterScroll.bind(o),o.onScroll=o.onScroll.bind(o),o.onMouseDown=o.onMouseDown.bind(o),o.onClick=o.onClick.bind(o),o.setCustomScrollbarRef=o.setCustomScrollbarRef.bind(o),o.setRefElement=function(e){return function(t){t&&!o[e]&&(o[e]=t)}},o}return i(t,e),u(t,[{key:"componentDidMount",value:function(){"undefined"!=typeof this.props.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.forceUpdate()}},{key:"componentWillReceiveProps",value:function(){this.externalRender=!0}},{key:"componentDidUpdate",value:function(e,t){var o=this.contentHeight,r=this.visibleHeight,n=this.getScrolledElement(),l=t.scrollPos>=o-r;this.contentHeight=n.scrollHeight,this.scrollbarYWidth=n.offsetWidth-n.clientWidth,this.visibleHeight=n.clientHeight,this.scrollRatio=this.contentHeight?this.visibleHeight/this.contentHeight:1,this.toggleScrollIfNeeded(),(this.props.freezePosition||e.freezePosition)&&this.adjustFreezePosition(e),"undefined"!=typeof this.props.scrollTo&&this.props.scrollTo!==e.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.props.keepAtBottom&&this.externalRender&&l&&this.updateScrollPosition(this.contentHeight-this.visibleHeight),this.externalRender=!1}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"adjustFreezePosition",value:function(e){var t=this.getScrolledElement(),o=this.contentWrapper;this.props.freezePosition&&(o.scrollTop=this.state.scrollPos),e.freezePosition&&(t.scrollTop=this.state.scrollPos)}},{key:"toggleScrollIfNeeded",value:function(){var e=this.contentHeight-this.visibleHeight>1;this.hasScroll!==e&&(this.hasScroll=e,this.forceUpdate())}},{key:"getScrollTop",value:function(){return this.getScrolledElement().scrollTop}},{key:"updateScrollPosition",value:function(e){var t=this.getScrolledElement();t.scrollTop=e,this.setState({scrollPos:e})}},{key:"onClick",value:function(e){if(this.hasScroll&&this.isMouseEventOnCustomScrollbar(e)&&!this.isMouseEventOnScrollHandle(e)){var t=this.calculateNewScrollHandleTop(e),o=this.getScrollValueFromHandlePosition(t);this.updateScrollPosition(o)}}},{key:"isMouseEventOnCustomScrollbar",value:function(e){if(!this.customScrollbarRef)return!1;var t=d.findDOMNode(this),o=t.getBoundingClientRect().toJSON(),r=this.customScrollbarRef.getBoundingClientRect(),n=this.props.rtl?{left:o.left,right:r.right}:{left:r.left,width:o.right},l=Object.assign({},o,n);return c(e,l)}},{key:"isMouseEventOnScrollHandle",value:function(e){if(!this.scrollHandle)return!1;var t=d.findDOMNode(this.scrollHandle);return a(e,t)}},{key:"calculateNewScrollHandleTop",value:function(e){var t=d.findDOMNode(this),o=t.getBoundingClientRect(),r=o.top+window.pageYOffset,n=e.pageY-r,l=this.getScrollHandleStyle().top,i=void 0,s=n>l+this.scrollHandleHeight;return i=s?l+Math.min(this.scrollHandleHeight,this.visibleHeight-this.scrollHandleHeight):l-Math.max(this.scrollHandleHeight,0)}},{key:"getScrollValueFromHandlePosition",value:function(e){return e/this.scrollRatio}},{key:"getScrollHandleStyle",value:function(){var e=this.state.scrollPos*this.scrollRatio;return this.scrollHandleHeight=this.visibleHeight*this.scrollRatio,{height:this.scrollHandleHeight,top:e}}},{key:"adjustCustomScrollPosToContentPos",value:function(e){this.setState({scrollPos:e})}},{key:"onScroll",value:function(e){this.props.freezePosition||(this.adjustCustomScrollPosToContentPos(e.currentTarget.scrollTop),this.props.onScroll&&this.props.onScroll(e))}},{key:"getScrolledElement",value:function(){return this.innerContainer}},{key:"onMouseDown",value:function(e){this.hasScroll&&this.isMouseEventOnScrollHandle(e)&&(this.startDragHandlePos=this.getScrollHandleStyle().top,this.startDragMousePos=e.pageY,this.setState({onDrag:!0}),document.addEventListener("mousemove",this.onHandleDrag),document.addEventListener("mouseup",this.onHandleDragEnd))}},{key:"onHandleDrag",value:function(e){e.preventDefault();var t=e.pageY-this.startDragMousePos,o=s(this.startDragHandlePos+t,0,this.visibleHeight-this.scrollHandleHeight),r=this.getScrollValueFromHandlePosition(o);this.updateScrollPosition(r)}},{key:"onHandleDragEnd",value:function(e){this.setState({onDrag:!1}),e.preventDefault(),document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"blockOuterScroll",value:function(e){if(!this.props.allowOuterScroll){var t=e.currentTarget,o=e.currentTarget.scrollHeight,r=o-e.currentTarget.offsetHeight,n=e.deltaY%3?e.deltaY:10*e.deltaY;t.scrollTop+n<=0?(t.scrollTop=0,e.preventDefault()):t.scrollTop+n>=r&&(t.scrollTop=r,e.preventDefault()),e.stopPropagation()}}},{key:"getInnerContainerClasses",value:function(){var e="inner-container";return this.state.scrollPos&&this.props.addScrolledClass&&(e+=" content-scrolled"),e}},{key:"getScrollStyles",value:function(){var e,t,o=this.scrollbarYWidth||20,n=this.props.rtl?"marginLeft":"marginRight",l=(e={},r(e,n,-1*o),r(e,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),e),i=(t={},r(t,n,this.scrollbarYWidth?0:o),r(t,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),r(t,"overflowY",this.props.freezePosition?"hidden":"visible"),t);return{innerContainer:l,contentWrapper:i}}},{key:"getOuterContainerStyle",value:function(){return{height:this.props.heightRelativeToParent||this.props.flex?"100%":""}}},{key:"getRootStyles",value:function(){var e={};return this.props.heightRelativeToParent?e.height=this.props.heightRelativeToParent:this.props.flex&&(e.flex=this.props.flex),e}},{key:"setCustomScrollbarRef",value:function(e){e&&!this.customScrollbarRef&&(this.customScrollbarRef=e)}},{key:"render",value:function(){var e=this.getScrollStyles(),t=this.getRootStyles(),o=h.call(this,this.getScrollHandleStyle());return p.createElement("div",{className:"custom-scroll "+(this.state.onDrag?"scroll-handle-dragged":""),style:t},p.createElement("div",{className:"outer-container",style:this.getOuterContainerStyle(),onMouseDown:this.onMouseDown,onClick:this.onClick},this.hasScroll?p.createElement("div",{className:"positioning"},p.createElement("div",{ref:this.setCustomScrollbarRef,className:"custom-scrollbar"+(this.props.rtl?" custom-scrollbar-rtl":""),key:"scrollbar"},p.createElement("div",{ref:this.setRefElement("scrollHandle"),className:"custom-scroll-handle",style:o},p.createElement("div",{className:this.props.handleClass})))):null,p.createElement("div",{ref:this.setRefElement("innerContainer"),className:this.getInnerContainerClasses(),style:e.innerContainer,onScroll:this.onScroll,onWheel:this.blockOuterScroll},p.createElement("div",{className:"content-wrapper",ref:this.setRefElement("contentWrapper"),style:e.contentWrapper},this.props.children))))}}]),t}(p.Component);try{var g=o(4);f.propTypes={children:g.any,allowOuterScroll:g.bool,heightRelativeToParent:g.string,onScroll:g.func,addScrolledClass:g.bool,freezePosition:g.bool,handleClass:g.string,minScrollHandleHeight:g.number,flex:g.string,rtl:g.bool,scrollTo:g.number,keepAtBottom:g.bool}}catch(e){}f.defaultProps={handleClass:"inner-handle",minScrollHandleHeight:38},e.exports=f},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t){if("undefined"==typeof o){var r=new Error('Cannot find module "prop-types"');throw r.code="MODULE_NOT_FOUND",r}e.exports=o}])}); |
@@ -6,3 +6,3 @@ !function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";var o=n(2),r=n(3),i=n(4);r.render(o.createElement(i),document.getElementById("body"))},function(e,t){e.exports=React},function(e,t){e.exports=ReactDOM},function(e,t,n){"use strict";function o(e){var t=window.location.href;e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)"),o=n.exec(t);return o?!!o[2]&&decodeURIComponent(o[2].replace(/\+/g," ")):null}var r=n(5),i=n(13),a=n(14),s=n(15);e.exports=r({displayName:"firstComp",getInitialState:function(){return{dynamicContentCounter:4}},getText:function(){return a.text},getDynamicContent:function(){return i.times(this.state.dynamicContentCounter,function(e){return"Content #"+e})},addContent:function(){this.setState({dynamicContentCounter:this.state.dynamicContentCounter+1})},removeContent:function(){this.setState({dynamicContentCounter:Math.max(this.state.dynamicContentCounter-1,4)})},getExamplesToDisplay:function(){var e=o("flex"),t=o("dynamic");return{flex:e,dynamic:t,standard:!e&&!t}},render:s})},function(e,t,n){"use strict";var o=n(2),r=n(6);if("undefined"==typeof o)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new o.Component).updater;e.exports=r(o.Component,o.isValidElement,i)},function(e,t,n){(function(t){"use strict";function o(e){return e}function r(e,n,r){function p(e,n,o){for(var r in n)n.hasOwnProperty(r)&&"production"!==t.env.NODE_ENV&&l("function"==typeof n[r],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",e.displayName||"ReactClass",u[o],r)}function d(e,t){var n=S.hasOwnProperty(t)?S[t]:null;_.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function m(e,o){if(o){s("function"!=typeof o,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!n(o),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;o.hasOwnProperty(c)&&x.mixins(e,o.mixins);for(var a in o)if(o.hasOwnProperty(a)&&a!==c){var u=o[a],p=r.hasOwnProperty(a);if(d(p,a),x.hasOwnProperty(a))x[a](e,u);else{var m=S.hasOwnProperty(a),f="function"==typeof u,h=f&&!m&&!p&&o.autobind!==!1;if(h)i.push(a,u),r[a]=u;else if(p){var g=S[a];s(m&&("DEFINE_MANY_MERGED"===g||"DEFINE_MANY"===g),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",g,a),"DEFINE_MANY_MERGED"===g?r[a]=v(r[a],u):"DEFINE_MANY"===g&&(r[a]=y(r[a],u))}else r[a]=u,"production"!==t.env.NODE_ENV&&"function"==typeof u&&o.displayName&&(r[a].displayName=o.displayName+"_"+a)}}}else if("production"!==t.env.NODE_ENV){var E=typeof o,b="object"===E&&null!==o;"production"!==t.env.NODE_ENV&&l(b,"%s: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got %s.",e.displayName||"ReactClass",null===o?null:E)}}function f(e,t){if(t)for(var n in t){var o=t[n];if(t.hasOwnProperty(n)){var r=n in x;s(!r,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var i=n in e;if(i){var a=D.hasOwnProperty(n)?D[n]:null;return s("DEFINE_MANY_MERGED"===a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),void(e[n]=v(e[n],o))}e[n]=o}}}function h(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function v(e,t){return function(){var n=e.apply(this,arguments),o=t.apply(this,arguments);if(null==n)return o;if(null==o)return n;var r={};return h(r,n),h(r,o),r}}function y(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,n){var o=n.bind(e);if("production"!==t.env.NODE_ENV){o.__reactBoundContext=e,o.__reactBoundMethod=n,o.__reactBoundArguments=null;var r=e.constructor.displayName,i=o.bind;o.bind=function(a){for(var s=arguments.length,u=Array(s>1?s-1:0),c=1;c<s;c++)u[c-1]=arguments[c];if(a!==e&&null!==a)"production"!==t.env.NODE_ENV&&l(!1,"bind(): React component methods may only be bound to the component instance. See %s",r);else if(!u.length)return"production"!==t.env.NODE_ENV&&l(!1,"bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call. See %s",r),o;var p=i.apply(o,arguments);return p.__reactBoundContext=e,p.__reactBoundMethod=n,p.__reactBoundArguments=u,p}}return o}function E(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var o=t[n],r=t[n+1];e[o]=g(e,r)}}function b(e){var n=o(function(e,o,i){"production"!==t.env.NODE_ENV&&l(this instanceof n,"Something is calling a React component directly. Use a factory or JSX instead. See: https://fb.me/react-legacyfactory"),this.__reactAutoBindPairs.length&&E(this),this.props=e,this.context=o,this.refs=a,this.updater=i||r,this.state=null;var u=this.getInitialState?this.getInitialState():null;"production"!==t.env.NODE_ENV&&void 0===u&&this.getInitialState._isMockFunction&&(u=null),s("object"==typeof u&&!Array.isArray(u),"%s.getInitialState(): must return an object or null",n.displayName||"ReactCompositeComponent"),this.state=u});n.prototype=new C,n.prototype.constructor=n,n.prototype.__reactAutoBindPairs=[],N.forEach(m.bind(null,n)),m(n,P),m(n,e),m(n,O),n.getDefaultProps&&(n.defaultProps=n.getDefaultProps()),"production"!==t.env.NODE_ENV&&(n.getDefaultProps&&(n.getDefaultProps.isReactClassApproved={}),n.prototype.getInitialState&&(n.prototype.getInitialState.isReactClassApproved={})),s(n.prototype.render,"createClass(...): Class specification must implement a `render` method."),"production"!==t.env.NODE_ENV&&(l(!n.prototype.componentShouldUpdate,"%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",e.displayName||"A component"),l(!n.prototype.componentWillRecieveProps,"%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",e.displayName||"A component"),l(!n.prototype.UNSAFE_componentWillRecieveProps,"%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",e.displayName||"A component"));for(var i in S)n.prototype[i]||(n.prototype[i]=null);return n}var N=[],S={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",UNSAFE_componentWillMount:"DEFINE_MANY",UNSAFE_componentWillReceiveProps:"DEFINE_MANY",UNSAFE_componentWillUpdate:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},D={getDerivedStateFromProps:"DEFINE_MANY_MERGED"},x={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)m(e,t[n])},childContextTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"childContext"),e.childContextTypes=i({},e.childContextTypes,n)},contextTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"context"),e.contextTypes=i({},e.contextTypes,n)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=v(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,n){"production"!==t.env.NODE_ENV&&p(e,n,"prop"),e.propTypes=i({},e.propTypes,n)},statics:function(e,t){f(e,t)},autobind:function(){}},P={componentDidMount:function(){this.__isMounted=!0}},O={componentWillUnmount:function(){this.__isMounted=!1}},_={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return"production"!==t.env.NODE_ENV&&(l(this.__didWarnIsMounted,"%s: isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.",this.constructor&&this.constructor.displayName||this.name||"Component"),this.__didWarnIsMounted=!0),!!this.__isMounted}},C=function(){};return i(C.prototype,e.prototype,_),b}var i=n(8),a=n(9),s=n(10);if("production"!==t.env.NODE_ENV)var l=n(11);var u,c="mixins";u="production"!==t.env.NODE_ENV?{prop:"prop",context:"context",childContext:"child context"}:{},e.exports=r}).call(t,n(7))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function r(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){h&&m&&(h=!1,m.length?f=m.concat(f):v=-1,f.length&&s())}function s(){if(!h){var e=r(a);h=!0;for(var t=f.length;t;){for(m=f,f=[];++v<t;)m&&m[v].run();v=-1,t=f.length}m=null,h=!1,i(e)}}function l(e,t){this.fun=e,this.array=t}function u(){}var c,p,d=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var m,f=[],h=!1,v=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new l(e,t)),1!==f.length||h||r(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=u,d.addListener=u,d.once=u,d.off=u,d.removeListener=u,d.removeAllListeners=u,d.emit=u,d.prependListener=u,d.prependOnceListener=u,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t){/* | ||
*/ | ||
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var o=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==o.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(e,t){for(var o,s,l=n(e),u=1;u<arguments.length;u++){o=Object(arguments[u]);for(var c in o)i.call(o,c)&&(l[c]=o[c]);if(r){s=r(o);for(var p=0;p<s.length;p++)a.call(o,s[p])&&(l[s[p]]=o[s[p]])}}return l}},function(e,t,n){(function(t){"use strict";var n={};"production"!==t.env.NODE_ENV&&Object.freeze(n),e.exports=n}).call(t,n(7))},function(e,t,n){(function(t){"use strict";function n(e,t,n,r,i,a,s,l){if(o(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,a,s,l],p=0;u=new Error(t.replace(/%s/g,function(){return c[p++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}var o=function(e){};"production"!==t.env.NODE_ENV&&(o=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(7))},function(e,t,n){(function(t){"use strict";var o=n(12),r=o;if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=0,i="Warning: "+e.replace(/%s/g,function(){return n[r++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};r=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];i.apply(void 0,[t].concat(o))}}}e.exports=r}).call(t,n(7))},function(e,t){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t){e.exports=_},function(e,t,n){var o,r;o=[],r=function(){"use strict";return{shortText:"hello there young fellow hello there young fellow hello there young fellow hello there young fellow hello there young fellow hello there young fellow",text:"Cras elementum lacus eu dictum vestibulum. Donec eros dui, cursus ut finibus vel, interdum et sem. Sed sed diam dui. Suspendisse at eros non felis faucibus consectetur. Nullam non eleifend sapien. In porttitor est in arcu auctor interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eu sem euismod, dignissim orci sit amet, facilisis leo. Nulla at tempus sapien. Nunc pharetra eros at ex aliquam rutrum. Nunc quis iaculis nulla. Ut semper nisi in felis aliquam, vitae tincidunt erat tristique. Sed lobortis vulputate enim nec feugiat. Suspendisse maximus purus vitae elementum ullamcorper. Praesent fermentum, odio interdum gravida tempus, orci diam volutpat nisl, in sodales erat felis eget lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean nec egestas lorem. In hac habitasse platea dictumst. Donec laoreet felis id enim tempus, id finibus mauris faucibus. Maecenas sed risus sed quam finibus sollicitudin. Donec dictum id elit in faucibus. Sed pretium cursus tempus. Duis pulvinar, felis sit amet aliquam placerat, dolor risus finibus erat, et convallis velit lacus eget lorem. Etiam bibendum ex ac finibus tincidunt. Fusce elementum semper nunc sodales egestas. Maecenas eu facilisis metus. Suspendisse at eleifend lorem, feugiat tempor ligula. Vivamus dictum metus tortor, et dictum nibh sodales eu. Nulla ut iaculis tellus, eu convallis nulla. Proin mollis dui nec quam accumsan, sed pharetra velit elementum. Suspendisse vitae purus sollicitudin, posuere justo in, mattis nisl. Cras elementum lacus eu dictum vestibulum. Donec eros dui, cursus ut finibus vel, interdum et sem. Sed sed diam dui. Suspendisse at eros non felis faucibus consectetur. Nullam non eleifend sapien. In porttitor est in arcu auctor interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eu sem euismod, dignissim orci sit amet, facilisis leo. Nulla at tempus sapien. Nunc pharetra eros at ex aliquam rutrum. Nunc quis iaculis nulla. Ut semper nisi in felis aliquam, vitae tincidunt erat tristique. Sed lobortis vulputate enim nec feugiat. Suspendisse maximus purus vitae elementum ullamcorper. Praesent fermentum, odio interdum gravida tempus, orci diam volutpat nisl, in sodales erat felis eget lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean nec egestas lorem. In hac habitasse platea dictumst. Donec laoreet felis id enim tempus, id finibus mauris faucibus. Maecenas sed risus sed quam finibus sollicitudin. Donec dictum id elit in faucibus. Sed pretium cursus tempus. Duis pulvinar, felis sit amet aliquam placerat, dolor risus finibus erat, et convallis velit lacus eget lorem. Etiam bibendum ex ac finibus tincidunt. Fusce elementum semper nunc sodales egestas. Maecenas eu facilisis metus. Suspendisse at eleifend lorem, feugiat tempor ligula. Vivamus dictum metus tortor, et dictum nibh sodales eu. Nulla ut iaculis tellus, eu convallis nulla. Proin mollis dui nec quam accumsan, sed pharetra velit elementum. Suspendisse vitae purus sollicitudin, posuere justo in, mattis nisl. Cras elementum lacus eu dictum vestibulum. Donec eros dui, cursus ut finibus vel, interdum et sem. Sed sed diam dui. Suspendisse at eros non felis faucibus consectetur. Nullam non eleifend sapien. In porttitor est in arcu auctor interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eu sem euismod, dignissim orci sit amet, facilisis leo. Nulla at tempus sapien. Nunc pharetra eros at ex aliquam rutrum. Nunc quis iaculis nulla. Ut semper nisi in felis aliquam, vitae tincidunt erat tristique. Sed lobortis vulputate enim nec feugiat. Suspendisse maximus purus vitae elementum ullamcorper. Praesent fermentum, odio interdum gravida tempus, orci diam volutpat nisl, in sodales erat felis eget lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean nec egestas lorem. In hac habitasse platea dictumst. Donec laoreet felis id eni."}}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,n){"use strict";var o=n(2),r=n(13),i=n(16);e.exports=function(){function e(e,t,n){return o.createElement("div",{className:"dynamic-content",key:t},t)}function t(){var t=this.getExamplesToDisplay();return o.createElement("div",{className:"example-wrapper"},t.standard?o.createElement("div",{key:"native-example",className:"container native-scroll"},o.createElement("label",{className:"side-title"},"Native Scroll"),o.createElement("div",{className:"panel"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"This is boring")),o.createElement("div",{className:"panel-content-native panel-content"},o.createElement("div",{className:"content-fill"},this.getText())))):null,t.standard?o.createElement("div",{key:"cool-example",className:"container custom-scroll-example"},o.createElement("label",{className:"side-title"},"Custom Scroll"),o.createElement("div",{className:"panel"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"Cool Scrollbar !")),o.createElement(i,{allowOuterScroll:!0},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement("div",{className:"content-fill"},this.getText()))))):null,t.standard?o.createElement("div",{key:"crazy-example",className:"container custom-scroll-example"},o.createElement("label",{className:"side-title"},"Crazy Designer"),o.createElement("div",{className:"panel crazy-scroll"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"Who designed this ???")),o.createElement(i,{allowOuterScroll:!0},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement("div",{className:"content-fill"},this.getText()))))):null,t.flex?o.createElement("div",{key:"flex-example",className:"container example-flex-wrapper"},o.createElement("label",{className:"side-title"},"With CSS Flex"),o.createElement("div",{className:"panel flex-scroll"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"Flexbox!!!")),o.createElement(i,{allowOuterScroll:!0,flex:"1"},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement("div",{className:"content-fill"},this.getText()))))):null,t.dynamic?o.createElement("div",{key:"dynamic-example",className:"container example-dynamic-wrapper"},o.createElement("label",{className:"side-title"},"KeepAtBottom prop"),o.createElement("div",{className:"panel dynamic-scroll"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"DYNAMIC CONTENT!!!")),o.createElement(i,{allowOuterScroll:!0,keepAtBottom:!0},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement.apply(this,["div",{className:"content-fill"},r.map(this.getDynamicContent(),e.bind(this,t))])))),t.dynamic?o.createElement("button",{className:"dynamic-content-button",key:"addContent",onClick:this.addContent},"Add Content"):null,t.dynamic?o.createElement("button",{className:"dynamic-content-button",key:"removeContent",onClick:this.removeContent},"Remove Content"):null):null,o.createElement("div",{className:"scroll-creator"}))}return t.apply(this,[])}},function(e,t,n){"use strict";function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}function s(e,t,n){return t=t||0===t?t:e,n=n||0===n?n:e,t>n?(console.error("min limit is greater than max limit"),e):e<t?t:e>n?n:e}function l(e,t){var n=t.getBoundingClientRect();return u(e,n)}function u(e,t){return e.clientX>t.left&&e.clientX<t.right&&e.clientY>t.top&&e.clientY<t.top+t.height}function c(e){var t=this.props.minScrollHandleHeight;if(e.height>=t)return e;var n=t-e.height,o=this.state.scrollPos/(this.contentHeight-this.visibleHeight),r=n*o,i=e.top-r;return{height:t,top:i}}var p=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),d=n(2),m=n(3),f=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollbarYWidth=0,n.state={scrollPos:0,onDrag:!1},n.onHandleDrag=n.onHandleDrag.bind(n),n.onHandleDragEnd=n.onHandleDragEnd.bind(n),n.blockOuterScroll=n.blockOuterScroll.bind(n),n.onScroll=n.onScroll.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onClick=n.onClick.bind(n),n.setCustomScrollbarRef=n.setCustomScrollbarRef.bind(n),n.setRefElement=function(e){return function(t){t&&!n[e]&&(n[e]=t)}},n}return a(t,e),p(t,[{key:"componentDidMount",value:function(){"undefined"!=typeof this.props.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.forceUpdate()}},{key:"componentWillReceiveProps",value:function(){this.externalRender=!0}},{key:"componentDidUpdate",value:function(e,t){var n=this.contentHeight,o=this.visibleHeight,r=this.getScrolledElement(),i=t.scrollPos>=n-o;this.contentHeight=r.scrollHeight,this.scrollbarYWidth=r.offsetWidth-r.clientWidth,this.visibleHeight=r.clientHeight,this.scrollRatio=this.contentHeight?this.visibleHeight/this.contentHeight:1,this.toggleScrollIfNeeded(),(this.props.freezePosition||e.freezePosition)&&this.adjustFreezePosition(e),"undefined"!=typeof this.props.scrollTo&&this.props.scrollTo!==e.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.props.keepAtBottom&&this.externalRender&&i&&this.updateScrollPosition(this.contentHeight-this.visibleHeight),this.externalRender=!1}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"adjustFreezePosition",value:function(e){var t=this.getScrolledElement(),n=this.contentWrapper;this.props.freezePosition&&(n.scrollTop=this.state.scrollPos),e.freezePosition&&(t.scrollTop=this.state.scrollPos)}},{key:"toggleScrollIfNeeded",value:function(){var e=this.contentHeight-this.visibleHeight>1;this.hasScroll!==e&&(this.hasScroll=e,this.forceUpdate())}},{key:"getScrollTop",value:function(){return this.getScrolledElement().scrollTop}},{key:"updateScrollPosition",value:function(e){var t=this.getScrolledElement();t.scrollTop=e,this.setState({scrollPos:e})}},{key:"onClick",value:function(e){if(this.hasScroll&&this.isMouseEventOnCustomScrollbar(e)&&!this.isMouseEventOnScrollHandle(e)){var t=this.calculateNewScrollHandleTop(e),n=this.getScrollValueFromHandlePosition(t);this.updateScrollPosition(n)}}},{key:"isMouseEventOnCustomScrollbar",value:function(e){if(!this.customScrollbarRef)return!1;var t=m.findDOMNode(this),n=t.getBoundingClientRect().toJSON(),o=this.customScrollbarRef.getBoundingClientRect(),r=this.props.rtl?{left:n.left,right:o.right}:{left:o.left,width:n.right},i=Object.assign({},n,r);return u(e,i)}},{key:"isMouseEventOnScrollHandle",value:function(e){if(!this.scrollHandle)return!1;var t=m.findDOMNode(this.scrollHandle);return l(e,t)}},{key:"calculateNewScrollHandleTop",value:function(e){var t=m.findDOMNode(this),n=t.getBoundingClientRect(),o=n.top+window.pageYOffset,r=e.pageY-o,i=this.getScrollHandleStyle().top,a=void 0,s=r>i+this.scrollHandleHeight;return a=s?i+Math.min(this.scrollHandleHeight,this.visibleHeight-this.scrollHandleHeight):i-Math.max(this.scrollHandleHeight,0)}},{key:"getScrollValueFromHandlePosition",value:function(e){return e/this.scrollRatio}},{key:"getScrollHandleStyle",value:function(){var e=this.state.scrollPos*this.scrollRatio;return this.scrollHandleHeight=this.visibleHeight*this.scrollRatio,{height:this.scrollHandleHeight,top:e}}},{key:"adjustCustomScrollPosToContentPos",value:function(e){this.setState({scrollPos:e})}},{key:"onScroll",value:function(e){this.props.freezePosition||(this.adjustCustomScrollPosToContentPos(e.currentTarget.scrollTop),this.props.onScroll&&this.props.onScroll(e))}},{key:"getScrolledElement",value:function(){return this.innerContainer}},{key:"onMouseDown",value:function(e){this.hasScroll&&this.isMouseEventOnScrollHandle(e)&&(this.startDragHandlePos=this.getScrollHandleStyle().top,this.startDragMousePos=e.pageY,this.setState({onDrag:!0}),document.addEventListener("mousemove",this.onHandleDrag),document.addEventListener("mouseup",this.onHandleDragEnd))}},{key:"onHandleDrag",value:function(e){e.preventDefault();var t=e.pageY-this.startDragMousePos,n=s(this.startDragHandlePos+t,0,this.visibleHeight-this.scrollHandleHeight),o=this.getScrollValueFromHandlePosition(n);this.updateScrollPosition(o)}},{key:"onHandleDragEnd",value:function(e){this.setState({onDrag:!1}),e.preventDefault(),document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"blockOuterScroll",value:function(e){if(!this.props.allowOuterScroll){var t=e.currentTarget,n=e.currentTarget.scrollHeight,o=n-e.currentTarget.offsetHeight,r=e.deltaY%3?e.deltaY:10*e.deltaY;t.scrollTop+r<=0?(t.scrollTop=0,e.preventDefault()):t.scrollTop+r>=o&&(t.scrollTop=o,e.preventDefault()),e.stopPropagation()}}},{key:"getInnerContainerClasses",value:function(){var e="inner-container";return this.state.scrollPos&&this.props.addScrolledClass&&(e+=" content-scrolled"),e}},{key:"getScrollStyles",value:function(){var e,t,n=this.scrollbarYWidth||20,r=this.props.rtl?"marginLeft":"marginRight",i=(e={},o(e,r,-1*n),o(e,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),e),a=(t={},o(t,r,this.scrollbarYWidth?0:n),o(t,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),o(t,"overflowY",this.props.freezePosition?"hidden":"visible"),t);return{innerContainer:i,contentWrapper:a}}},{key:"getOuterContainerStyle",value:function(){return{height:this.props.heightRelativeToParent||this.props.flex?"100%":""}}},{key:"getRootStyles",value:function(){var e={};return this.props.heightRelativeToParent?e.height=this.props.heightRelativeToParent:this.props.flex&&(e.flex=this.props.flex),e}},{key:"setCustomScrollbarRef",value:function(e){e&&!this.customScrollbarRef&&(this.customScrollbarRef=e)}},{key:"render",value:function(){var e=this.getScrollStyles(),t=this.getRootStyles(),n=c.call(this,this.getScrollHandleStyle());return d.createElement("div",{className:"custom-scroll "+(this.state.onDrag?"scroll-handle-dragged":""),style:t},d.createElement("div",{className:"outer-container",style:this.getOuterContainerStyle(),onMouseDown:this.onMouseDown,onClick:this.onClick},this.hasScroll&&d.createElement("div",{ref:this.setCustomScrollbarRef,className:"custom-scrollbar"+(this.props.rtl?" custom-scrollbar-rtl":""),key:"scrollbar"},d.createElement("div",{ref:this.setRefElement("scrollHandle"),className:"custom-scroll-handle",style:n},d.createElement("div",{className:this.props.handleClass}))),d.createElement("div",{ref:this.setRefElement("innerContainer"),className:this.getInnerContainerClasses(),style:e.innerContainer,onScroll:this.onScroll,onWheel:this.blockOuterScroll},d.createElement("div",{className:"content-wrapper",ref:this.setRefElement("contentWrapper"),style:e.contentWrapper},this.props.children))))}}]),t}(d.Component);try{var h=n(17);f.propTypes={children:h.any,allowOuterScroll:h.bool,heightRelativeToParent:h.string,onScroll:h.func,addScrolledClass:h.bool,freezePosition:h.bool,handleClass:h.string,minScrollHandleHeight:h.number,flex:h.string,rtl:h.bool,scrollTo:h.number,keepAtBottom:h.bool}}catch(e){}f.defaultProps={handleClass:"inner-handle",minScrollHandleHeight:38},e.exports=f},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,r=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},i=!0;e.exports=n(18)(r,i)}else e.exports=n(21)()}).call(t,n(7))},function(e,t,n){(function(t){"use strict";var o=n(12),r=n(10),i=n(11),a=n(19),s=n(20);e.exports=function(e,n){function l(e){var t=e&&(_&&e[_]||e[C]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function p(e){function o(o,u,p,d,m,f,h){if(d=d||w,f=f||p,h!==a)if(n)r(!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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var v=d+":"+p;!s[v]&&l<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",f,d),s[v]=!0,l++)}return null==u[p]?o?new c(null===u[p]?"The "+m+" `"+f+"` is marked as required "+("in `"+d+"`, but its value is `null`."):"The "+m+" `"+f+"` is marked as required in "+("`"+d+"`, but its value is `undefined`.")):null:e(u,p,d,m,f)}if("production"!==t.env.NODE_ENV)var s={},l=0;var u=o.bind(null,!1);return u.isRequired=o.bind(null,!0),u}function d(e){function t(t,n,o,r,i,a){var s=t[n],l=x(s);if(l!==e){var u=P(s);return new c("Invalid "+r+" `"+i+"` of type "+("`"+u+"` supplied to `"+o+"`, expected ")+("`"+e+"`."))}return null}return p(t)}function m(){return p(o.thatReturnsNull)}function f(e){function t(t,n,o,r,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var l=x(s);return new c("Invalid "+r+" `"+i+"` of type "+("`"+l+"` supplied to `"+o+"`, expected an array."))}for(var u=0;u<s.length;u++){var p=e(s,u,o,r,i+"["+u+"]",a);if(p instanceof Error)return p}return null}return p(t)}function h(){function t(t,n,o,r,i){var a=t[n];if(!e(a)){var s=x(a);return new c("Invalid "+r+" `"+i+"` of type "+("`"+s+"` supplied to `"+o+"`, expected a single ReactElement."))}return null}return p(t)}function v(e){function t(t,n,o,r,i){if(!(t[n]instanceof e)){var a=e.name||w,s=O(t[n]);return new c("Invalid "+r+" `"+i+"` of type "+("`"+s+"` supplied to `"+o+"`, expected ")+("instance of `"+a+"`."))}return null}return p(t)}function y(e){function n(t,n,o,r,i){for(var a=t[n],s=0;s<e.length;s++)if(u(a,e[s]))return null;var l=JSON.stringify(e);return new c("Invalid "+r+" `"+i+"` of value `"+a+"` "+("supplied to `"+o+"`, expected one of "+l+"."))}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,o.thatReturnsNull)}function g(e){function t(t,n,o,r,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[n],l=x(s);if("object"!==l)return new c("Invalid "+r+" `"+i+"` of type "+("`"+l+"` supplied to `"+o+"`, expected an object."));for(var u in s)if(s.hasOwnProperty(u)){var p=e(s,u,o,r,i+"."+u,a);if(p instanceof Error)return p}return null}return p(t)}function E(e){function n(t,n,o,r,i){for(var s=0;s<e.length;s++){var l=e[s];if(null==l(t,n,o,r,i,a))return null}return new c("Invalid "+r+" `"+i+"` supplied to "+("`"+o+"`."))}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,o.thatReturnsNull)}function b(){function e(e,t,n,o,r){return S(e[t])?null:new c("Invalid "+o+" `"+r+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return p(e)}function N(e){function t(t,n,o,r,i){var s=t[n],l=x(s);if("object"!==l)return new c("Invalid "+r+" `"+i+"` of type `"+l+"` "+("supplied to `"+o+"`, expected `object`."));for(var u in e){var p=e[u];if(p){var d=p(s,u,o,r,i+"."+u,a);if(d)return d}}return null}return p(t)}function S(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(S);if(null===t||e(t))return!0;var n=l(t);if(!n)return!1;var o,r=n.call(t);if(n!==t.entries){for(;!(o=r.next()).done;)if(!S(o.value))return!1}else for(;!(o=r.next()).done;){var i=o.value;if(i&&!S(i[1]))return!1}return!0;default:return!1}}function D(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function x(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":D(t,e)?"symbol":t}function P(e){var t=x(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function O(e){return e.constructor&&e.constructor.name?e.constructor.name:w}var _="function"==typeof Symbol&&Symbol.iterator,C="@@iterator",w="<<anonymous>>",T={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:m(),arrayOf:f,element:h(),instanceOf:v,node:b(),objectOf:g,oneOf:y,oneOfType:E,shape:N};return c.prototype=Error.prototype,T.checkPropTypes=s,T.PropTypes=T,T}}).call(t,n(7))},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){"use strict";function o(e,n,o,l,u){if("production"!==t.env.NODE_ENV)for(var c in e)if(e.hasOwnProperty(c)){var p;try{r("function"==typeof e[c],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",l||"React class",o,c),p=e[c](n,c,l,o,null,a)}catch(e){p=e}if(i(!p||p instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",o,c,typeof p),p instanceof Error&&!(p.message in s)){s[p.message]=!0;var d=u?u():"";i(!1,"Failed %s type: %s%s",o,p.message,null!=d?d:"")}}}if("production"!==t.env.NODE_ENV)var r=n(10),i=n(11),a=n(19),s={};e.exports=o}).call(t,n(7))},function(e,t,n){"use strict";var o=n(12),r=n(10);e.exports=function(){function e(){r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=o,n.PropTypes=n,n}}]); | ||
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var o=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==o.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(e,t){for(var o,s,l=n(e),u=1;u<arguments.length;u++){o=Object(arguments[u]);for(var c in o)i.call(o,c)&&(l[c]=o[c]);if(r){s=r(o);for(var p=0;p<s.length;p++)a.call(o,s[p])&&(l[s[p]]=o[s[p]])}}return l}},function(e,t,n){(function(t){"use strict";var n={};"production"!==t.env.NODE_ENV&&Object.freeze(n),e.exports=n}).call(t,n(7))},function(e,t,n){(function(t){"use strict";function n(e,t,n,r,i,a,s,l){if(o(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,a,s,l],p=0;u=new Error(t.replace(/%s/g,function(){return c[p++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}var o=function(e){};"production"!==t.env.NODE_ENV&&(o=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(7))},function(e,t,n){(function(t){"use strict";var o=n(12),r=o;if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=0,i="Warning: "+e.replace(/%s/g,function(){return n[r++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};r=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];i.apply(void 0,[t].concat(o))}}}e.exports=r}).call(t,n(7))},function(e,t){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t){e.exports=_},function(e,t,n){var o,r;o=[],r=function(){"use strict";return{shortText:"hello there young fellow hello there young fellow hello there young fellow hello there young fellow hello there young fellow hello there young fellow",text:"Cras elementum lacus eu dictum vestibulum. Donec eros dui, cursus ut finibus vel, interdum et sem. Sed sed diam dui. Suspendisse at eros non felis faucibus consectetur. Nullam non eleifend sapien. In porttitor est in arcu auctor interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eu sem euismod, dignissim orci sit amet, facilisis leo. Nulla at tempus sapien. Nunc pharetra eros at ex aliquam rutrum. Nunc quis iaculis nulla. Ut semper nisi in felis aliquam, vitae tincidunt erat tristique. Sed lobortis vulputate enim nec feugiat. Suspendisse maximus purus vitae elementum ullamcorper. Praesent fermentum, odio interdum gravida tempus, orci diam volutpat nisl, in sodales erat felis eget lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean nec egestas lorem. In hac habitasse platea dictumst. Donec laoreet felis id enim tempus, id finibus mauris faucibus. Maecenas sed risus sed quam finibus sollicitudin. Donec dictum id elit in faucibus. Sed pretium cursus tempus. Duis pulvinar, felis sit amet aliquam placerat, dolor risus finibus erat, et convallis velit lacus eget lorem. Etiam bibendum ex ac finibus tincidunt. Fusce elementum semper nunc sodales egestas. Maecenas eu facilisis metus. Suspendisse at eleifend lorem, feugiat tempor ligula. Vivamus dictum metus tortor, et dictum nibh sodales eu. Nulla ut iaculis tellus, eu convallis nulla. Proin mollis dui nec quam accumsan, sed pharetra velit elementum. Suspendisse vitae purus sollicitudin, posuere justo in, mattis nisl. Cras elementum lacus eu dictum vestibulum. Donec eros dui, cursus ut finibus vel, interdum et sem. Sed sed diam dui. Suspendisse at eros non felis faucibus consectetur. Nullam non eleifend sapien. In porttitor est in arcu auctor interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eu sem euismod, dignissim orci sit amet, facilisis leo. Nulla at tempus sapien. Nunc pharetra eros at ex aliquam rutrum. Nunc quis iaculis nulla. Ut semper nisi in felis aliquam, vitae tincidunt erat tristique. Sed lobortis vulputate enim nec feugiat. Suspendisse maximus purus vitae elementum ullamcorper. Praesent fermentum, odio interdum gravida tempus, orci diam volutpat nisl, in sodales erat felis eget lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean nec egestas lorem. In hac habitasse platea dictumst. Donec laoreet felis id enim tempus, id finibus mauris faucibus. Maecenas sed risus sed quam finibus sollicitudin. Donec dictum id elit in faucibus. Sed pretium cursus tempus. Duis pulvinar, felis sit amet aliquam placerat, dolor risus finibus erat, et convallis velit lacus eget lorem. Etiam bibendum ex ac finibus tincidunt. Fusce elementum semper nunc sodales egestas. Maecenas eu facilisis metus. Suspendisse at eleifend lorem, feugiat tempor ligula. Vivamus dictum metus tortor, et dictum nibh sodales eu. Nulla ut iaculis tellus, eu convallis nulla. Proin mollis dui nec quam accumsan, sed pharetra velit elementum. Suspendisse vitae purus sollicitudin, posuere justo in, mattis nisl. Cras elementum lacus eu dictum vestibulum. Donec eros dui, cursus ut finibus vel, interdum et sem. Sed sed diam dui. Suspendisse at eros non felis faucibus consectetur. Nullam non eleifend sapien. In porttitor est in arcu auctor interdum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque eu sem euismod, dignissim orci sit amet, facilisis leo. Nulla at tempus sapien. Nunc pharetra eros at ex aliquam rutrum. Nunc quis iaculis nulla. Ut semper nisi in felis aliquam, vitae tincidunt erat tristique. Sed lobortis vulputate enim nec feugiat. Suspendisse maximus purus vitae elementum ullamcorper. Praesent fermentum, odio interdum gravida tempus, orci diam volutpat nisl, in sodales erat felis eget lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean nec egestas lorem. In hac habitasse platea dictumst. Donec laoreet felis id eni."}}.apply(t,o),!(void 0!==r&&(e.exports=r))},function(e,t,n){"use strict";var o=n(2),r=n(13),i=n(16);e.exports=function(){function e(e,t,n){return o.createElement("div",{className:"dynamic-content",key:t},t)}function t(){var t=this.getExamplesToDisplay();return o.createElement("div",{className:"example-wrapper"},t.standard?o.createElement("div",{key:"native-example",className:"container native-scroll"},o.createElement("label",{className:"side-title"},"Native Scroll"),o.createElement("div",{className:"panel"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"This is boring")),o.createElement("div",{className:"panel-content-native panel-content"},o.createElement("div",{className:"content-fill"},this.getText())))):null,t.standard?o.createElement("div",{key:"cool-example",className:"container custom-scroll-example"},o.createElement("label",{className:"side-title"},"Custom Scroll"),o.createElement("div",{className:"panel"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"Cool Scrollbar !")),o.createElement(i,{allowOuterScroll:!0},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement("div",{className:"content-fill"},this.getText()))))):null,t.standard?o.createElement("div",{key:"crazy-example",className:"container custom-scroll-example"},o.createElement("label",{className:"side-title"},"Crazy Designer"),o.createElement("div",{className:"panel crazy-scroll"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"Who designed this ???")),o.createElement(i,{allowOuterScroll:!0},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement("div",{className:"content-fill"},this.getText()))))):null,t.flex?o.createElement("div",{key:"flex-example",className:"container example-flex-wrapper"},o.createElement("label",{className:"side-title"},"With CSS Flex"),o.createElement("div",{className:"panel flex-scroll"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"Flexbox!!!")),o.createElement(i,{allowOuterScroll:!0,flex:"1"},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement("div",{className:"content-fill"},this.getText()))))):null,t.dynamic?o.createElement("div",{key:"dynamic-example",className:"container example-dynamic-wrapper"},o.createElement("label",{className:"side-title"},"KeepAtBottom prop"),o.createElement("div",{className:"panel dynamic-scroll"},o.createElement("div",{className:"panel-header"},o.createElement("label",{className:"panel-title"},"DYNAMIC CONTENT!!!")),o.createElement(i,{allowOuterScroll:!0,keepAtBottom:!0},o.createElement("div",{className:"panel-content-custom panel-content"},o.createElement.apply(this,["div",{className:"content-fill"},r.map(this.getDynamicContent(),e.bind(this,t))])))),t.dynamic?o.createElement("button",{className:"dynamic-content-button",key:"addContent",onClick:this.addContent},"Add Content"):null,t.dynamic?o.createElement("button",{className:"dynamic-content-button",key:"removeContent",onClick:this.removeContent},"Remove Content"):null):null,o.createElement("div",{className:"scroll-creator"}))}return t.apply(this,[])}},function(e,t,n){"use strict";function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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)}function s(e,t,n){return t=t||0===t?t:e,n=n||0===n?n:e,t>n?(console.error("min limit is greater than max limit"),e):e<t?t:e>n?n:e}function l(e,t){var n=t.getBoundingClientRect();return u(e,n)}function u(e,t){return e.clientX>t.left&&e.clientX<t.right&&e.clientY>t.top&&e.clientY<t.top+t.height}function c(e){var t=this.props.minScrollHandleHeight;if(e.height>=t)return e;var n=t-e.height,o=this.state.scrollPos/(this.contentHeight-this.visibleHeight),r=n*o,i=e.top-r;return{height:t,top:i}}var p=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),d=n(2),m=n(3),f=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollbarYWidth=0,n.state={scrollPos:0,onDrag:!1},n.onHandleDrag=n.onHandleDrag.bind(n),n.onHandleDragEnd=n.onHandleDragEnd.bind(n),n.blockOuterScroll=n.blockOuterScroll.bind(n),n.onScroll=n.onScroll.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onClick=n.onClick.bind(n),n.setCustomScrollbarRef=n.setCustomScrollbarRef.bind(n),n.setRefElement=function(e){return function(t){t&&!n[e]&&(n[e]=t)}},n}return a(t,e),p(t,[{key:"componentDidMount",value:function(){"undefined"!=typeof this.props.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.forceUpdate()}},{key:"componentWillReceiveProps",value:function(){this.externalRender=!0}},{key:"componentDidUpdate",value:function(e,t){var n=this.contentHeight,o=this.visibleHeight,r=this.getScrolledElement(),i=t.scrollPos>=n-o;this.contentHeight=r.scrollHeight,this.scrollbarYWidth=r.offsetWidth-r.clientWidth,this.visibleHeight=r.clientHeight,this.scrollRatio=this.contentHeight?this.visibleHeight/this.contentHeight:1,this.toggleScrollIfNeeded(),(this.props.freezePosition||e.freezePosition)&&this.adjustFreezePosition(e),"undefined"!=typeof this.props.scrollTo&&this.props.scrollTo!==e.scrollTo?this.updateScrollPosition(this.props.scrollTo):this.props.keepAtBottom&&this.externalRender&&i&&this.updateScrollPosition(this.contentHeight-this.visibleHeight),this.externalRender=!1}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"adjustFreezePosition",value:function(e){var t=this.getScrolledElement(),n=this.contentWrapper;this.props.freezePosition&&(n.scrollTop=this.state.scrollPos),e.freezePosition&&(t.scrollTop=this.state.scrollPos)}},{key:"toggleScrollIfNeeded",value:function(){var e=this.contentHeight-this.visibleHeight>1;this.hasScroll!==e&&(this.hasScroll=e,this.forceUpdate())}},{key:"getScrollTop",value:function(){return this.getScrolledElement().scrollTop}},{key:"updateScrollPosition",value:function(e){var t=this.getScrolledElement();t.scrollTop=e,this.setState({scrollPos:e})}},{key:"onClick",value:function(e){if(this.hasScroll&&this.isMouseEventOnCustomScrollbar(e)&&!this.isMouseEventOnScrollHandle(e)){var t=this.calculateNewScrollHandleTop(e),n=this.getScrollValueFromHandlePosition(t);this.updateScrollPosition(n)}}},{key:"isMouseEventOnCustomScrollbar",value:function(e){if(!this.customScrollbarRef)return!1;var t=m.findDOMNode(this),n=t.getBoundingClientRect().toJSON(),o=this.customScrollbarRef.getBoundingClientRect(),r=this.props.rtl?{left:n.left,right:o.right}:{left:o.left,width:n.right},i=Object.assign({},n,r);return u(e,i)}},{key:"isMouseEventOnScrollHandle",value:function(e){if(!this.scrollHandle)return!1;var t=m.findDOMNode(this.scrollHandle);return l(e,t)}},{key:"calculateNewScrollHandleTop",value:function(e){var t=m.findDOMNode(this),n=t.getBoundingClientRect(),o=n.top+window.pageYOffset,r=e.pageY-o,i=this.getScrollHandleStyle().top,a=void 0,s=r>i+this.scrollHandleHeight;return a=s?i+Math.min(this.scrollHandleHeight,this.visibleHeight-this.scrollHandleHeight):i-Math.max(this.scrollHandleHeight,0)}},{key:"getScrollValueFromHandlePosition",value:function(e){return e/this.scrollRatio}},{key:"getScrollHandleStyle",value:function(){var e=this.state.scrollPos*this.scrollRatio;return this.scrollHandleHeight=this.visibleHeight*this.scrollRatio,{height:this.scrollHandleHeight,top:e}}},{key:"adjustCustomScrollPosToContentPos",value:function(e){this.setState({scrollPos:e})}},{key:"onScroll",value:function(e){this.props.freezePosition||(this.adjustCustomScrollPosToContentPos(e.currentTarget.scrollTop),this.props.onScroll&&this.props.onScroll(e))}},{key:"getScrolledElement",value:function(){return this.innerContainer}},{key:"onMouseDown",value:function(e){this.hasScroll&&this.isMouseEventOnScrollHandle(e)&&(this.startDragHandlePos=this.getScrollHandleStyle().top,this.startDragMousePos=e.pageY,this.setState({onDrag:!0}),document.addEventListener("mousemove",this.onHandleDrag),document.addEventListener("mouseup",this.onHandleDragEnd))}},{key:"onHandleDrag",value:function(e){e.preventDefault();var t=e.pageY-this.startDragMousePos,n=s(this.startDragHandlePos+t,0,this.visibleHeight-this.scrollHandleHeight),o=this.getScrollValueFromHandlePosition(n);this.updateScrollPosition(o)}},{key:"onHandleDragEnd",value:function(e){this.setState({onDrag:!1}),e.preventDefault(),document.removeEventListener("mousemove",this.onHandleDrag),document.removeEventListener("mouseup",this.onHandleDragEnd)}},{key:"blockOuterScroll",value:function(e){if(!this.props.allowOuterScroll){var t=e.currentTarget,n=e.currentTarget.scrollHeight,o=n-e.currentTarget.offsetHeight,r=e.deltaY%3?e.deltaY:10*e.deltaY;t.scrollTop+r<=0?(t.scrollTop=0,e.preventDefault()):t.scrollTop+r>=o&&(t.scrollTop=o,e.preventDefault()),e.stopPropagation()}}},{key:"getInnerContainerClasses",value:function(){var e="inner-container";return this.state.scrollPos&&this.props.addScrolledClass&&(e+=" content-scrolled"),e}},{key:"getScrollStyles",value:function(){var e,t,n=this.scrollbarYWidth||20,r=this.props.rtl?"marginLeft":"marginRight",i=(e={},o(e,r,-1*n),o(e,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),e),a=(t={},o(t,r,this.scrollbarYWidth?0:n),o(t,"height",this.props.heightRelativeToParent||this.props.flex?"100%":""),o(t,"overflowY",this.props.freezePosition?"hidden":"visible"),t);return{innerContainer:i,contentWrapper:a}}},{key:"getOuterContainerStyle",value:function(){return{height:this.props.heightRelativeToParent||this.props.flex?"100%":""}}},{key:"getRootStyles",value:function(){var e={};return this.props.heightRelativeToParent?e.height=this.props.heightRelativeToParent:this.props.flex&&(e.flex=this.props.flex),e}},{key:"setCustomScrollbarRef",value:function(e){e&&!this.customScrollbarRef&&(this.customScrollbarRef=e)}},{key:"render",value:function(){var e=this.getScrollStyles(),t=this.getRootStyles(),n=c.call(this,this.getScrollHandleStyle());return d.createElement("div",{className:"custom-scroll "+(this.state.onDrag?"scroll-handle-dragged":""),style:t},d.createElement("div",{className:"outer-container",style:this.getOuterContainerStyle(),onMouseDown:this.onMouseDown,onClick:this.onClick},this.hasScroll?d.createElement("div",{className:"positioning"},d.createElement("div",{ref:this.setCustomScrollbarRef,className:"custom-scrollbar"+(this.props.rtl?" custom-scrollbar-rtl":""),key:"scrollbar"},d.createElement("div",{ref:this.setRefElement("scrollHandle"),className:"custom-scroll-handle",style:n},d.createElement("div",{className:this.props.handleClass})))):null,d.createElement("div",{ref:this.setRefElement("innerContainer"),className:this.getInnerContainerClasses(),style:e.innerContainer,onScroll:this.onScroll,onWheel:this.blockOuterScroll},d.createElement("div",{className:"content-wrapper",ref:this.setRefElement("contentWrapper"),style:e.contentWrapper},this.props.children))))}}]),t}(d.Component);try{var h=n(17);f.propTypes={children:h.any,allowOuterScroll:h.bool,heightRelativeToParent:h.string,onScroll:h.func,addScrolledClass:h.bool,freezePosition:h.bool,handleClass:h.string,minScrollHandleHeight:h.number,flex:h.string,rtl:h.bool,scrollTo:h.number,keepAtBottom:h.bool}}catch(e){}f.defaultProps={handleClass:"inner-handle",minScrollHandleHeight:38},e.exports=f},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,r=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},i=!0;e.exports=n(18)(r,i)}else e.exports=n(21)()}).call(t,n(7))},function(e,t,n){(function(t){"use strict";var o=n(12),r=n(10),i=n(11),a=n(19),s=n(20);e.exports=function(e,n){function l(e){var t=e&&(_&&e[_]||e[C]);if("function"==typeof t)return t}function u(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function p(e){function o(o,u,p,d,m,f,h){if(d=d||w,f=f||p,h!==a)if(n)r(!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");else if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var v=d+":"+p;!s[v]&&l<3&&(i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",f,d),s[v]=!0,l++)}return null==u[p]?o?new c(null===u[p]?"The "+m+" `"+f+"` is marked as required "+("in `"+d+"`, but its value is `null`."):"The "+m+" `"+f+"` is marked as required in "+("`"+d+"`, but its value is `undefined`.")):null:e(u,p,d,m,f)}if("production"!==t.env.NODE_ENV)var s={},l=0;var u=o.bind(null,!1);return u.isRequired=o.bind(null,!0),u}function d(e){function t(t,n,o,r,i,a){var s=t[n],l=x(s);if(l!==e){var u=P(s);return new c("Invalid "+r+" `"+i+"` of type "+("`"+u+"` supplied to `"+o+"`, expected ")+("`"+e+"`."))}return null}return p(t)}function m(){return p(o.thatReturnsNull)}function f(e){function t(t,n,o,r,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var l=x(s);return new c("Invalid "+r+" `"+i+"` of type "+("`"+l+"` supplied to `"+o+"`, expected an array."))}for(var u=0;u<s.length;u++){var p=e(s,u,o,r,i+"["+u+"]",a);if(p instanceof Error)return p}return null}return p(t)}function h(){function t(t,n,o,r,i){var a=t[n];if(!e(a)){var s=x(a);return new c("Invalid "+r+" `"+i+"` of type "+("`"+s+"` supplied to `"+o+"`, expected a single ReactElement."))}return null}return p(t)}function v(e){function t(t,n,o,r,i){if(!(t[n]instanceof e)){var a=e.name||w,s=O(t[n]);return new c("Invalid "+r+" `"+i+"` of type "+("`"+s+"` supplied to `"+o+"`, expected ")+("instance of `"+a+"`."))}return null}return p(t)}function y(e){function n(t,n,o,r,i){for(var a=t[n],s=0;s<e.length;s++)if(u(a,e[s]))return null;var l=JSON.stringify(e);return new c("Invalid "+r+" `"+i+"` of value `"+a+"` "+("supplied to `"+o+"`, expected one of "+l+"."))}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,o.thatReturnsNull)}function g(e){function t(t,n,o,r,i){if("function"!=typeof e)return new c("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var s=t[n],l=x(s);if("object"!==l)return new c("Invalid "+r+" `"+i+"` of type "+("`"+l+"` supplied to `"+o+"`, expected an object."));for(var u in s)if(s.hasOwnProperty(u)){var p=e(s,u,o,r,i+"."+u,a);if(p instanceof Error)return p}return null}return p(t)}function E(e){function n(t,n,o,r,i){for(var s=0;s<e.length;s++){var l=e[s];if(null==l(t,n,o,r,i,a))return null}return new c("Invalid "+r+" `"+i+"` supplied to "+("`"+o+"`."))}return Array.isArray(e)?p(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,o.thatReturnsNull)}function b(){function e(e,t,n,o,r){return S(e[t])?null:new c("Invalid "+o+" `"+r+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return p(e)}function N(e){function t(t,n,o,r,i){var s=t[n],l=x(s);if("object"!==l)return new c("Invalid "+r+" `"+i+"` of type `"+l+"` "+("supplied to `"+o+"`, expected `object`."));for(var u in e){var p=e[u];if(p){var d=p(s,u,o,r,i+"."+u,a);if(d)return d}}return null}return p(t)}function S(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(S);if(null===t||e(t))return!0;var n=l(t);if(!n)return!1;var o,r=n.call(t);if(n!==t.entries){for(;!(o=r.next()).done;)if(!S(o.value))return!1}else for(;!(o=r.next()).done;){var i=o.value;if(i&&!S(i[1]))return!1}return!0;default:return!1}}function D(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function x(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":D(t,e)?"symbol":t}function P(e){var t=x(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function O(e){return e.constructor&&e.constructor.name?e.constructor.name:w}var _="function"==typeof Symbol&&Symbol.iterator,C="@@iterator",w="<<anonymous>>",T={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:m(),arrayOf:f,element:h(),instanceOf:v,node:b(),objectOf:g,oneOf:y,oneOfType:E,shape:N};return c.prototype=Error.prototype,T.checkPropTypes=s,T.PropTypes=T,T}}).call(t,n(7))},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){(function(t){"use strict";function o(e,n,o,l,u){if("production"!==t.env.NODE_ENV)for(var c in e)if(e.hasOwnProperty(c)){var p;try{r("function"==typeof e[c],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",l||"React class",o,c),p=e[c](n,c,l,o,null,a)}catch(e){p=e}if(i(!p||p instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",l||"React class",o,c,typeof p),p instanceof Error&&!(p.message in s)){s[p.message]=!0;var d=u?u():"";i(!1,"Failed %s type: %s%s",o,p.message,null!=d?d:"")}}}if("production"!==t.env.NODE_ENV)var r=n(10),i=n(11),a=n(19),s={};e.exports=o}).call(t,n(7))},function(e,t,n){"use strict";var o=n(12),r=n(10);e.exports=function(){function e(){r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=o,n.PropTypes=n,n}}]); | ||
//# sourceMappingURL=example.js.map |
{ | ||
"name": "react-custom-scroll", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "An easily designable, cross browser (!!), custom scroll with ReactJS Animations and scroll rate **exactly** like native scroll", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -349,3 +349,4 @@ 'use strict' | ||
onClick={this.onClick}> | ||
{this.hasScroll && ( | ||
{this.hasScroll ? ( | ||
<div className="positioning"> | ||
<div ref={this.setCustomScrollbarRef} | ||
@@ -359,3 +360,4 @@ className={`custom-scrollbar${ this.props.rtl ? ' custom-scrollbar-rtl' : ''}`} | ||
</div> | ||
</div>)} | ||
</div> | ||
</div>) : null} | ||
<div ref={this.setRefElement('innerContainer')} | ||
@@ -362,0 +364,0 @@ className={this.getInnerContainerClasses()} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
586674
2470