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

react-input-range

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-input-range - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

10

CHANGELOG.md

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

<a name="1.1.2"></a>
## [1.1.2](https://github.com/davidchin/react-input-range/compare/v1.1.1...v1.1.2) (2017-03-30)
### Bug Fixes
* **build:** Fix requiring React as an external dependency ([903eadb](https://github.com/davidchin/react-input-range/commit/903eadb))
<a name="1.1.1"></a>

@@ -2,0 +12,0 @@ ## [1.1.1](https://github.com/davidchin/react-input-range/compare/v1.1.0...v1.1.1) (2017-03-28)

2

lib/bundle/react-input-range.min.js

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

!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.InputRange=t(require("react")):e.InputRange=t(e.react)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(14);Object.defineProperty(t,"captialize",{enumerable:!0,get:function(){return o(r).default}});var a=n(15);Object.defineProperty(t,"clamp",{enumerable:!0,get:function(){return o(a).default}});var u=n(16);Object.defineProperty(t,"distanceTo",{enumerable:!0,get:function(){return o(u).default}});var i=n(17);Object.defineProperty(t,"isDefined",{enumerable:!0,get:function(){return o(i).default}});var s=n(18);Object.defineProperty(t,"isNumber",{enumerable:!0,get:function(){return o(s).default}});var l=n(19);Object.defineProperty(t,"isObject",{enumerable:!0,get:function(){return o(l).default}});var p=n(20);Object.defineProperty(t,"length",{enumerable:!0,get:function(){return o(p).default}})},function(t,n){t.exports=e},function(e,t,n){"use strict";function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length?r.apply(void 0,t):a.apply(void 0,t)}function r(e){var t=void 0;return"undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?t=Reflect.ownKeys(e.prototype):(t=Object.getOwnPropertyNames(e.prototype),"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e.prototype)))),t.forEach(function(t){if("constructor"!==t){var n=Object.getOwnPropertyDescriptor(e.prototype,t);"function"==typeof n.value&&Object.defineProperty(e.prototype,t,a(e,t,n))}}),e}function a(e,t,n){var o=n.value;if("function"!=typeof o)throw new Error("@autobind decorator can only be applied to methods not: "+typeof o);var r=!1;return{configurable:!0,get:function(){if(r||this===e.prototype||this.hasOwnProperty(t))return o;var n=o.bind(this);return r=!0,Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),r=!1,n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){var t=e.formatLabel?e.formatLabel(e.children,e.type):e.children;return a.default.createElement("span",{className:e.classNames[e.type+"Label"]},a.default.createElement("span",{className:e.classNames.labelContainer},t))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(r);o.propTypes={children:a.default.PropTypes.node.isRequired,classNames:a.default.PropTypes.objectOf(a.default.PropTypes.string).isRequired,formatLabel:a.default.PropTypes.func,type:a.default.PropTypes.string.isRequired},e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);Object.defineProperty(t,"InputRange",{enumerable:!0,get:function(){return o(r).default}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(4);t.default=o.InputRange,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={activeTrack:"input-range__track input-range__track--active",disabledInputRange:"input-range input-range--disabled",inputRange:"input-range",labelContainer:"input-range__label-container",maxLabel:"input-range__label input-range__label--max",minLabel:"input-range__label input-range__label--min",slider:"input-range__slider",sliderContainer:"input-range__slider-container",track:"input-range__track input-range__track--background",valueLabel:"input-range__label input-range__label--value"};t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 i(e,t,n,o,r){var a={};return Object.keys(o).forEach(function(e){a[e]=o[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s,l=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}}(),p=n(1),c=o(p),d=n(2),f=o(d),h=n(13),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(h),y=n(6),v=o(y),b=n(3),g=o(b),P=n(9),O=o(P),D=n(12),w=o(D),M=n(10),T=o(M),_=n(11),V=o(_),j=n(0),k=n(8),x=(s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.startValue=null,n.node=null,n.trackNode=null,n}return u(t,e),l(t,null,[{key:"propTypes",get:function(){return{ariaLabelledby:c.default.PropTypes.string,ariaControls:c.default.PropTypes.string,classNames:c.default.PropTypes.objectOf(c.default.PropTypes.string),disabled:c.default.PropTypes.bool,formatLabel:c.default.PropTypes.func,maxValue:O.default,minValue:O.default,name:c.default.PropTypes.string,onChangeStart:c.default.PropTypes.func,onChange:c.default.PropTypes.func.isRequired,onChangeComplete:c.default.PropTypes.func,step:c.default.PropTypes.number,value:w.default}}},{key:"defaultProps",get:function(){return{classNames:v.default,disabled:!1,maxValue:10,minValue:0,step:1}}}]),l(t,[{key:"componentWillUnmount",value:function(){this.removeDocumentMouseUpListener(),this.removeDocumentTouchEndListener()}},{key:"getComponentClassName",value:function(){return this.props.disabled?this.props.classNames.disabledInputRange:this.props.classNames.inputRange}},{key:"getTrackClientRect",value:function(){return this.trackNode.getClientRect()}},{key:"getKeyByPosition",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue()),n=m.getPositionsFromValues(t,this.props.minValue,this.props.maxValue,this.getTrackClientRect());if(this.isMultiValue()){if((0,j.distanceTo)(e,n.min)<(0,j.distanceTo)(e,n.max))return"min"}return"max"}},{key:"getKeys",value:function(){return this.isMultiValue()?["min","max"]:["max"]}},{key:"hasStepDifference",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue());return(0,j.length)(e.min,t.min)>=this.props.step||(0,j.length)(e.max,t.max)>=this.props.step}},{key:"isMultiValue",value:function(){return(0,j.isObject)(this.props.value)}},{key:"isWithinRange",value:function(e){return this.isMultiValue()?e.min>=this.props.minValue&&e.max<=this.props.maxValue&&e.min<e.max:e.max>=this.props.minValue&&e.max<=this.props.maxValue}},{key:"shouldUpdate",value:function(e){return this.isWithinRange(e)&&this.hasStepDifference(e)}},{key:"updatePosition",value:function(e,t){var n=m.getValueFromProps(this.props,this.isMultiValue()),o=m.getPositionsFromValues(n,this.props.minValue,this.props.maxValue,this.getTrackClientRect());o[e]=t,this.updatePositions(o)}},{key:"updatePositions",value:function(e){var t={min:m.getValueFromPosition(e.min,this.props.minValue,this.props.maxValue,this.getTrackClientRect()),max:m.getValueFromPosition(e.max,this.props.minValue,this.props.maxValue,this.getTrackClientRect())},n={min:m.getStepValueFromValue(t.min,this.props.step),max:m.getStepValueFromValue(t.max,this.props.step)};this.updateValues(n)}},{key:"updateValue",value:function(e,t){var n=m.getValueFromProps(this.props,this.isMultiValue());n[e]=t,this.updateValues(n)}},{key:"updateValues",value:function(e){this.shouldUpdate(e)&&this.props.onChange(this.isMultiValue()?e:e.max)}},{key:"incrementValue",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue()),n=t[e]+this.props.step;this.updateValue(e,n)}},{key:"decrementValue",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue()),n=t[e]-this.props.step;this.updateValue(e,n)}},{key:"addDocumentMouseUpListener",value:function(){this.removeDocumentMouseUpListener(),this.node.ownerDocument.addEventListener("mouseup",this.handleMouseUp)}},{key:"addDocumentTouchEndListener",value:function(){this.removeDocumentTouchEndListener(),this.node.ownerDocument.addEventListener("touchend",this.handleTouchEnd)}},{key:"removeDocumentMouseUpListener",value:function(){this.node.ownerDocument.removeEventListener("mouseup",this.handleMouseUp)}},{key:"removeDocumentTouchEndListener",value:function(){this.node.ownerDocument.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleSliderDrag",value:function(e,t){var n=this;if(!this.props.disabled){var o=m.getPositionFromEvent(e,this.getTrackClientRect());requestAnimationFrame(function(){return n.updatePosition(t,o)})}}},{key:"handleSliderKeyDown",value:function(e,t){if(!this.props.disabled)switch(e.keyCode){case k.LEFT_ARROW:case k.DOWN_ARROW:e.preventDefault(),this.decrementValue(t);break;case k.RIGHT_ARROW:case k.UP_ARROW:e.preventDefault(),this.incrementValue(t)}}},{key:"handleTrackMouseDown",value:function(e,t){this.props.disabled||(e.preventDefault(),this.updatePosition(this.getKeyByPosition(t),t))}},{key:"handleInteractionStart",value:function(){this.props.onChangeStart&&this.props.onChangeStart(this.props.value),this.props.onChangeComplete&&!(0,j.isDefined)(this.startValue)&&(this.startValue=this.props.value)}},{key:"handleInteractionEnd",value:function(){this.props.onChangeComplete&&(0,j.isDefined)(this.startValue)&&(this.startValue!==this.props.value&&this.props.onChangeComplete(this.props.value),this.startValue=null)}},{key:"handleKeyDown",value:function(e){this.handleInteractionStart(e)}},{key:"handleKeyUp",value:function(e){this.handleInteractionEnd(e)}},{key:"handleMouseDown",value:function(e){this.handleInteractionStart(e),this.addDocumentMouseUpListener()}},{key:"handleMouseUp",value:function(e){this.handleInteractionEnd(e),this.removeDocumentMouseUpListener()}},{key:"handleTouchStart",value:function(e){this.handleInteractionStart(e),this.addDocumentTouchEndListener()}},{key:"handleTouchEnd",value:function(e){this.handleInteractionEnd(e),this.removeDocumentTouchEndListener()}},{key:"renderSliders",value:function(){var e=this,t=m.getValueFromProps(this.props,this.isMultiValue()),n=m.getPercentagesFromValues(t,this.props.minValue,this.props.maxValue);return this.getKeys().map(function(o){var r=t[o],a=n[o],u=e.props,i=u.maxValue,s=u.minValue;return"min"===o?i=t.max:s=t.min,c.default.createElement(T.default,{ariaLabelledby:e.props.ariaLabelledby,ariaControls:e.props.ariaControls,classNames:e.props.classNames,formatLabel:e.props.formatLabel,key:o,maxValue:i,minValue:s,onSliderDrag:e.handleSliderDrag,onSliderKeyDown:e.handleSliderKeyDown,percentage:a,type:o,value:r})})}},{key:"renderHiddenInputs",value:function(){var e=this;if(!this.props.name)return[];var t=this.isMultiValue(),n=m.getValueFromProps(this.props,t);return this.getKeys().map(function(o){var r=n[o],a=t?""+e.props.name+(0,j.captialize)(o):e.props.name;return c.default.createElement("input",{key:o,type:"hidden",name:a,value:r})})}},{key:"render",value:function(){var e=this,t=this.getComponentClassName(),n=m.getValueFromProps(this.props,this.isMultiValue()),o=m.getPercentagesFromValues(n,this.props.minValue,this.props.maxValue);return c.default.createElement("div",{"aria-disabled":this.props.disabled,ref:function(t){e.node=t},className:t,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart},c.default.createElement(g.default,{classNames:this.props.classNames,formatLabel:this.props.formatLabel,type:"min"},this.props.minValue),c.default.createElement(V.default,{classNames:this.props.classNames,ref:function(t){e.trackNode=t},percentages:o,onTrackMouseDown:this.handleTrackMouseDown},this.renderSliders()),c.default.createElement(g.default,{classNames:this.props.classNames,formatLabel:this.props.formatLabel,type:"max"},this.props.maxValue),this.renderHiddenInputs())}}]),t}(c.default.Component),i(s.prototype,"handleSliderDrag",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleSliderDrag"),s.prototype),i(s.prototype,"handleSliderKeyDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleSliderKeyDown"),s.prototype),i(s.prototype,"handleTrackMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTrackMouseDown"),s.prototype),i(s.prototype,"handleInteractionStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleInteractionStart"),s.prototype),i(s.prototype,"handleInteractionEnd",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleInteractionEnd"),s.prototype),i(s.prototype,"handleKeyDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleKeyDown"),s.prototype),i(s.prototype,"handleKeyUp",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleKeyUp"),s.prototype),i(s.prototype,"handleMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseDown"),s.prototype),i(s.prototype,"handleMouseUp",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseUp"),s.prototype),i(s.prototype,"handleTouchStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchStart"),s.prototype),i(s.prototype,"handleTouchEnd",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchEnd"),s.prototype),s);t.default=x,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DOWN_ARROW=40,t.LEFT_ARROW=37,t.RIGHT_ARROW=39,t.UP_ARROW=38},function(e,t,n){"use strict";function o(e){var t=e.maxValue,n=e.minValue;return(0,r.isNumber)(n)&&(0,r.isNumber)(t)?n>=t?new Error('"minValue" must be smaller than "maxValue"'):void 0:new Error('"minValue" and "maxValue" must be a number')}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=n(0);e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 i(e,t,n,o,r){var a={};return Object.keys(o).forEach(function(e){a[e]=o[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s,l=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}}(),p=n(1),c=o(p),d=n(2),f=o(d),h=n(3),m=o(h),y=(s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.node=null,n}return u(t,e),l(t,null,[{key:"propTypes",get:function(){return{ariaLabelledby:c.default.PropTypes.string,ariaControls:c.default.PropTypes.string,classNames:c.default.PropTypes.objectOf(c.default.PropTypes.string).isRequired,formatLabel:c.default.PropTypes.func,maxValue:c.default.PropTypes.number,minValue:c.default.PropTypes.number,onSliderDrag:c.default.PropTypes.func.isRequired,onSliderKeyDown:c.default.PropTypes.func.isRequired,percentage:c.default.PropTypes.number.isRequired,type:c.default.PropTypes.string.isRequired,value:c.default.PropTypes.number.isRequired}}}]),l(t,[{key:"componentWillUnmount",value:function(){this.removeDocumentMouseMoveListener(),this.removeDocumentMouseUpListener(),this.removeDocumentTouchEndListener(),this.removeDocumentTouchMoveListener()}},{key:"getStyle",value:function(){return{position:"absolute",left:100*(this.props.percentage||0)+"%"}}},{key:"addDocumentMouseMoveListener",value:function(){this.removeDocumentMouseMoveListener(),this.node.ownerDocument.addEventListener("mousemove",this.handleMouseMove)}},{key:"addDocumentMouseUpListener",value:function(){this.removeDocumentMouseUpListener(),this.node.ownerDocument.addEventListener("mouseup",this.handleMouseUp)}},{key:"addDocumentTouchMoveListener",value:function(){this.removeDocumentTouchMoveListener(),this.node.ownerDocument.addEventListener("touchmove",this.handleTouchMove)}},{key:"addDocumentTouchEndListener",value:function(){this.removeDocumentTouchEndListener(),this.node.ownerDocument.addEventListener("touchend",this.handleTouchEnd)}},{key:"removeDocumentMouseMoveListener",value:function(){this.node.ownerDocument.removeEventListener("mousemove",this.handleMouseMove)}},{key:"removeDocumentMouseUpListener",value:function(){this.node.ownerDocument.removeEventListener("mouseup",this.handleMouseUp)}},{key:"removeDocumentTouchMoveListener",value:function(){this.node.ownerDocument.removeEventListener("touchmove",this.handleTouchMove)}},{key:"removeDocumentTouchEndListener",value:function(){this.node.ownerDocument.removeEventListener("touchend",this.handleTouchUp)}},{key:"handleMouseDown",value:function(){this.addDocumentMouseMoveListener(),this.addDocumentMouseUpListener()}},{key:"handleMouseUp",value:function(){this.removeDocumentMouseMoveListener(),this.removeDocumentMouseUpListener()}},{key:"handleMouseMove",value:function(e){this.props.onSliderDrag(e,this.props.type)}},{key:"handleTouchStart",value:function(){this.addDocumentTouchEndListener(),this.addDocumentTouchMoveListener()}},{key:"handleTouchMove",value:function(e){this.props.onSliderDrag(e,this.props.type)}},{key:"handleTouchEnd",value:function(){this.removeDocumentTouchMoveListener(),this.removeDocumentTouchEndListener()}},{key:"handleKeyDown",value:function(e){this.props.onSliderKeyDown(e,this.props.type)}},{key:"render",value:function(){var e=this,t=this.getStyle();return c.default.createElement("span",{className:this.props.classNames.sliderContainer,ref:function(t){e.node=t},style:t},c.default.createElement(m.default,{classNames:this.props.classNames,formatLabel:this.props.formatLabel,type:"value"},this.props.value),c.default.createElement("div",{"aria-labelledby":this.props.ariaLabelledby,"aria-controls":this.props.ariaControls,"aria-valuemax":this.props.maxValue,"aria-valuemin":this.props.minValue,"aria-valuenow":this.props.value,className:this.props.classNames.slider,draggable:"false",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,role:"slider",tabIndex:"0"}))}}]),t}(c.default.Component),i(s.prototype,"handleMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseDown"),s.prototype),i(s.prototype,"handleMouseUp",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseUp"),s.prototype),i(s.prototype,"handleMouseMove",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseMove"),s.prototype),i(s.prototype,"handleTouchStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchStart"),s.prototype),i(s.prototype,"handleTouchMove",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchMove"),s.prototype),i(s.prototype,"handleTouchEnd",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchEnd"),s.prototype),i(s.prototype,"handleKeyDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleKeyDown"),s.prototype),s);t.default=y,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 i(e,t,n,o,r){var a={};return Object.keys(o).forEach(function(e){a[e]=o[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s,l=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}}(),p=n(1),c=o(p),d=n(2),f=o(d),h=(s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.node=null,n}return u(t,e),l(t,null,[{key:"propTypes",get:function(){return{children:c.default.PropTypes.node.isRequired,classNames:c.default.PropTypes.objectOf(c.default.PropTypes.string).isRequired,onTrackMouseDown:c.default.PropTypes.func.isRequired,percentages:c.default.PropTypes.objectOf(c.default.PropTypes.number).isRequired}}}]),l(t,[{key:"getClientRect",value:function(){return this.node.getBoundingClientRect()}},{key:"getActiveTrackStyle",value:function(){var e=100*(this.props.percentages.max-this.props.percentages.min)+"%";return{left:100*this.props.percentages.min+"%",width:e}}},{key:"handleMouseDown",value:function(e){var t=e.touches?e.touches[0].clientX:e.clientX,n=this.getClientRect(),o={x:t-n.left,y:0};this.props.onTrackMouseDown(e,o)}},{key:"handleTouchStart",value:function(e){e.preventDefault(),this.handleMouseDown(e)}},{key:"render",value:function(){var e=this,t=this.getActiveTrackStyle();return c.default.createElement("div",{className:this.props.classNames.track,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,ref:function(t){e.node=t}},c.default.createElement("div",{style:t,className:this.props.classNames.activeTrack}),this.props.children)}}]),t}(c.default.Component),i(s.prototype,"handleMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseDown"),s.prototype),i(s.prototype,"handleTouchStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchStart"),s.prototype),s);t.default=h,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){var n=e.maxValue,o=e.minValue,a=e[t];return(0,r.isNumber)(a)||(0,r.isObject)(a)&&(0,r.isNumber)(a.min)&&(0,r.isNumber)(a.max)?(0,r.isNumber)(a)&&(a<o||a>n)?new Error('"'+t+'" must be in between "minValue" and "maxValue"'):(0,r.isObject)(a)&&(a.min<o||a.min>n||a.max<o||a.max>n)?new Error('"'+t+'" must be in between "minValue" and "maxValue"'):void 0:new Error('"'+t+'" must be a number or a range object')}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=n(0);e.exports=t.default},function(e,t,n){"use strict";function o(e,t){var n=t.width;return e.x/n||0}function r(e,t,n,r){return t+(n-t)*o(e,r)}function a(e,t){return t?d({},e.value):{min:e.minValue,max:e.value}}function u(e,t,n){return((0,f.clamp)(e,t,n)-t)/(n-t)||0}function i(e,t,n){return{min:u(e.min,t,n),max:u(e.max,t,n)}}function s(e,t,n,o){var r=o.width;return{x:u(e,t,n)*r,y:0}}function l(e,t,n,o){return{min:s(e.min,t,n,o),max:s(e.max,t,n,o)}}function p(e,t){var n=t.width,o=e.touches?e.touches[0]:e,r=o.clientX;return{x:(0,f.clamp)(r-t.left,0,n),y:0}}function c(e,t){return Math.round(e/t)*t}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};t.getPercentageFromPosition=o,t.getValueFromPosition=r,t.getValueFromProps=a,t.getPercentageFromValue=u,t.getPercentagesFromValues=i,t.getPositionFromValue=s,t.getPositionsFromValues=l,t.getPositionFromEvent=p,t.getStepValueFromValue=c;var f=n(0)},function(e,t,n){"use strict";function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e,t,n){return Math.min(Math.max(e,t),n)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){var n=Math.pow(t.x-e.x,2),o=Math.pow(t.y-e.y,2);return Math.sqrt(n+o)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return void 0!==e&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return"number"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return null!==e&&"object"===(void 0===e?"undefined":r(e))}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){return Math.abs(e-t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default}])});
!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.InputRange=t(require("react")):e.InputRange=t(e.React)}(this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(14);Object.defineProperty(t,"captialize",{enumerable:!0,get:function(){return o(r).default}});var a=n(15);Object.defineProperty(t,"clamp",{enumerable:!0,get:function(){return o(a).default}});var u=n(16);Object.defineProperty(t,"distanceTo",{enumerable:!0,get:function(){return o(u).default}});var i=n(17);Object.defineProperty(t,"isDefined",{enumerable:!0,get:function(){return o(i).default}});var s=n(18);Object.defineProperty(t,"isNumber",{enumerable:!0,get:function(){return o(s).default}});var l=n(19);Object.defineProperty(t,"isObject",{enumerable:!0,get:function(){return o(l).default}});var p=n(20);Object.defineProperty(t,"length",{enumerable:!0,get:function(){return o(p).default}})},function(t,n){t.exports=e},function(e,t,n){"use strict";function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length?r.apply(void 0,t):a.apply(void 0,t)}function r(e){var t=void 0;return"undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?t=Reflect.ownKeys(e.prototype):(t=Object.getOwnPropertyNames(e.prototype),"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e.prototype)))),t.forEach(function(t){if("constructor"!==t){var n=Object.getOwnPropertyDescriptor(e.prototype,t);"function"==typeof n.value&&Object.defineProperty(e.prototype,t,a(e,t,n))}}),e}function a(e,t,n){var o=n.value;if("function"!=typeof o)throw new Error("@autobind decorator can only be applied to methods not: "+typeof o);var r=!1;return{configurable:!0,get:function(){if(r||this===e.prototype||this.hasOwnProperty(t))return o;var n=o.bind(this);return r=!0,Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),r=!1,n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){var t=e.formatLabel?e.formatLabel(e.children,e.type):e.children;return a.default.createElement("span",{className:e.classNames[e.type+"Label"]},a.default.createElement("span",{className:e.classNames.labelContainer},t))}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(r);o.propTypes={children:a.default.PropTypes.node.isRequired,classNames:a.default.PropTypes.objectOf(a.default.PropTypes.string).isRequired,formatLabel:a.default.PropTypes.func,type:a.default.PropTypes.string.isRequired},e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);Object.defineProperty(t,"InputRange",{enumerable:!0,get:function(){return o(r).default}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(4);t.default=o.InputRange,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={activeTrack:"input-range__track input-range__track--active",disabledInputRange:"input-range input-range--disabled",inputRange:"input-range",labelContainer:"input-range__label-container",maxLabel:"input-range__label input-range__label--max",minLabel:"input-range__label input-range__label--min",slider:"input-range__slider",sliderContainer:"input-range__slider-container",track:"input-range__track input-range__track--background",valueLabel:"input-range__label input-range__label--value"};t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 i(e,t,n,o,r){var a={};return Object.keys(o).forEach(function(e){a[e]=o[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s,l=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}}(),p=n(1),c=o(p),d=n(2),f=o(d),h=n(13),m=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(h),y=n(6),v=o(y),b=n(3),g=o(b),P=n(9),O=o(P),D=n(12),w=o(D),M=n(10),T=o(M),_=n(11),V=o(_),j=n(0),k=n(8),x=(s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.startValue=null,n.node=null,n.trackNode=null,n}return u(t,e),l(t,null,[{key:"propTypes",get:function(){return{ariaLabelledby:c.default.PropTypes.string,ariaControls:c.default.PropTypes.string,classNames:c.default.PropTypes.objectOf(c.default.PropTypes.string),disabled:c.default.PropTypes.bool,formatLabel:c.default.PropTypes.func,maxValue:O.default,minValue:O.default,name:c.default.PropTypes.string,onChangeStart:c.default.PropTypes.func,onChange:c.default.PropTypes.func.isRequired,onChangeComplete:c.default.PropTypes.func,step:c.default.PropTypes.number,value:w.default}}},{key:"defaultProps",get:function(){return{classNames:v.default,disabled:!1,maxValue:10,minValue:0,step:1}}}]),l(t,[{key:"componentWillUnmount",value:function(){this.removeDocumentMouseUpListener(),this.removeDocumentTouchEndListener()}},{key:"getComponentClassName",value:function(){return this.props.disabled?this.props.classNames.disabledInputRange:this.props.classNames.inputRange}},{key:"getTrackClientRect",value:function(){return this.trackNode.getClientRect()}},{key:"getKeyByPosition",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue()),n=m.getPositionsFromValues(t,this.props.minValue,this.props.maxValue,this.getTrackClientRect());if(this.isMultiValue()){if((0,j.distanceTo)(e,n.min)<(0,j.distanceTo)(e,n.max))return"min"}return"max"}},{key:"getKeys",value:function(){return this.isMultiValue()?["min","max"]:["max"]}},{key:"hasStepDifference",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue());return(0,j.length)(e.min,t.min)>=this.props.step||(0,j.length)(e.max,t.max)>=this.props.step}},{key:"isMultiValue",value:function(){return(0,j.isObject)(this.props.value)}},{key:"isWithinRange",value:function(e){return this.isMultiValue()?e.min>=this.props.minValue&&e.max<=this.props.maxValue&&e.min<e.max:e.max>=this.props.minValue&&e.max<=this.props.maxValue}},{key:"shouldUpdate",value:function(e){return this.isWithinRange(e)&&this.hasStepDifference(e)}},{key:"updatePosition",value:function(e,t){var n=m.getValueFromProps(this.props,this.isMultiValue()),o=m.getPositionsFromValues(n,this.props.minValue,this.props.maxValue,this.getTrackClientRect());o[e]=t,this.updatePositions(o)}},{key:"updatePositions",value:function(e){var t={min:m.getValueFromPosition(e.min,this.props.minValue,this.props.maxValue,this.getTrackClientRect()),max:m.getValueFromPosition(e.max,this.props.minValue,this.props.maxValue,this.getTrackClientRect())},n={min:m.getStepValueFromValue(t.min,this.props.step),max:m.getStepValueFromValue(t.max,this.props.step)};this.updateValues(n)}},{key:"updateValue",value:function(e,t){var n=m.getValueFromProps(this.props,this.isMultiValue());n[e]=t,this.updateValues(n)}},{key:"updateValues",value:function(e){this.shouldUpdate(e)&&this.props.onChange(this.isMultiValue()?e:e.max)}},{key:"incrementValue",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue()),n=t[e]+this.props.step;this.updateValue(e,n)}},{key:"decrementValue",value:function(e){var t=m.getValueFromProps(this.props,this.isMultiValue()),n=t[e]-this.props.step;this.updateValue(e,n)}},{key:"addDocumentMouseUpListener",value:function(){this.removeDocumentMouseUpListener(),this.node.ownerDocument.addEventListener("mouseup",this.handleMouseUp)}},{key:"addDocumentTouchEndListener",value:function(){this.removeDocumentTouchEndListener(),this.node.ownerDocument.addEventListener("touchend",this.handleTouchEnd)}},{key:"removeDocumentMouseUpListener",value:function(){this.node.ownerDocument.removeEventListener("mouseup",this.handleMouseUp)}},{key:"removeDocumentTouchEndListener",value:function(){this.node.ownerDocument.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleSliderDrag",value:function(e,t){var n=this;if(!this.props.disabled){var o=m.getPositionFromEvent(e,this.getTrackClientRect());requestAnimationFrame(function(){return n.updatePosition(t,o)})}}},{key:"handleSliderKeyDown",value:function(e,t){if(!this.props.disabled)switch(e.keyCode){case k.LEFT_ARROW:case k.DOWN_ARROW:e.preventDefault(),this.decrementValue(t);break;case k.RIGHT_ARROW:case k.UP_ARROW:e.preventDefault(),this.incrementValue(t)}}},{key:"handleTrackMouseDown",value:function(e,t){this.props.disabled||(e.preventDefault(),this.updatePosition(this.getKeyByPosition(t),t))}},{key:"handleInteractionStart",value:function(){this.props.onChangeStart&&this.props.onChangeStart(this.props.value),this.props.onChangeComplete&&!(0,j.isDefined)(this.startValue)&&(this.startValue=this.props.value)}},{key:"handleInteractionEnd",value:function(){this.props.onChangeComplete&&(0,j.isDefined)(this.startValue)&&(this.startValue!==this.props.value&&this.props.onChangeComplete(this.props.value),this.startValue=null)}},{key:"handleKeyDown",value:function(e){this.handleInteractionStart(e)}},{key:"handleKeyUp",value:function(e){this.handleInteractionEnd(e)}},{key:"handleMouseDown",value:function(e){this.handleInteractionStart(e),this.addDocumentMouseUpListener()}},{key:"handleMouseUp",value:function(e){this.handleInteractionEnd(e),this.removeDocumentMouseUpListener()}},{key:"handleTouchStart",value:function(e){this.handleInteractionStart(e),this.addDocumentTouchEndListener()}},{key:"handleTouchEnd",value:function(e){this.handleInteractionEnd(e),this.removeDocumentTouchEndListener()}},{key:"renderSliders",value:function(){var e=this,t=m.getValueFromProps(this.props,this.isMultiValue()),n=m.getPercentagesFromValues(t,this.props.minValue,this.props.maxValue);return this.getKeys().map(function(o){var r=t[o],a=n[o],u=e.props,i=u.maxValue,s=u.minValue;return"min"===o?i=t.max:s=t.min,c.default.createElement(T.default,{ariaLabelledby:e.props.ariaLabelledby,ariaControls:e.props.ariaControls,classNames:e.props.classNames,formatLabel:e.props.formatLabel,key:o,maxValue:i,minValue:s,onSliderDrag:e.handleSliderDrag,onSliderKeyDown:e.handleSliderKeyDown,percentage:a,type:o,value:r})})}},{key:"renderHiddenInputs",value:function(){var e=this;if(!this.props.name)return[];var t=this.isMultiValue(),n=m.getValueFromProps(this.props,t);return this.getKeys().map(function(o){var r=n[o],a=t?""+e.props.name+(0,j.captialize)(o):e.props.name;return c.default.createElement("input",{key:o,type:"hidden",name:a,value:r})})}},{key:"render",value:function(){var e=this,t=this.getComponentClassName(),n=m.getValueFromProps(this.props,this.isMultiValue()),o=m.getPercentagesFromValues(n,this.props.minValue,this.props.maxValue);return c.default.createElement("div",{"aria-disabled":this.props.disabled,ref:function(t){e.node=t},className:t,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart},c.default.createElement(g.default,{classNames:this.props.classNames,formatLabel:this.props.formatLabel,type:"min"},this.props.minValue),c.default.createElement(V.default,{classNames:this.props.classNames,ref:function(t){e.trackNode=t},percentages:o,onTrackMouseDown:this.handleTrackMouseDown},this.renderSliders()),c.default.createElement(g.default,{classNames:this.props.classNames,formatLabel:this.props.formatLabel,type:"max"},this.props.maxValue),this.renderHiddenInputs())}}]),t}(c.default.Component),i(s.prototype,"handleSliderDrag",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleSliderDrag"),s.prototype),i(s.prototype,"handleSliderKeyDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleSliderKeyDown"),s.prototype),i(s.prototype,"handleTrackMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTrackMouseDown"),s.prototype),i(s.prototype,"handleInteractionStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleInteractionStart"),s.prototype),i(s.prototype,"handleInteractionEnd",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleInteractionEnd"),s.prototype),i(s.prototype,"handleKeyDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleKeyDown"),s.prototype),i(s.prototype,"handleKeyUp",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleKeyUp"),s.prototype),i(s.prototype,"handleMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseDown"),s.prototype),i(s.prototype,"handleMouseUp",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseUp"),s.prototype),i(s.prototype,"handleTouchStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchStart"),s.prototype),i(s.prototype,"handleTouchEnd",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchEnd"),s.prototype),s);t.default=x,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DOWN_ARROW=40,t.LEFT_ARROW=37,t.RIGHT_ARROW=39,t.UP_ARROW=38},function(e,t,n){"use strict";function o(e){var t=e.maxValue,n=e.minValue;return(0,r.isNumber)(n)&&(0,r.isNumber)(t)?n>=t?new Error('"minValue" must be smaller than "maxValue"'):void 0:new Error('"minValue" and "maxValue" must be a number')}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=n(0);e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 i(e,t,n,o,r){var a={};return Object.keys(o).forEach(function(e){a[e]=o[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s,l=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}}(),p=n(1),c=o(p),d=n(2),f=o(d),h=n(3),m=o(h),y=(s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.node=null,n}return u(t,e),l(t,null,[{key:"propTypes",get:function(){return{ariaLabelledby:c.default.PropTypes.string,ariaControls:c.default.PropTypes.string,classNames:c.default.PropTypes.objectOf(c.default.PropTypes.string).isRequired,formatLabel:c.default.PropTypes.func,maxValue:c.default.PropTypes.number,minValue:c.default.PropTypes.number,onSliderDrag:c.default.PropTypes.func.isRequired,onSliderKeyDown:c.default.PropTypes.func.isRequired,percentage:c.default.PropTypes.number.isRequired,type:c.default.PropTypes.string.isRequired,value:c.default.PropTypes.number.isRequired}}}]),l(t,[{key:"componentWillUnmount",value:function(){this.removeDocumentMouseMoveListener(),this.removeDocumentMouseUpListener(),this.removeDocumentTouchEndListener(),this.removeDocumentTouchMoveListener()}},{key:"getStyle",value:function(){return{position:"absolute",left:100*(this.props.percentage||0)+"%"}}},{key:"addDocumentMouseMoveListener",value:function(){this.removeDocumentMouseMoveListener(),this.node.ownerDocument.addEventListener("mousemove",this.handleMouseMove)}},{key:"addDocumentMouseUpListener",value:function(){this.removeDocumentMouseUpListener(),this.node.ownerDocument.addEventListener("mouseup",this.handleMouseUp)}},{key:"addDocumentTouchMoveListener",value:function(){this.removeDocumentTouchMoveListener(),this.node.ownerDocument.addEventListener("touchmove",this.handleTouchMove)}},{key:"addDocumentTouchEndListener",value:function(){this.removeDocumentTouchEndListener(),this.node.ownerDocument.addEventListener("touchend",this.handleTouchEnd)}},{key:"removeDocumentMouseMoveListener",value:function(){this.node.ownerDocument.removeEventListener("mousemove",this.handleMouseMove)}},{key:"removeDocumentMouseUpListener",value:function(){this.node.ownerDocument.removeEventListener("mouseup",this.handleMouseUp)}},{key:"removeDocumentTouchMoveListener",value:function(){this.node.ownerDocument.removeEventListener("touchmove",this.handleTouchMove)}},{key:"removeDocumentTouchEndListener",value:function(){this.node.ownerDocument.removeEventListener("touchend",this.handleTouchUp)}},{key:"handleMouseDown",value:function(){this.addDocumentMouseMoveListener(),this.addDocumentMouseUpListener()}},{key:"handleMouseUp",value:function(){this.removeDocumentMouseMoveListener(),this.removeDocumentMouseUpListener()}},{key:"handleMouseMove",value:function(e){this.props.onSliderDrag(e,this.props.type)}},{key:"handleTouchStart",value:function(){this.addDocumentTouchEndListener(),this.addDocumentTouchMoveListener()}},{key:"handleTouchMove",value:function(e){this.props.onSliderDrag(e,this.props.type)}},{key:"handleTouchEnd",value:function(){this.removeDocumentTouchMoveListener(),this.removeDocumentTouchEndListener()}},{key:"handleKeyDown",value:function(e){this.props.onSliderKeyDown(e,this.props.type)}},{key:"render",value:function(){var e=this,t=this.getStyle();return c.default.createElement("span",{className:this.props.classNames.sliderContainer,ref:function(t){e.node=t},style:t},c.default.createElement(m.default,{classNames:this.props.classNames,formatLabel:this.props.formatLabel,type:"value"},this.props.value),c.default.createElement("div",{"aria-labelledby":this.props.ariaLabelledby,"aria-controls":this.props.ariaControls,"aria-valuemax":this.props.maxValue,"aria-valuemin":this.props.minValue,"aria-valuenow":this.props.value,className:this.props.classNames.slider,draggable:"false",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,role:"slider",tabIndex:"0"}))}}]),t}(c.default.Component),i(s.prototype,"handleMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseDown"),s.prototype),i(s.prototype,"handleMouseUp",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseUp"),s.prototype),i(s.prototype,"handleMouseMove",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseMove"),s.prototype),i(s.prototype,"handleTouchStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchStart"),s.prototype),i(s.prototype,"handleTouchMove",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchMove"),s.prototype),i(s.prototype,"handleTouchEnd",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchEnd"),s.prototype),i(s.prototype,"handleKeyDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleKeyDown"),s.prototype),s);t.default=y,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(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 i(e,t,n,o,r){var a={};return Object.keys(o).forEach(function(e){a[e]=o[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,o){return o(e,t,n)||n},a),r&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(r):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s,l=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}}(),p=n(1),c=o(p),d=n(2),f=o(d),h=(s=function(e){function t(e){r(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.node=null,n}return u(t,e),l(t,null,[{key:"propTypes",get:function(){return{children:c.default.PropTypes.node.isRequired,classNames:c.default.PropTypes.objectOf(c.default.PropTypes.string).isRequired,onTrackMouseDown:c.default.PropTypes.func.isRequired,percentages:c.default.PropTypes.objectOf(c.default.PropTypes.number).isRequired}}}]),l(t,[{key:"getClientRect",value:function(){return this.node.getBoundingClientRect()}},{key:"getActiveTrackStyle",value:function(){var e=100*(this.props.percentages.max-this.props.percentages.min)+"%";return{left:100*this.props.percentages.min+"%",width:e}}},{key:"handleMouseDown",value:function(e){var t=e.touches?e.touches[0].clientX:e.clientX,n=this.getClientRect(),o={x:t-n.left,y:0};this.props.onTrackMouseDown(e,o)}},{key:"handleTouchStart",value:function(e){e.preventDefault(),this.handleMouseDown(e)}},{key:"render",value:function(){var e=this,t=this.getActiveTrackStyle();return c.default.createElement("div",{className:this.props.classNames.track,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,ref:function(t){e.node=t}},c.default.createElement("div",{style:t,className:this.props.classNames.activeTrack}),this.props.children)}}]),t}(c.default.Component),i(s.prototype,"handleMouseDown",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleMouseDown"),s.prototype),i(s.prototype,"handleTouchStart",[f.default],Object.getOwnPropertyDescriptor(s.prototype,"handleTouchStart"),s.prototype),s);t.default=h,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){var n=e.maxValue,o=e.minValue,a=e[t];return(0,r.isNumber)(a)||(0,r.isObject)(a)&&(0,r.isNumber)(a.min)&&(0,r.isNumber)(a.max)?(0,r.isNumber)(a)&&(a<o||a>n)?new Error('"'+t+'" must be in between "minValue" and "maxValue"'):(0,r.isObject)(a)&&(a.min<o||a.min>n||a.max<o||a.max>n)?new Error('"'+t+'" must be in between "minValue" and "maxValue"'):void 0:new Error('"'+t+'" must be a number or a range object')}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=n(0);e.exports=t.default},function(e,t,n){"use strict";function o(e,t){var n=t.width;return e.x/n||0}function r(e,t,n,r){return t+(n-t)*o(e,r)}function a(e,t){return t?d({},e.value):{min:e.minValue,max:e.value}}function u(e,t,n){return((0,f.clamp)(e,t,n)-t)/(n-t)||0}function i(e,t,n){return{min:u(e.min,t,n),max:u(e.max,t,n)}}function s(e,t,n,o){var r=o.width;return{x:u(e,t,n)*r,y:0}}function l(e,t,n,o){return{min:s(e.min,t,n,o),max:s(e.max,t,n,o)}}function p(e,t){var n=t.width,o=e.touches?e.touches[0]:e,r=o.clientX;return{x:(0,f.clamp)(r-t.left,0,n),y:0}}function c(e,t){return Math.round(e/t)*t}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};t.getPercentageFromPosition=o,t.getValueFromPosition=r,t.getValueFromProps=a,t.getPercentageFromValue=u,t.getPercentagesFromValues=i,t.getPositionFromValue=s,t.getPositionsFromValues=l,t.getPositionFromEvent=p,t.getStepValueFromValue=c;var f=n(0)},function(e,t,n){"use strict";function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e,t,n){return Math.min(Math.max(e,t),n)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){var n=Math.pow(t.x-e.x,2),o=Math.pow(t.y-e.y,2);return Math.sqrt(n+o)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return void 0!==e&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return"number"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e){return null!==e&&"object"===(void 0===e?"undefined":r(e))}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=o,e.exports=t.default},function(e,t,n){"use strict";function o(e,t){return Math.abs(e-t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,e.exports=t.default}])});
//# sourceMappingURL=react-input-range.min.js.map
{
"name": "react-input-range",
"version": "1.1.1",
"version": "1.1.2",
"description": "React component for inputting numeric values within a range",

@@ -5,0 +5,0 @@ "keywords": [

@@ -47,5 +47,18 @@ import ExtractTextPlugin from 'extract-text-webpack-plugin';

},
externals: ['react', 'react-dom'],
externals: {
react: {
amd: 'react',
commonjs: 'react',
commonjs2: 'react',
root: 'React',
},
'react-dom': {
amd: 'react-dom',
commonjs: 'react-dom',
commonjs2: 'react-dom',
root: 'ReactDOM',
},
},
};
export default webpackConfig;

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc