react-input-range
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -709,3 +709,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.InputRange = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
key: 'handleTouchEnd', | ||
value: function handleTouchEnd() { | ||
value: function handleTouchEnd(event) { | ||
var document = getDocument(this); | ||
@@ -712,0 +712,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.InputRange=e()}}(function(){return function e(t,n,a){function r(u,i){if(!n[u]){if(!t[u]){var l="function"==typeof require&&require;if(!i&&l)return l(u,!0);if(o)return o(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return r(n?n:e)},f,f.exports,e,t,n,a)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<a.length;u++)r(a[u]);return r}({1:[function(e,t,n){(function(a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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){var n=e.props;return e.isMultiValue?t.min>=n.minValue&&t.max<=n.maxValue&&t.min<t.max:t.max>=n.minValue&&t.max<=n.maxValue}function l(e,t){var n=e.props,a=j["default"].valuesFromProps(e);return(0,_.length)(t.min,a.min)>=n.step||(0,_.length)(t.max,a.max)>=n.step}function s(e,t){return i(e,t)&&l(e,t)}function f(e){var t=e.refs.inputRange.ownerDocument;return t}function p(e){var t=e.props;return t.disabled?t.classNames.component+" is-disabled":t.classNames.component}function c(e,t){return t===e.refs.sliderMin?"min":"max"}function d(e){return e.isMultiValue?["min","max"]:["max"]}function h(e,t){var n=j["default"].valuesFromProps(e),a=j["default"].positionsFromValues(e,n);if(e.isMultiValue){var r=(0,_.distanceTo)(t,a.min),o=(0,_.distanceTo)(t,a.max);if(o>r)return"min"}return"max"}function m(e){var t=e.props.classNames,n=[],a=d(e),r=j["default"].valuesFromProps(e),o=j["default"].percentagesFromValues(e,r),u=!0,i=!1,l=void 0;try{for(var s,f=a[Symbol.iterator]();!(u=(s=f.next()).done);u=!0){var p=s.value,c=r[p],h=o[p],m="slider"+(0,_.captialize)(p),v=e.props,y=v.maxValue,b=v.minValue;"min"===p?y=r.max:b=r.min;var w=g["default"].createElement(T["default"],{ariaLabelledby:e.props.ariaLabelledby,ariaControls:e.props.ariaControls,classNames:t,formatLabel:e.formatLabel,key:p,maxValue:y,minValue:b,onSliderKeyDown:e.handleSliderKeyDown,onSliderMouseMove:e.handleSliderMouseMove,percentage:h,ref:m,type:p,value:c});n.push(w)}}catch(P){i=!0,l=P}finally{try{!u&&f["return"]&&f["return"]()}finally{if(i)throw l}}return n}function v(e){var t=[],n=d(e),a=!0,r=!1,o=void 0;try{for(var u,i=n[Symbol.iterator]();!(a=(u=i.next()).done);a=!0){var l=u.value,s=e.isMultiValue?""+e.props.name+(0,_.captialize)(l):e.props.name;g["default"].createElement("input",{type:"hidden",name:s})}}catch(f){r=!0,o=f}finally{try{!a&&i["return"]&&i["return"]()}finally{if(r)throw o}}return t}Object.defineProperty(n,"__esModule",{value:!0});var y=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),b=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},w="undefined"!=typeof window?window.React:"undefined"!=typeof a?a.React:null,g=r(w),P=e("./Slider"),T=r(P),M=e("./Track"),O=r(M),V=e("./Label"),x=r(V),k=e("./defaultClassNames"),E=r(k),R=e("./valueTransformer"),j=r(R),_=e("./util"),C=e("./propTypes"),D=new WeakMap,N={DOWN_ARROW:40,LEFT_ARROW:37,RIGHT_ARROW:39,UP_ARROW:38},S=function(e){function t(e){o(this,t),b(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),D.set(this,{}),(0,_.autobind)(["formatLabel","handleInteractionEnd","handleInteractionStart","handleKeyDown","handleKeyUp","handleMouseDown","handleMouseUp","handleSliderKeyDown","handleSliderMouseMove","handleTouchStart","handleTouchEnd","handleTrackMouseDown"],this)}return u(t,e),y(t,[{key:"updatePosition",value:function(e,t){var n=j["default"].valuesFromProps(this),a=j["default"].positionsFromValues(this,n);a[e]=t,this.updatePositions(a)}},{key:"updatePositions",value:function(e){var t={min:j["default"].valueFromPosition(this,e.min),max:j["default"].valueFromPosition(this,e.max)},n={min:j["default"].stepValueFromValue(this,t.min),max:j["default"].stepValueFromValue(this,t.max)};this.updateValues(n)}},{key:"updateValue",value:function(e,t){var n=j["default"].valuesFromProps(this);n[e]=t,this.updateValues(n)}},{key:"updateValues",value:function(e){s(this,e)&&(this.isMultiValue?this.props.onChange(this,e):this.props.onChange(this,e.max))}},{key:"incrementValue",value:function(e){var t=j["default"].valuesFromProps(this),n=t[e]+this.props.step;this.updateValue(e,n)}},{key:"decrementValue",value:function(e){var t=j["default"].valuesFromProps(this),n=t[e]-this.props.step;this.updateValue(e,n)}},{key:"formatLabel",value:function n(e){var t=this.props,n=t.formatLabel,a=t.labelPrefix,r=t.labelSuffix;return n?n(e,{labelPrefix:a,labelSuffix:r}):""+a+e+r}},{key:"handleSliderMouseMove",value:function(e,t){if(!this.props.disabled){var n=c(this,t),a=j["default"].positionFromEvent(this,e);this.updatePosition(n,a)}}},{key:"handleSliderKeyDown",value:function(e,t){if(!this.props.disabled){var n=c(this,t);switch(e.keyCode){case N.LEFT_ARROW:case N.DOWN_ARROW:e.preventDefault(),this.decrementValue(n);break;case N.RIGHT_ARROW:case N.UP_ARROW:e.preventDefault(),this.incrementValue(n)}}}},{key:"handleTrackMouseDown",value:function(e,t,n){if(!this.props.disabled){e.preventDefault();var a=h(this,n);this.updatePosition(a,n)}}},{key:"handleInteractionStart",value:function(){var e=D.get(this);this.props.onChangeComplete&&!(0,_.isDefined)(e.startValue)&&(e.startValue=this.props.value||this.props.defaultValue)}},{key:"handleInteractionEnd",value:function(){var e=D.get(this);this.props.onChangeComplete&&(0,_.isDefined)(e.startValue)&&(e.startValue!==this.props.value&&this.props.onChangeComplete(this,this.props.value),e.startValue=null)}},{key:"handleKeyDown",value:function(e){this.handleInteractionStart(e)}},{key:"handleKeyUp",value:function(e){this.handleInteractionEnd(e)}},{key:"handleMouseDown",value:function(e){var t=f(this);this.handleInteractionStart(e),t.addEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseUp",value:function(e){var t=f(this);this.handleInteractionEnd(e),t.removeEventListener("mouseup",this.handleMouseUp)}},{key:"handleTouchStart",value:function(e){var t=f(this);this.handleInteractionStart(e),t.addEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchEnd",value:function(e){var t=f(this);this.handleInteractionEnd(e),t.removeEventListener("touchend",this.handleTouchEnd)}},{key:"render",value:function(){var e=this.props.classNames,t=p(this),n=j["default"].valuesFromProps(this),a=j["default"].percentagesFromValues(this,n);return g["default"].createElement("div",{"aria-disabled":this.props.disabled,ref:"inputRange",className:t,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart},g["default"].createElement(x["default"],{className:e.labelMin,containerClassName:e.labelContainer,formatLabel:this.formatLabel},this.props.minValue),g["default"].createElement(O["default"],{classNames:e,ref:"track",percentages:a,onTrackMouseDown:this.handleTrackMouseDown},m(this)),g["default"].createElement(x["default"],{className:e.labelMax,containerClassName:e.labelContainer,formatLabel:this.formatLabel},this.props.maxValue),v(this))}},{key:"trackClientRect",get:function(){var e=this.refs.track;return e?e.clientRect:{height:0,left:0,top:0,width:0}}},{key:"isMultiValue",get:function(){return(0,_.isObject)(this.props.value)||(0,_.isObject)(this.props.defaultValue)}}]),t}(g["default"].Component);n["default"]=S,S.propTypes={ariaLabelledby:g["default"].PropTypes.string,ariaControls:g["default"].PropTypes.string,classNames:g["default"].PropTypes.objectOf(g["default"].PropTypes.string),defaultValue:C.maxMinValuePropType,disabled:g["default"].PropTypes.bool,formatLabel:g["default"].PropTypes.func,labelPrefix:g["default"].PropTypes.string,labelSuffix:g["default"].PropTypes.string,maxValue:C.maxMinValuePropType,minValue:C.maxMinValuePropType,name:g["default"].PropTypes.string,onChange:g["default"].PropTypes.func.isRequired,onChangeComplete:g["default"].PropTypes.func,step:g["default"].PropTypes.number,value:C.maxMinValuePropType},S.defaultProps={classNames:E["default"],defaultValue:0,disabled:!1,labelPrefix:"",labelSuffix:"",maxValue:10,minValue:0,step:1,value:null},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Label":2,"./Slider":3,"./Track":4,"./defaultClassNames":5,"./propTypes":6,"./util":7,"./valueTransformer":8}],2:[function(e,t,n){(function(e){"use strict";function a(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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),i=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},l="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,s=a(l),f=function(e){function t(){r(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.containerClassName,a=this.props.formatLabel?this.props.formatLabel(this.props.children):this.props.children;return s["default"].createElement("span",{className:t},s["default"].createElement("span",{className:n},a))}}]),t}(s["default"].Component);n["default"]=f,f.propTypes={children:s["default"].PropTypes.node,className:s["default"].PropTypes.string,containerClassName:s["default"].PropTypes.string,formatLabel:s["default"].PropTypes.func},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,n){(function(a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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){var t=e.refs.slider.ownerDocument;return t}function l(e){var t=100*(e.props.percentage||0),n={position:"absolute",left:t+"%"};return n}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),f=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},p="undefined"!=typeof window?window.React:"undefined"!=typeof a?a.React:null,c=r(p),d=e("./Label"),h=r(d),m=e("./util"),v=function(e){function t(e){o(this,t),f(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),(0,m.autobind)(["handleClick","handleMouseDown","handleMouseUp","handleMouseMove","handleTouchStart","handleTouchEnd","handleTouchMove","handleKeyDown"],this)}return u(t,e),s(t,[{key:"handleClick",value:function(e){e.preventDefault()}},{key:"handleMouseDown",value:function(){var e=i(this);e.addEventListener("mousemove",this.handleMouseMove),e.addEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseUp",value:function(){var e=i(this);e.removeEventListener("mousemove",this.handleMouseMove),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseMove",value:function(e){this.props.onSliderMouseMove(e,this)}},{key:"handleTouchStart",value:function(e){var t=i(this);e.preventDefault(),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchMove",value:function(e){this.props.onSliderMouseMove(e,this)}},{key:"handleTouchEnd",value:function(){var e=i(this);event.preventDefault(),e.removeEventListener("touchmove",this.handleTouchMove),e.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleKeyDown",value:function(e){this.props.onSliderKeyDown(e,this)}},{key:"render",value:function(){var e=this.props.classNames,t=l(this);return c["default"].createElement("span",{className:e.sliderContainer,ref:"slider",style:t},c["default"].createElement(h["default"],{className:e.labelValue,containerClassName:e.labelContainer,formatLabel:this.props.formatLabel},this.props.value),c["default"].createElement("a",{"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:e.slider,draggable:"false",href:"#",onClick:this.handleClick,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,role:"slider"}))}}]),t}(c["default"].Component);n["default"]=v,v.propTypes={ariaLabelledby:c["default"].PropTypes.string,ariaControls:c["default"].PropTypes.string,classNames:c["default"].PropTypes.objectOf(c["default"].PropTypes.string),formatLabel:c["default"].PropTypes.func,maxValue:c["default"].PropTypes.number,minValue:c["default"].PropTypes.number,onSliderKeyDown:c["default"].PropTypes.func.isRequired,onSliderMouseMove:c["default"].PropTypes.func.isRequired,percentage:c["default"].PropTypes.number.isRequired,type:c["default"].PropTypes.string.isRequired,value:c["default"].PropTypes.number.isRequired},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Label":2,"./util":7}],4:[function(e,t,n){(function(a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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){var t=e.props,n=100*(t.percentages.max-t.percentages.min)+"%",a=100*t.percentages.min+"%",r={left:a,width:n};return r}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),s=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},f="undefined"!=typeof window?window.React:"undefined"!=typeof a?a.React:null,p=r(f),c=e("./util"),d=function(e){function t(e){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),(0,c.autobind)(["handleMouseDown","handleTouchStart"],this)}return u(t,e),l(t,[{key:"handleMouseDown",value:function(e){var t=this.clientRect,n=e.touches?e.touches[0]:e,a=n.clientX,r={x:a-t.left,y:0};this.props.onTrackMouseDown(e,this,r)}},{key:"handleTouchStart",value:function(e){e.preventDefault(),this.handleMouseDown(e)}},{key:"render",value:function(){var e=i(this),t=this.props.classNames;return p["default"].createElement("div",{className:t.trackContainer,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,ref:"track"},p["default"].createElement("div",{style:e,className:t.trackActive}),this.props.children)}},{key:"clientRect",get:function(){var e=this.refs.track,t=e.getBoundingClientRect();return t}}]),t}(p["default"].Component);n["default"]=d,d.propTypes={children:p["default"].PropTypes.node,classNames:p["default"].PropTypes.objectOf(p["default"].PropTypes.string),onTrackMouseDown:p["default"].PropTypes.func.isRequired,percentages:p["default"].PropTypes.objectOf(p["default"].PropTypes.number).isRequired},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util":7}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={component:"InputRange",labelContainer:"InputRange-labelContainer",labelMax:"InputRange-label InputRange-label--max",labelMin:"InputRange-label InputRange-label--min",labelValue:"InputRange-label InputRange-label--value",slider:"InputRange-slider",sliderContainer:"InputRange-sliderContainer",trackActive:"InputRange-track InputRange-track--active",trackContainer:"InputRange-track InputRange-track--container"},t.exports=n["default"]},{}],6:[function(e,t,n){"use strict";function a(e){var t=e.maxValue,n=e.minValue,a=e.value,o=e.defaultValue,u=(0,r.isNumber)(a),i=(0,r.isNumber)(o),l=(0,r.objectOf)(a,r.isNumber),s=(0,r.objectOf)(o,r.isNumber);return void 0===a?new Error("`value` must be defined"):u||i||l||s?n>=t?new Error("`minValue` must be smaller than `maxValue`"):n>=t?new Error("`maxValue` must be larger than `minValue`"):n>a||a>t?new Error("`value` must be within `minValue` and `maxValue`"):void 0:new Error("`value` or `defaultValue` must be a number or an array")}Object.defineProperty(n,"__esModule",{value:!0}),n.maxMinValuePropType=a;var r=e("./util")},{"./util":7}],7:[function(e,t,n){"use strict";function a(e,t,n){return Math.min(Math.max(e,t),n)}function r(){return Object.assign.apply(Object,arguments)}function o(e,t){return e.indexOf(t)>-1}function u(e,t){var n=Object.keys(e),a={};return n.forEach(function(n){o(t,n)||(a[n]=e[n])}),a}function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function s(e,t){return Math.abs(e-t)}function f(e){return"number"==typeof e}function p(e){return null!==e&&"object"==typeof e}function c(e){return void 0!==e&&null!==e}function d(e){return e?Array.isArray(e)?0===e.length:0===Object.keys(e).length:!0}function h(e,t){if(!Array.isArray(e))return!1;for(var n=0,a=e.length;a>n;n++)if(!t(e[n]))return!1;return!0}function m(e,t,n){if(!p(e))return!1;for(var a=n||Object.keys(e),r=0,o=a.length;o>r;r++){var u=a[r];if(!t(e[u]))return!1}return!0}function v(e,t){e.forEach(function(e){t[e]=t[e].bind(t)})}Object.defineProperty(n,"__esModule",{value:!0}),n.clamp=a,n.extend=r,n.includes=o,n.omit=u,n.captialize=i,n.distanceTo=l,n.length=s,n.isNumber=f,n.isObject=p,n.isDefined=c,n.isEmpty=d,n.arrayOf=h,n.objectOf=m,n.autobind=v},{}],8:[function(e,t,n){"use strict";function a(e,t){var n=e.trackClientRect.width,a=t.x/n;return a||0}function r(e,t){var n=a(e,t),r=e.props.maxValue-e.props.minValue,o=e.props.minValue+r*n;return o}function o(e){var t=arguments.length<=1||void 0===arguments[1]?e:arguments[1],n=t.props;return function(){if(e.isMultiValue){var t=n.value;return!(0,c.isEmpty)(t)&&(0,c.objectOf)(t,c.isNumber)||(t=n.defaultValue),Object.create(t)}var a=(0,c.isNumber)(n.value)?n.value:n.defaultValue;return{min:n.minValue,max:a}}()}function u(e,t){var n=(0,c.clamp)(t,e.props.minValue,e.props.maxValue),a=e.props.maxValue-e.props.minValue,r=(n-e.props.minValue)/a;return r||0}function i(e,t){var n={min:u(e,t.min),max:u(e,t.max)};return n}function l(e,t){var n=e.trackClientRect.width,a=u(e,t),r=a*n;return{x:r,y:0}}function s(e,t){var n={min:l(e,t.min),max:l(e,t.max)};return n}function f(e,t){var n=e.trackClientRect,a=n.width,r=t.touches?t.touches[0]:t,o=r.clientX,u={x:(0,c.clamp)(o-n.left,0,a),y:0};return u}function p(e,t){return Math.round(t/e.props.step)*e.props.step}Object.defineProperty(n,"__esModule",{value:!0});var c=e("./util");n["default"]={percentageFromPosition:a,percentageFromValue:u,percentagesFromValues:i,positionFromEvent:f,positionFromValue:l,positionsFromValues:s,stepValueFromValue:p,valueFromPosition:r,valuesFromProps:o},t.exports=n["default"]},{"./util":7}],9:[function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var r=e("./InputRange"),o=a(r);n["default"]=o["default"],t.exports=n["default"]},{"./InputRange":1}]},{},[9])(9)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.InputRange=e()}}(function(){return function e(t,n,a){function r(u,i){if(!n[u]){if(!t[u]){var l="function"==typeof require&&require;if(!i&&l)return l(u,!0);if(o)return o(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return r(n?n:e)},f,f.exports,e,t,n,a)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<a.length;u++)r(a[u]);return r}({1:[function(e,t,n){(function(a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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){var n=e.props;return e.isMultiValue?t.min>=n.minValue&&t.max<=n.maxValue&&t.min<t.max:t.max>=n.minValue&&t.max<=n.maxValue}function l(e,t){var n=e.props,a=j["default"].valuesFromProps(e);return(0,_.length)(t.min,a.min)>=n.step||(0,_.length)(t.max,a.max)>=n.step}function s(e,t){return i(e,t)&&l(e,t)}function f(e){var t=e.refs.inputRange.ownerDocument;return t}function p(e){var t=e.props;return t.disabled?t.classNames.component+" is-disabled":t.classNames.component}function c(e,t){return t===e.refs.sliderMin?"min":"max"}function d(e){return e.isMultiValue?["min","max"]:["max"]}function h(e,t){var n=j["default"].valuesFromProps(e),a=j["default"].positionsFromValues(e,n);if(e.isMultiValue){var r=(0,_.distanceTo)(t,a.min),o=(0,_.distanceTo)(t,a.max);if(o>r)return"min"}return"max"}function m(e){var t=e.props.classNames,n=[],a=d(e),r=j["default"].valuesFromProps(e),o=j["default"].percentagesFromValues(e,r),u=!0,i=!1,l=void 0;try{for(var s,f=a[Symbol.iterator]();!(u=(s=f.next()).done);u=!0){var p=s.value,c=r[p],h=o[p],m="slider"+(0,_.captialize)(p),v=e.props,y=v.maxValue,b=v.minValue;"min"===p?y=r.max:b=r.min;var w=g["default"].createElement(T["default"],{ariaLabelledby:e.props.ariaLabelledby,ariaControls:e.props.ariaControls,classNames:t,formatLabel:e.formatLabel,key:p,maxValue:y,minValue:b,onSliderKeyDown:e.handleSliderKeyDown,onSliderMouseMove:e.handleSliderMouseMove,percentage:h,ref:m,type:p,value:c});n.push(w)}}catch(P){i=!0,l=P}finally{try{!u&&f["return"]&&f["return"]()}finally{if(i)throw l}}return n}function v(e){var t=[],n=d(e),a=!0,r=!1,o=void 0;try{for(var u,i=n[Symbol.iterator]();!(a=(u=i.next()).done);a=!0){var l=u.value,s=e.isMultiValue?""+e.props.name+(0,_.captialize)(l):e.props.name;g["default"].createElement("input",{type:"hidden",name:s})}}catch(f){r=!0,o=f}finally{try{!a&&i["return"]&&i["return"]()}finally{if(r)throw o}}return t}Object.defineProperty(n,"__esModule",{value:!0});var y=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),b=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},w="undefined"!=typeof window?window.React:"undefined"!=typeof a?a.React:null,g=r(w),P=e("./Slider"),T=r(P),M=e("./Track"),O=r(M),V=e("./Label"),x=r(V),k=e("./defaultClassNames"),E=r(k),R=e("./valueTransformer"),j=r(R),_=e("./util"),C=e("./propTypes"),D=new WeakMap,N={DOWN_ARROW:40,LEFT_ARROW:37,RIGHT_ARROW:39,UP_ARROW:38},S=function(e){function t(e){o(this,t),b(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),D.set(this,{}),(0,_.autobind)(["formatLabel","handleInteractionEnd","handleInteractionStart","handleKeyDown","handleKeyUp","handleMouseDown","handleMouseUp","handleSliderKeyDown","handleSliderMouseMove","handleTouchStart","handleTouchEnd","handleTrackMouseDown"],this)}return u(t,e),y(t,[{key:"updatePosition",value:function(e,t){var n=j["default"].valuesFromProps(this),a=j["default"].positionsFromValues(this,n);a[e]=t,this.updatePositions(a)}},{key:"updatePositions",value:function(e){var t={min:j["default"].valueFromPosition(this,e.min),max:j["default"].valueFromPosition(this,e.max)},n={min:j["default"].stepValueFromValue(this,t.min),max:j["default"].stepValueFromValue(this,t.max)};this.updateValues(n)}},{key:"updateValue",value:function(e,t){var n=j["default"].valuesFromProps(this);n[e]=t,this.updateValues(n)}},{key:"updateValues",value:function(e){s(this,e)&&(this.isMultiValue?this.props.onChange(this,e):this.props.onChange(this,e.max))}},{key:"incrementValue",value:function(e){var t=j["default"].valuesFromProps(this),n=t[e]+this.props.step;this.updateValue(e,n)}},{key:"decrementValue",value:function(e){var t=j["default"].valuesFromProps(this),n=t[e]-this.props.step;this.updateValue(e,n)}},{key:"formatLabel",value:function n(e){var t=this.props,n=t.formatLabel,a=t.labelPrefix,r=t.labelSuffix;return n?n(e,{labelPrefix:a,labelSuffix:r}):""+a+e+r}},{key:"handleSliderMouseMove",value:function(e,t){if(!this.props.disabled){var n=c(this,t),a=j["default"].positionFromEvent(this,e);this.updatePosition(n,a)}}},{key:"handleSliderKeyDown",value:function(e,t){if(!this.props.disabled){var n=c(this,t);switch(e.keyCode){case N.LEFT_ARROW:case N.DOWN_ARROW:e.preventDefault(),this.decrementValue(n);break;case N.RIGHT_ARROW:case N.UP_ARROW:e.preventDefault(),this.incrementValue(n)}}}},{key:"handleTrackMouseDown",value:function(e,t,n){if(!this.props.disabled){e.preventDefault();var a=h(this,n);this.updatePosition(a,n)}}},{key:"handleInteractionStart",value:function(){var e=D.get(this);this.props.onChangeComplete&&!(0,_.isDefined)(e.startValue)&&(e.startValue=this.props.value||this.props.defaultValue)}},{key:"handleInteractionEnd",value:function(){var e=D.get(this);this.props.onChangeComplete&&(0,_.isDefined)(e.startValue)&&(e.startValue!==this.props.value&&this.props.onChangeComplete(this,this.props.value),e.startValue=null)}},{key:"handleKeyDown",value:function(e){this.handleInteractionStart(e)}},{key:"handleKeyUp",value:function(e){this.handleInteractionEnd(e)}},{key:"handleMouseDown",value:function(e){var t=f(this);this.handleInteractionStart(e),t.addEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseUp",value:function(e){var t=f(this);this.handleInteractionEnd(e),t.removeEventListener("mouseup",this.handleMouseUp)}},{key:"handleTouchStart",value:function(e){var t=f(this);this.handleInteractionStart(e),t.addEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchEnd",value:function(e){var t=f(this);this.handleInteractionEnd(e),t.removeEventListener("touchend",this.handleTouchEnd)}},{key:"render",value:function(){var e=this.props.classNames,t=p(this),n=j["default"].valuesFromProps(this),a=j["default"].percentagesFromValues(this,n);return g["default"].createElement("div",{"aria-disabled":this.props.disabled,ref:"inputRange",className:t,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart},g["default"].createElement(x["default"],{className:e.labelMin,containerClassName:e.labelContainer,formatLabel:this.formatLabel},this.props.minValue),g["default"].createElement(O["default"],{classNames:e,ref:"track",percentages:a,onTrackMouseDown:this.handleTrackMouseDown},m(this)),g["default"].createElement(x["default"],{className:e.labelMax,containerClassName:e.labelContainer,formatLabel:this.formatLabel},this.props.maxValue),v(this))}},{key:"trackClientRect",get:function(){var e=this.refs.track;return e?e.clientRect:{height:0,left:0,top:0,width:0}}},{key:"isMultiValue",get:function(){return(0,_.isObject)(this.props.value)||(0,_.isObject)(this.props.defaultValue)}}]),t}(g["default"].Component);n["default"]=S,S.propTypes={ariaLabelledby:g["default"].PropTypes.string,ariaControls:g["default"].PropTypes.string,classNames:g["default"].PropTypes.objectOf(g["default"].PropTypes.string),defaultValue:C.maxMinValuePropType,disabled:g["default"].PropTypes.bool,formatLabel:g["default"].PropTypes.func,labelPrefix:g["default"].PropTypes.string,labelSuffix:g["default"].PropTypes.string,maxValue:C.maxMinValuePropType,minValue:C.maxMinValuePropType,name:g["default"].PropTypes.string,onChange:g["default"].PropTypes.func.isRequired,onChangeComplete:g["default"].PropTypes.func,step:g["default"].PropTypes.number,value:C.maxMinValuePropType},S.defaultProps={classNames:E["default"],defaultValue:0,disabled:!1,labelPrefix:"",labelSuffix:"",maxValue:10,minValue:0,step:1,value:null},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Label":2,"./Slider":3,"./Track":4,"./defaultClassNames":5,"./propTypes":6,"./util":7,"./valueTransformer":8}],2:[function(e,t,n){(function(e){"use strict";function a(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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),i=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},l="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,s=a(l),f=function(e){function t(){r(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return o(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.containerClassName,a=this.props.formatLabel?this.props.formatLabel(this.props.children):this.props.children;return s["default"].createElement("span",{className:t},s["default"].createElement("span",{className:n},a))}}]),t}(s["default"].Component);n["default"]=f,f.propTypes={children:s["default"].PropTypes.node,className:s["default"].PropTypes.string,containerClassName:s["default"].PropTypes.string,formatLabel:s["default"].PropTypes.func},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,n){(function(a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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){var t=e.refs.slider.ownerDocument;return t}function l(e){var t=100*(e.props.percentage||0),n={position:"absolute",left:t+"%"};return n}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),f=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},p="undefined"!=typeof window?window.React:"undefined"!=typeof a?a.React:null,c=r(p),d=e("./Label"),h=r(d),m=e("./util"),v=function(e){function t(e){o(this,t),f(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),(0,m.autobind)(["handleClick","handleMouseDown","handleMouseUp","handleMouseMove","handleTouchStart","handleTouchEnd","handleTouchMove","handleKeyDown"],this)}return u(t,e),s(t,[{key:"handleClick",value:function(e){e.preventDefault()}},{key:"handleMouseDown",value:function(){var e=i(this);e.addEventListener("mousemove",this.handleMouseMove),e.addEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseUp",value:function(){var e=i(this);e.removeEventListener("mousemove",this.handleMouseMove),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseMove",value:function(e){this.props.onSliderMouseMove(e,this)}},{key:"handleTouchStart",value:function(e){var t=i(this);e.preventDefault(),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchMove",value:function(e){this.props.onSliderMouseMove(e,this)}},{key:"handleTouchEnd",value:function(e){var t=i(this);e.preventDefault(),t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleKeyDown",value:function(e){this.props.onSliderKeyDown(e,this)}},{key:"render",value:function(){var e=this.props.classNames,t=l(this);return c["default"].createElement("span",{className:e.sliderContainer,ref:"slider",style:t},c["default"].createElement(h["default"],{className:e.labelValue,containerClassName:e.labelContainer,formatLabel:this.props.formatLabel},this.props.value),c["default"].createElement("a",{"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:e.slider,draggable:"false",href:"#",onClick:this.handleClick,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,role:"slider"}))}}]),t}(c["default"].Component);n["default"]=v,v.propTypes={ariaLabelledby:c["default"].PropTypes.string,ariaControls:c["default"].PropTypes.string,classNames:c["default"].PropTypes.objectOf(c["default"].PropTypes.string),formatLabel:c["default"].PropTypes.func,maxValue:c["default"].PropTypes.number,minValue:c["default"].PropTypes.number,onSliderKeyDown:c["default"].PropTypes.func.isRequired,onSliderMouseMove:c["default"].PropTypes.func.isRequired,percentage:c["default"].PropTypes.number.isRequired,type:c["default"].PropTypes.string.isRequired,value:c["default"].PropTypes.number.isRequired},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Label":2,"./util":7}],4:[function(e,t,n){(function(a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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){var t=e.props,n=100*(t.percentages.max-t.percentages.min)+"%",a=100*t.percentages.min+"%",r={left:a,width:n};return r}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),s=function(e,t,n){for(var a=!0;a;){var r=e,o=t,u=n;a=!1,null===r&&(r=Function.prototype);var i=Object.getOwnPropertyDescriptor(r,o);if(void 0!==i){if("value"in i)return i.value;var l=i.get;if(void 0===l)return;return l.call(u)}var s=Object.getPrototypeOf(r);if(null===s)return;e=s,t=o,n=u,a=!0,i=s=void 0}},f="undefined"!=typeof window?window.React:"undefined"!=typeof a?a.React:null,p=r(f),c=e("./util"),d=function(e){function t(e){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),(0,c.autobind)(["handleMouseDown","handleTouchStart"],this)}return u(t,e),l(t,[{key:"handleMouseDown",value:function(e){var t=this.clientRect,n=e.touches?e.touches[0]:e,a=n.clientX,r={x:a-t.left,y:0};this.props.onTrackMouseDown(e,this,r)}},{key:"handleTouchStart",value:function(e){e.preventDefault(),this.handleMouseDown(e)}},{key:"render",value:function(){var e=i(this),t=this.props.classNames;return p["default"].createElement("div",{className:t.trackContainer,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,ref:"track"},p["default"].createElement("div",{style:e,className:t.trackActive}),this.props.children)}},{key:"clientRect",get:function(){var e=this.refs.track,t=e.getBoundingClientRect();return t}}]),t}(p["default"].Component);n["default"]=d,d.propTypes={children:p["default"].PropTypes.node,classNames:p["default"].PropTypes.objectOf(p["default"].PropTypes.string),onTrackMouseDown:p["default"].PropTypes.func.isRequired,percentages:p["default"].PropTypes.objectOf(p["default"].PropTypes.number).isRequired},t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util":7}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={component:"InputRange",labelContainer:"InputRange-labelContainer",labelMax:"InputRange-label InputRange-label--max",labelMin:"InputRange-label InputRange-label--min",labelValue:"InputRange-label InputRange-label--value",slider:"InputRange-slider",sliderContainer:"InputRange-sliderContainer",trackActive:"InputRange-track InputRange-track--active",trackContainer:"InputRange-track InputRange-track--container"},t.exports=n["default"]},{}],6:[function(e,t,n){"use strict";function a(e){var t=e.maxValue,n=e.minValue,a=e.value,o=e.defaultValue,u=(0,r.isNumber)(a),i=(0,r.isNumber)(o),l=(0,r.objectOf)(a,r.isNumber),s=(0,r.objectOf)(o,r.isNumber);return void 0===a?new Error("`value` must be defined"):u||i||l||s?n>=t?new Error("`minValue` must be smaller than `maxValue`"):n>=t?new Error("`maxValue` must be larger than `minValue`"):n>a||a>t?new Error("`value` must be within `minValue` and `maxValue`"):void 0:new Error("`value` or `defaultValue` must be a number or an array")}Object.defineProperty(n,"__esModule",{value:!0}),n.maxMinValuePropType=a;var r=e("./util")},{"./util":7}],7:[function(e,t,n){"use strict";function a(e,t,n){return Math.min(Math.max(e,t),n)}function r(){return Object.assign.apply(Object,arguments)}function o(e,t){return e.indexOf(t)>-1}function u(e,t){var n=Object.keys(e),a={};return n.forEach(function(n){o(t,n)||(a[n]=e[n])}),a}function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function s(e,t){return Math.abs(e-t)}function f(e){return"number"==typeof e}function p(e){return null!==e&&"object"==typeof e}function c(e){return void 0!==e&&null!==e}function d(e){return e?Array.isArray(e)?0===e.length:0===Object.keys(e).length:!0}function h(e,t){if(!Array.isArray(e))return!1;for(var n=0,a=e.length;a>n;n++)if(!t(e[n]))return!1;return!0}function m(e,t,n){if(!p(e))return!1;for(var a=n||Object.keys(e),r=0,o=a.length;o>r;r++){var u=a[r];if(!t(e[u]))return!1}return!0}function v(e,t){e.forEach(function(e){t[e]=t[e].bind(t)})}Object.defineProperty(n,"__esModule",{value:!0}),n.clamp=a,n.extend=r,n.includes=o,n.omit=u,n.captialize=i,n.distanceTo=l,n.length=s,n.isNumber=f,n.isObject=p,n.isDefined=c,n.isEmpty=d,n.arrayOf=h,n.objectOf=m,n.autobind=v},{}],8:[function(e,t,n){"use strict";function a(e,t){var n=e.trackClientRect.width,a=t.x/n;return a||0}function r(e,t){var n=a(e,t),r=e.props.maxValue-e.props.minValue,o=e.props.minValue+r*n;return o}function o(e){var t=arguments.length<=1||void 0===arguments[1]?e:arguments[1],n=t.props;return function(){if(e.isMultiValue){var t=n.value;return!(0,c.isEmpty)(t)&&(0,c.objectOf)(t,c.isNumber)||(t=n.defaultValue),Object.create(t)}var a=(0,c.isNumber)(n.value)?n.value:n.defaultValue;return{min:n.minValue,max:a}}()}function u(e,t){var n=(0,c.clamp)(t,e.props.minValue,e.props.maxValue),a=e.props.maxValue-e.props.minValue,r=(n-e.props.minValue)/a;return r||0}function i(e,t){var n={min:u(e,t.min),max:u(e,t.max)};return n}function l(e,t){var n=e.trackClientRect.width,a=u(e,t),r=a*n;return{x:r,y:0}}function s(e,t){var n={min:l(e,t.min),max:l(e,t.max)};return n}function f(e,t){var n=e.trackClientRect,a=n.width,r=t.touches?t.touches[0]:t,o=r.clientX,u={x:(0,c.clamp)(o-n.left,0,a),y:0};return u}function p(e,t){return Math.round(t/e.props.step)*e.props.step}Object.defineProperty(n,"__esModule",{value:!0});var c=e("./util");n["default"]={percentageFromPosition:a,percentageFromValue:u,percentagesFromValues:i,positionFromEvent:f,positionFromValue:l,positionsFromValues:s,stepValueFromValue:p,valueFromPosition:r,valuesFromProps:o},t.exports=n["default"]},{"./util":7}],9:[function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var r=e("./InputRange"),o=a(r);n["default"]=o["default"],t.exports=n["default"]},{"./InputRange":1}]},{},[9])(9)}); |
@@ -174,3 +174,3 @@ /** | ||
key: 'handleTouchEnd', | ||
value: function handleTouchEnd() { | ||
value: function handleTouchEnd(event) { | ||
var document = getDocument(this); | ||
@@ -177,0 +177,0 @@ |
{ | ||
"name": "react-input-range", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "React component for inputting numeric values within a range", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
130316