diff --git a/.gitignore b/.gitignore index 06f291a..1627611 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ build coverage docs -lib node_modules diff --git a/example/js/example-app.jsx b/example/js/example-app.jsx index f09d307..d565927 100644 --- a/example/js/example-app.jsx +++ b/example/js/example-app.jsx @@ -30,8 +30,9 @@ export default class ExampleApp extends React.Component { return (
this.setState({ value })} onChangeComplete={value => console.log(value)} /> diff --git a/lib/bundle/react-input-range.css b/lib/bundle/react-input-range.css new file mode 100644 index 0000000..10cbcba --- /dev/null +++ b/lib/bundle/react-input-range.css @@ -0,0 +1,114 @@ +.input-range__slider { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background: #0052f3; + border: 5px solid #5790ff; + border-radius: 100%; + cursor: pointer; + display: block; + height: 1rem; + margin-left: -0.5rem; + margin-top: -0.65rem; + outline: none; + position: relative; + top: -7px; + -webkit-transition: box-shadow 0.3s ease-out, -webkit-transform 0.3s ease-out; + transition: box-shadow 0.3s ease-out, -webkit-transform 0.3s ease-out; + transition: transform 0.3s ease-out, box-shadow 0.3s ease-out; + transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, -webkit-transform 0.3s ease-out; + width: 1rem; + z-index: 10; } + .input-range__slider:active { + -webkit-transform: scale(1.3); + transform: scale(1.3); } + .input-range__slider:focus { + box-shadow: 0 0 0 5px rgba(0, 82, 243, 0.2); } + .input-range--disabled .input-range__slider { + background: #cccccc; + border: 1px solid #cccccc; + box-shadow: none; + -webkit-transform: none; + transform: none; } + +.input-range__slider-container { + -webkit-transition: left 0.3s ease-out; + transition: left 0.3s ease-out; } + +.input-range__label { + color: #082865; + font-family: "Helvetica Neue", san-serif; + font-size: 12px; + font-weight: 500; + -webkit-transform: translateZ(0); + transform: translateZ(0); + white-space: nowrap; } + +.input-range__label--min, +.input-range__label--max, +.input-range__label--fst, +.input-range__label--snd, +.input-range__label--thd { + bottom: -1.4rem; + position: absolute; } + +.input-range__label--sublabel { + height: 1rem; } + +.input-range__label--min { + left: 0; } + +.input-range__label--max { + right: 0; } + +.input-range__label--value { + position: absolute; + top: -1.8rem; + display: none; } + +.input-range__label--inactive { + background-color: #e0e7f1; + border-radius: 100%; + width: 7px; + height: 7px; + top: 28%; + pointer-events: none; } + +.input-range__label-container { + left: -50%; + position: relative; } + .input-range__label--max .input-range__label-container { + left: 50%; } + +.input-range__track { + background: #eeeeee; + border-radius: 0.3rem; + cursor: pointer; + display: block; + height: 0.3rem; + position: relative; + -webkit-transition: left 0.3s ease-out, width 0.3s ease-out; + transition: left 0.3s ease-out, width 0.3s ease-out; } + .input-range--disabled .input-range__track { + background: #eeeeee; } + +.input-range__track--background { + left: 0; + margin-top: -0.15rem; + position: absolute; + right: 0; + top: 50%; } + +.input-range__track--active { + background-color: rgba(162, 193, 255, 0.93); + height: 7px; + position: relative; + top: -2px; + z-index: 10; } + +.input-range { + height: 1rem; + position: relative; + width: 100%; } + +/*# sourceMappingURL=react-input-range.css.map*/ \ No newline at end of file diff --git a/lib/bundle/react-input-range.css.map b/lib/bundle/react-input-range.css.map new file mode 100644 index 0000000..c238e84 --- /dev/null +++ b/lib/bundle/react-input-range.css.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"react-input-range.css","sourceRoot":""} \ No newline at end of file diff --git a/lib/bundle/react-input-range.js b/lib/bundle/react-input-range.js new file mode 100644 index 0000000..1611a64 --- /dev/null +++ b/lib/bundle/react-input-range.js @@ -0,0 +1,3608 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("react")); + else if(typeof define === 'function' && define.amd) + define(["react"], factory); + else if(typeof exports === 'object') + exports["InputRange"] = factory(require("react")); + else + root["InputRange"] = factory(root["React"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 11); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _captialize = __webpack_require__(19); + +Object.defineProperty(exports, 'captialize', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_captialize).default; + } +}); + +var _clamp = __webpack_require__(20); + +Object.defineProperty(exports, 'clamp', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_clamp).default; + } +}); + +var _distanceTo = __webpack_require__(21); + +Object.defineProperty(exports, 'distanceTo', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_distanceTo).default; + } +}); + +var _isDefined = __webpack_require__(22); + +Object.defineProperty(exports, 'isDefined', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_isDefined).default; + } +}); + +var _isNumber = __webpack_require__(23); + +Object.defineProperty(exports, 'isNumber', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_isNumber).default; + } +}); + +var _isObject = __webpack_require__(24); + +Object.defineProperty(exports, 'isObject', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_isObject).default; + } +}); + +var _length = __webpack_require__(25); + +Object.defineProperty(exports, 'length', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_length).default; + } +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(28)(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(27)(); +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_3__; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * @copyright 2015, Andrey Popp <8mayday@gmail.com> + * + * The decorator may be used on classes or methods + * ``` + * @autobind + * class FullBound {} + * + * class PartBound { + * @autobind + * method () {} + * } + * ``` + */ + + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports['default'] = autobind; + +function autobind() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (args.length === 1) { + return boundClass.apply(undefined, args); + } else { + return boundMethod.apply(undefined, args); + } +} + +/** + * Use boundMethod to bind all methods on the target.prototype + */ +function boundClass(target) { + // (Using reflect to get all keys including symbols) + var keys = undefined; + // Use Reflect if exists + if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') { + keys = Reflect.ownKeys(target.prototype); + } else { + keys = Object.getOwnPropertyNames(target.prototype); + // use symbols if support is provided + if (typeof Object.getOwnPropertySymbols === 'function') { + keys = keys.concat(Object.getOwnPropertySymbols(target.prototype)); + } + } + + keys.forEach(function (key) { + // Ignore special case target method + if (key === 'constructor') { + return; + } + + var descriptor = Object.getOwnPropertyDescriptor(target.prototype, key); + + // Only methods need binding + if (typeof descriptor.value === 'function') { + Object.defineProperty(target.prototype, key, boundMethod(target, key, descriptor)); + } + }); + return target; +} + +/** + * Return a descriptor removing the value and returning a getter + * The getter will return a .bind version of the function + * and memoize the result against a symbol on the instance + */ +function boundMethod(target, key, descriptor) { + var fn = descriptor.value; + + if (typeof fn !== 'function') { + throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn); + } + + // In IE11 calling Object.defineProperty has a side-effect of evaluating the + // getter for the property which is being replaced. This causes infinite + // recursion and an "Out of stack space" error. + var definingProperty = false; + + return { + configurable: true, + get: function get() { + if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) { + return fn; + } + + var boundFn = fn.bind(this); + definingProperty = true; + Object.defineProperty(this, key, { + value: boundFn, + configurable: true, + writable: true + }); + definingProperty = false; + return boundFn; + } + }; +} +module.exports = exports['default']; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +function makeEmptyFunction(arg) { + return function () { + return arg; + }; +} + +/** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ +var emptyFunction = function emptyFunction() {}; + +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function () { + return this; +}; +emptyFunction.thatReturnsArgument = function (arg) { + return arg; +}; + +module.exports = emptyFunction; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var validateFormat = function validateFormat(format) {}; + +if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +module.exports = invariant; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = Label; + +var _react = __webpack_require__(3); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(2); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @ignore + * @param {Object} props + * @param {InputRangeClassNames} props.classNames + * @param {Function} props.formatLabel + * @param {string} props.type + */ +function Label(props) { + var labelValue = props.formatLabel ? props.formatLabel(props.children, props.type) : props.children; + + return _react2.default.createElement( + 'span', + { className: props.classNames[props.type + 'Label'] }, + _react2.default.createElement( + 'span', + { className: props.classNames.labelContainer }, + labelValue + ) + ); +} + +/** + * @type {Object} + * @property {Function} children + * @property {Function} classNames + * @property {Function} formatLabel + * @property {Function} type + */ +Label.propTypes = { + children: _propTypes2.default.node.isRequired, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired, + formatLabel: _propTypes2.default.func, + type: _propTypes2.default.string.isRequired +}; +module.exports = exports['default']; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + + + +var emptyFunction = __webpack_require__(5); + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = emptyFunction; + +if (process.env.NODE_ENV !== 'production') { + (function () { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + })(); +} + +module.exports = warning; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _desc, _value, _class; + +var _react = __webpack_require__(3); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(2); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _autobindDecorator = __webpack_require__(4); + +var _autobindDecorator2 = _interopRequireDefault(_autobindDecorator); + +var _valueTransformer = __webpack_require__(18); + +var valueTransformer = _interopRequireWildcard(_valueTransformer); + +var _defaultClassNames = __webpack_require__(12); + +var _defaultClassNames2 = _interopRequireDefault(_defaultClassNames); + +var _label = __webpack_require__(7); + +var _label2 = _interopRequireDefault(_label); + +var _rangePropType = __webpack_require__(14); + +var _rangePropType2 = _interopRequireDefault(_rangePropType); + +var _valuePropType = __webpack_require__(17); + +var _valuePropType2 = _interopRequireDefault(_valuePropType); + +var _slider = __webpack_require__(15); + +var _slider2 = _interopRequireDefault(_slider); + +var _track = __webpack_require__(16); + +var _track2 = _interopRequireDefault(_track); + +var _utils = __webpack_require__(1); + +var _keyCodes = __webpack_require__(13); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; +} + +/** + * A React component that allows users to input numeric values within a range + * by dragging its sliders. + */ +var InputRange = (_class = function (_React$Component) { + _inherits(InputRange, _React$Component); + + _createClass(InputRange, null, [{ + key: 'propTypes', + + /** + * @ignore + * @override + * @return {Object} + */ + get: function get() { + return { + allowSameValues: _propTypes2.default.bool, + ariaLabelledby: _propTypes2.default.string, + ariaControls: _propTypes2.default.string, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string), + disabled: _propTypes2.default.bool, + draggableTrack: _propTypes2.default.bool, + formatLabel: _propTypes2.default.func, + maxValue: _rangePropType2.default, + minValue: _rangePropType2.default, + name: _propTypes2.default.string, + onChangeStart: _propTypes2.default.func, + onChange: _propTypes2.default.func.isRequired, + onChangeComplete: _propTypes2.default.func, + step: _propTypes2.default.number, + value: _valuePropType2.default, + renderSubLabels: _propTypes2.default.bool + }; + } + + /** + * @ignore + * @override + * @return {Object} + */ + + }, { + key: 'defaultProps', + get: function get() { + return { + allowSameValues: false, + classNames: _defaultClassNames2.default, + disabled: false, + maxValue: 10, + minValue: 0, + step: 1, + renderSubLabels: false + }; + } + + /** + * @param {Object} props + * @param {boolean} [props.allowSameValues] + * @param {string} [props.ariaLabelledby] + * @param {string} [props.ariaControls] + * @param {InputRangeClassNames} [props.classNames] + * @param {boolean} [props.disabled = false] + * @param {Function} [props.formatLabel] + * @param {number|Range} [props.maxValue = 10] + * @param {number|Range} [props.minValue = 0] + * @param {string} [props.name] + * @param {string} props.onChange + * @param {Function} [props.onChangeComplete] + * @param {Function} [props.onChangeStart] + * @param {number} [props.step = 1] + * @param {number|Range} props.value + * @param {boolean} props.renderSubLabels + */ + + }]); + + function InputRange(props) { + _classCallCheck(this, InputRange); + + /** + * @private + * @type {?number} + */ + var _this = _possibleConstructorReturn(this, (InputRange.__proto__ || Object.getPrototypeOf(InputRange)).call(this, props)); + + _this.startValue = null; + + /** + * @private + * @type {?Component} + */ + _this.node = null; + + /** + * @private + * @type {?Component} + */ + _this.trackNode = null; + + /** + * @private + * @type {bool} + */ + _this.isSliderDragging = false; + + /** + * @private + * @type {?string} + */ + _this.lastKeyMoved = null; + return _this; + } + + /** + * @ignore + * @override + * @return {void} + */ + + + _createClass(InputRange, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.removeDocumentMouseUpListener(); + this.removeDocumentTouchEndListener(); + } + + /** + * Return the CSS class name of the component + * @private + * @return {string} + */ + + }, { + key: 'getComponentClassName', + value: function getComponentClassName() { + if (!this.props.disabled) { + return this.props.classNames.inputRange; + } + + return this.props.classNames.disabledInputRange; + } + + /** + * Return the bounding rect of the track + * @private + * @return {ClientRect} + */ + + }, { + key: 'getTrackClientRect', + value: function getTrackClientRect() { + return this.trackNode.getClientRect(); + } + + /** + * Return the slider key closest to a point + * @private + * @param {Point} position + * @return {string} + */ + + }, { + key: 'getKeyByPosition', + value: function getKeyByPosition(position) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect()); + + if (this.isMultiValue()) { + var distanceToMin = (0, _utils.distanceTo)(position, positions.min); + var distanceToMax = (0, _utils.distanceTo)(position, positions.max); + + if (distanceToMin < distanceToMax) { + return 'min'; + } + } + + return 'max'; + } + + /** + * Return all the slider keys + * @private + * @return {string[]} + */ + + }, { + key: 'getKeys', + value: function getKeys() { + if (this.isMultiValue()) { + return ['min', 'max']; + } + + return ['max']; + } + + /** + * @private + * @return {Object} + */ + + }, { + key: 'getStyle', + value: function getStyle(val) { + var _props = this.props, + maxValue = _props.maxValue, + minValue = _props.minValue; + + var perc = (val - minValue) / (maxValue - minValue) * 100; + var style = { + position: 'absolute', + left: perc + '%' + }; + + return style; + } + + /** + * Return true if the difference between the new and the current value is + * greater or equal to the step amount of the component + * @private + * @param {Range} values + * @return {boolean} + */ + + }, { + key: 'hasStepDifference', + value: function hasStepDifference(values) { + var currentValues = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + + return (0, _utils.length)(values.min, currentValues.min) >= this.props.step || (0, _utils.length)(values.max, currentValues.max) >= this.props.step; + } + + /** + * Return true if the component accepts a min and max value + * @private + * @return {boolean} + */ + + }, { + key: 'isMultiValue', + value: function isMultiValue() { + return (0, _utils.isObject)(this.props.value); + } + + /** + * Return true if the range is within the max and min value of the component + * @private + * @param {Range} values + * @return {boolean} + */ + + }, { + key: 'isWithinRange', + value: function isWithinRange(values) { + if (this.isMultiValue()) { + return values.min >= this.props.minValue && values.max <= this.props.maxValue && this.props.allowSameValues ? values.min <= values.max : values.min < values.max; + } + + return values.max >= this.props.minValue && values.max <= this.props.maxValue; + } + + /** + * Return true if the new value should trigger a render + * @private + * @param {Range} values + * @return {boolean} + */ + + }, { + key: 'shouldUpdate', + value: function shouldUpdate(values) { + return this.isWithinRange(values) && this.hasStepDifference(values); + } + + /** + * Update the position of a slider + * @private + * @param {string} key + * @param {Point} position + * @return {void} + */ + + }, { + key: 'updatePosition', + value: function updatePosition(key, position) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect()); + + positions[key] = position; + this.lastKeyMoved = key; + + this.updatePositions(positions); + } + + /** + * Update the positions of multiple sliders + * @private + * @param {Object} positions + * @param {Point} positions.min + * @param {Point} positions.max + * @return {void} + */ + + }, { + key: 'updatePositions', + value: function updatePositions(positions) { + var values = { + min: valueTransformer.getValueFromPosition(positions.min, this.props.minValue, this.props.maxValue, this.getTrackClientRect()), + max: valueTransformer.getValueFromPosition(positions.max, this.props.minValue, this.props.maxValue, this.getTrackClientRect()) + }; + + var transformedValues = { + min: valueTransformer.getStepValueFromValue(values.min, this.props.step), + max: valueTransformer.getStepValueFromValue(values.max, this.props.step) + }; + + this.updateValues(transformedValues); + } + + /** + * Update the value of a slider + * @private + * @param {string} key + * @param {number} value + * @return {void} + */ + + }, { + key: 'updateValue', + value: function updateValue(key, value) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + + values[key] = value; + + this.updateValues(values); + } + + /** + * Update the values of multiple sliders + * @private + * @param {Range|number} values + * @return {void} + */ + + }, { + key: 'updateValues', + value: function updateValues(values) { + if (!this.shouldUpdate(values)) { + return; + } + + this.props.onChange(this.isMultiValue() ? values : values.max); + } + + /** + * Increment the value of a slider by key name + * @private + * @param {string} key + * @return {void} + */ + + }, { + key: 'incrementValue', + value: function incrementValue(key) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var value = values[key] + this.props.step; + + this.updateValue(key, value); + } + + /** + * Decrement the value of a slider by key name + * @private + * @param {string} key + * @return {void} + */ + + }, { + key: 'decrementValue', + value: function decrementValue(key) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var value = values[key] - this.props.step; + + this.updateValue(key, value); + } + + /** + * Listen to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseUpListener', + value: function addDocumentMouseUpListener() { + this.removeDocumentMouseUpListener(); + this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp); + } + + /** + * Listen to touchend event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentTouchEndListener', + value: function addDocumentTouchEndListener() { + this.removeDocumentTouchEndListener(); + this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd); + } + + /** + * Stop listening to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseUpListener', + value: function removeDocumentMouseUpListener() { + this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + } + + /** + * Stop listening to touchend event + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentTouchEndListener', + value: function removeDocumentTouchEndListener() { + this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd); + } + + /** + * Handle any "mousemove" event received by the slider + * @private + * @param {SyntheticEvent} event + * @param {string} key + * @return {void} + */ + + }, { + key: 'handleSliderDrag', + value: function handleSliderDrag(event, key) { + var _this2 = this; + + if (this.props.disabled) { + return; + } + + var position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect()); + this.isSliderDragging = true; + requestAnimationFrame(function () { + return _this2.updatePosition(key, position); + }); + } + + /** + * Handle any "mousemove" event received by the track + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleTrackDrag', + value: function handleTrackDrag(event, prevEvent) { + if (this.props.disabled || !this.props.draggableTrack || this.isSliderDragging) { + return; + } + + var _props2 = this.props, + maxValue = _props2.maxValue, + minValue = _props2.minValue, + _props2$value = _props2.value, + max = _props2$value.max, + min = _props2$value.min; + + + var position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect()); + var value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect()); + var stepValue = valueTransformer.getStepValueFromValue(value, this.props.step); + + var prevPosition = valueTransformer.getPositionFromEvent(prevEvent, this.getTrackClientRect()); + var prevValue = valueTransformer.getValueFromPosition(prevPosition, minValue, maxValue, this.getTrackClientRect()); + var prevStepValue = valueTransformer.getStepValueFromValue(prevValue, this.props.step); + + var offset = prevStepValue - stepValue; + + var transformedValues = { + min: min - offset, + max: max - offset + }; + + this.updateValues(transformedValues); + } + + /** + * Handle any "keydown" event received by the slider + * @private + * @param {SyntheticEvent} event + * @param {string} key + * @return {void} + */ + + }, { + key: 'handleSliderKeyDown', + value: function handleSliderKeyDown(event, key) { + if (this.props.disabled) { + return; + } + + switch (event.keyCode) { + case _keyCodes.LEFT_ARROW: + case _keyCodes.DOWN_ARROW: + event.preventDefault(); + this.decrementValue(key); + break; + + case _keyCodes.RIGHT_ARROW: + case _keyCodes.UP_ARROW: + event.preventDefault(); + this.incrementValue(key); + break; + + default: + break; + } + } + + /** + * Handle any "mousedown" event received by the track + * @private + * @param {SyntheticEvent} event + * @param {Point} position + * @return {void} + */ + + }, { + key: 'handleTrackMouseDown', + value: function handleTrackMouseDown(event, position) { + if (this.props.disabled) { + return; + } + + var _props3 = this.props, + maxValue = _props3.maxValue, + minValue = _props3.minValue, + _props3$value = _props3.value, + max = _props3$value.max, + min = _props3$value.min; + + + event.preventDefault(); + + var value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect()); + var stepValue = valueTransformer.getStepValueFromValue(value, this.props.step); + + if (!this.props.draggableTrack || stepValue > max || stepValue < min) { + this.updatePosition(this.getKeyByPosition(position), position); + } + } + + /** + * Handle the start of any mouse/touch event + * @private + * @return {void} + */ + + }, { + key: 'handleInteractionStart', + value: function handleInteractionStart() { + if (this.props.onChangeStart) { + this.props.onChangeStart(this.props.value); + } + + if (this.props.onChangeComplete && !(0, _utils.isDefined)(this.startValue)) { + this.startValue = this.props.value; + } + } + + /** + * Handle the end of any mouse/touch event + * @private + * @return {void} + */ + + }, { + key: 'handleInteractionEnd', + value: function handleInteractionEnd() { + if (this.isSliderDragging) { + this.isSliderDragging = false; + } + + if (!this.props.onChangeComplete || !(0, _utils.isDefined)(this.startValue)) { + return; + } + + if (this.startValue !== this.props.value) { + this.props.onChangeComplete(this.props.value); + } + + this.startValue = null; + } + + /** + * Handle any "keydown" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleKeyDown', + value: function handleKeyDown(event) { + this.handleInteractionStart(event); + } + + /** + * Handle any "keyup" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleKeyUp', + value: function handleKeyUp(event) { + this.handleInteractionEnd(event); + } + + /** + * Handle any "mousedown" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleMouseDown', + value: function handleMouseDown(event) { + this.handleInteractionStart(event); + this.addDocumentMouseUpListener(); + } + + /** + * Handle any "mouseup" event received by the component + * @private + * @param {SyntheticEvent} event + */ + + }, { + key: 'handleMouseUp', + value: function handleMouseUp(event) { + this.handleInteractionEnd(event); + this.removeDocumentMouseUpListener(); + } + + /** + * Handle any "touchstart" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleTouchStart', + value: function handleTouchStart(event) { + this.handleInteractionStart(event); + this.addDocumentTouchEndListener(); + } + + /** + * Handle any "touchend" event received by the component + * @private + * @param {SyntheticEvent} event + */ + + }, { + key: 'handleTouchEnd', + value: function handleTouchEnd(event) { + this.handleInteractionEnd(event); + this.removeDocumentTouchEndListener(); + } + + /** + * Return JSX of sliders + * @private + * @return {JSX.Element} + */ + + }, { + key: 'renderSliders', + value: function renderSliders() { + var _this3 = this; + + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue); + var keys = this.props.allowSameValues && this.lastKeyMoved === 'min' ? this.getKeys().reverse() : this.getKeys(); + + return keys.map(function (key) { + var value = values[key]; + var percentage = percentages[key]; + + var _props4 = _this3.props, + maxValue = _props4.maxValue, + minValue = _props4.minValue; + + + if (key === 'min') { + maxValue = values.max; + } else { + minValue = values.min; + } + + var slider = _react2.default.createElement(_slider2.default, { + ariaLabelledby: _this3.props.ariaLabelledby, + ariaControls: _this3.props.ariaControls, + classNames: _this3.props.classNames, + formatLabel: _this3.props.formatLabel, + key: key, + maxValue: maxValue, + minValue: minValue, + onSliderDrag: _this3.handleSliderDrag, + onSliderKeyDown: _this3.handleSliderKeyDown, + percentage: percentage, + type: key, + value: value }); + + return slider; + }); + } + + /** + * Return JSX of hidden inputs + * @private + * @return {JSX.Element} + */ + + }, { + key: 'renderHiddenInputs', + value: function renderHiddenInputs() { + var _this4 = this; + + if (!this.props.name) { + return []; + } + + var isMultiValue = this.isMultiValue(); + var values = valueTransformer.getValueFromProps(this.props, isMultiValue); + + return this.getKeys().map(function (key) { + var value = values[key]; + var name = isMultiValue ? '' + _this4.props.name + (0, _utils.captialize)(key) : _this4.props.name; + + return _react2.default.createElement('input', { key: key, type: 'hidden', name: name, value: value }); + }); + } + + /** + * @ignore + * @override + * @return {JSX.Element} + */ + + }, { + key: 'render', + value: function render() { + var _this5 = this; + + var componentClassName = this.getComponentClassName(); + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue); + + var fstLabelVal = 0; + var sndLabelVal = 0; + var thdLabelVal = 0; + var fstLabelStyle = {}; + var sndLabelStyle = {}; + var thdLabelStyle = {}; + + if (this.props.renderSubLabels) { + fstLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 1 + this.props.minValue; + sndLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 2 + this.props.minValue; + thdLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 3 + this.props.minValue; + + fstLabelStyle = this.getStyle(fstLabelVal); + sndLabelStyle = this.getStyle(sndLabelVal); + thdLabelStyle = this.getStyle(thdLabelVal); + } + + var inactiveSeqValues = []; + var inactiveSeq = null; + if ((0, _utils.isNumber)(this.props.value)) { + for (var i = this.props.value; i < this.props.maxValue; i++) { + inactiveSeqValues.push(i); + } + inactiveSeq = inactiveSeqValues.map(function (value) { + var style = _this5.getStyle(value); + return _react2.default.createElement('div', { key: value, style: style, className: _this5.props.classNames.inactiveCircleLabel }); + }); + } + + return _react2.default.createElement( + 'div', + { + 'aria-disabled': this.props.disabled, + ref: function ref(node) { + _this5.node = node; + }, + className: componentClassName, + onKeyDown: this.handleKeyDown, + onKeyUp: this.handleKeyUp, + onMouseDown: this.handleMouseDown, + onTouchStart: this.handleTouchStart }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'min' }, + this.props.minValue + ), + this.props.renderSubLabels && _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'span', + { style: fstLabelStyle, className: this.props.classNames.sublabel }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'fst' }, + fstLabelVal + ) + ), + _react2.default.createElement( + 'span', + { style: sndLabelStyle, className: this.props.classNames.sublabel }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + style: sndLabelStyle, + type: 'snd' }, + sndLabelVal + ) + ), + _react2.default.createElement( + 'span', + { style: thdLabelStyle, className: this.props.classNames.sublabel }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + style: thdLabelStyle, + type: 'thd' }, + thdLabelVal + ) + ) + ), + _react2.default.createElement( + _track2.default, + { + classNames: this.props.classNames, + draggableTrack: this.props.draggableTrack, + ref: function ref(trackNode) { + _this5.trackNode = trackNode; + }, + percentages: percentages, + onTrackDrag: this.handleTrackDrag, + onTrackMouseDown: this.handleTrackMouseDown }, + this.renderSliders() + ), + (0, _utils.isNumber)(this.props.value) && _react2.default.createElement( + 'div', + { className: 'InactiveCircleLabels' }, + inactiveSeq + ), + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'max' }, + this.props.maxValue + ), + this.renderHiddenInputs() + ); + } + }]); + + return InputRange; +}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleSliderDrag', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleSliderDrag'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTrackDrag', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTrackDrag'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleSliderKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleSliderKeyDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTrackMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTrackMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleInteractionStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleInteractionStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleInteractionEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleInteractionEnd'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchEnd'), _class.prototype)), _class); +exports.default = InputRange; +module.exports = exports['default']; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inputRange = __webpack_require__(10); + +var _inputRange2 = _interopRequireDefault(_inputRange); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @ignore + * @typedef {Object} ClientRect + * @property {number} height + * @property {number} left + * @property {number} top + * @property {number} width + */ + +/** + * @typedef {Object} InputRangeClassNames + * @property {string} activeTrack + * @property {string} disabledInputRange + * @property {string} inputRange + * @property {string} labelContainer + * @property {string} maxLabel + * @property {string} minLabel + * @property {string} slider + * @property {string} sliderContainer + * @property {string} track + * @property {string} valueLabel + */ + +/** + * @typedef {Function} LabelFormatter + * @param {number} value + * @param {string} type + * @return {string} + */ + +/** + * @ignore + * @typedef {Object} Point + * @property {number} x + * @property {number} y + */ + +/** + * @typedef {Object} Range + * @property {number} min - Min value + * @property {number} max - Max value + */ + +exports.default = _inputRange2.default; +module.exports = exports['default']; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Default CSS class names + * @ignore + * @type {InputRangeClassNames} + */ +var DEFAULT_CLASS_NAMES = { + 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', + fstLabel: 'input-range__label input-range__label--fst', + sndLabel: 'input-range__label input-range__label--snd', + thdLabel: 'input-range__label input-range__label--thd', + sublabel: 'input-range__label--sublabel', + inactiveCircleLabel: 'input-range__label--inactive', + 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' +}; + +exports.default = DEFAULT_CLASS_NAMES; +module.exports = exports['default']; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** @ignore */ +var DOWN_ARROW = exports.DOWN_ARROW = 40; + +/** @ignore */ +var LEFT_ARROW = exports.LEFT_ARROW = 37; + +/** @ignore */ +var RIGHT_ARROW = exports.RIGHT_ARROW = 39; + +/** @ignore */ +var UP_ARROW = exports.UP_ARROW = 38; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rangePropType; + +var _utils = __webpack_require__(1); + +/** + * @ignore + * @param {Object} props - React component props + * @return {?Error} Return Error if validation fails + */ +function rangePropType(props) { + var maxValue = props.maxValue, + minValue = props.minValue; + + + if (!(0, _utils.isNumber)(minValue) || !(0, _utils.isNumber)(maxValue)) { + return new Error('"minValue" and "maxValue" must be a number'); + } + + if (minValue >= maxValue) { + return new Error('"minValue" must be smaller than "maxValue"'); + } +} +module.exports = exports['default']; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _desc, _value, _class; + +var _react = __webpack_require__(3); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(2); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _autobindDecorator = __webpack_require__(4); + +var _autobindDecorator2 = _interopRequireDefault(_autobindDecorator); + +var _label = __webpack_require__(7); + +var _label2 = _interopRequireDefault(_label); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; +} + +/** + * @ignore + */ +var Slider = (_class = function (_React$Component) { + _inherits(Slider, _React$Component); + + _createClass(Slider, null, [{ + key: 'propTypes', + + /** + * Accepted propTypes of Slider + * @override + * @return {Object} + * @property {Function} ariaLabelledby + * @property {Function} ariaControls + * @property {Function} className + * @property {Function} formatLabel + * @property {Function} maxValue + * @property {Function} minValue + * @property {Function} onSliderDrag + * @property {Function} onSliderKeyDown + * @property {Function} percentage + * @property {Function} type + * @property {Function} value + */ + get: function get() { + return { + ariaLabelledby: _propTypes2.default.string, + ariaControls: _propTypes2.default.string, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired, + formatLabel: _propTypes2.default.func, + maxValue: _propTypes2.default.number, + minValue: _propTypes2.default.number, + onSliderDrag: _propTypes2.default.func.isRequired, + onSliderKeyDown: _propTypes2.default.func.isRequired, + percentage: _propTypes2.default.number.isRequired, + type: _propTypes2.default.string.isRequired, + value: _propTypes2.default.number.isRequired + }; + } + + /** + * @param {Object} props + * @param {string} [props.ariaLabelledby] + * @param {string} [props.ariaControls] + * @param {InputRangeClassNames} props.classNames + * @param {Function} [props.formatLabel] + * @param {number} [props.maxValue] + * @param {number} [props.minValue] + * @param {Function} props.onSliderKeyDown + * @param {Function} props.onSliderDrag + * @param {number} props.percentage + * @param {number} props.type + * @param {number} props.value + */ + + }]); + + function Slider(props) { + _classCallCheck(this, Slider); + + /** + * @private + * @type {?Component} + */ + var _this = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, props)); + + _this.node = null; + return _this; + } + + /** + * @ignore + * @override + * @return {void} + */ + + + _createClass(Slider, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.removeDocumentMouseMoveListener(); + this.removeDocumentMouseUpListener(); + this.removeDocumentTouchEndListener(); + this.removeDocumentTouchMoveListener(); + } + + /** + * @private + * @return {Object} + */ + + }, { + key: 'getStyle', + value: function getStyle() { + var perc = (this.props.percentage || 0) * 100; + var style = { + position: 'absolute', + left: perc + '%' + }; + + return style; + } + + /** + * Listen to mousemove event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseMoveListener', + value: function addDocumentMouseMoveListener() { + this.removeDocumentMouseMoveListener(); + this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove); + } + + /** + * Listen to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseUpListener', + value: function addDocumentMouseUpListener() { + this.removeDocumentMouseUpListener(); + this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp); + } + + /** + * Listen to touchmove event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentTouchMoveListener', + value: function addDocumentTouchMoveListener() { + this.removeDocumentTouchMoveListener(); + this.node.ownerDocument.addEventListener('touchmove', this.handleTouchMove); + } + + /** + * Listen to touchend event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentTouchEndListener', + value: function addDocumentTouchEndListener() { + this.removeDocumentTouchEndListener(); + this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseMoveListener', + value: function removeDocumentMouseMoveListener() { + this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseUpListener', + value: function removeDocumentMouseUpListener() { + this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentTouchMoveListener', + value: function removeDocumentTouchMoveListener() { + this.node.ownerDocument.removeEventListener('touchmove', this.handleTouchMove); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentTouchEndListener', + value: function removeDocumentTouchEndListener() { + this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleMouseDown', + value: function handleMouseDown() { + this.addDocumentMouseMoveListener(); + this.addDocumentMouseUpListener(); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleMouseUp', + value: function handleMouseUp() { + this.removeDocumentMouseMoveListener(); + this.removeDocumentMouseUpListener(); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleMouseMove', + value: function handleMouseMove(event) { + this.props.onSliderDrag(event, this.props.type); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleTouchStart', + value: function handleTouchStart() { + this.addDocumentTouchEndListener(); + this.addDocumentTouchMoveListener(); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleTouchMove', + value: function handleTouchMove(event) { + this.props.onSliderDrag(event, this.props.type); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleTouchEnd', + value: function handleTouchEnd() { + this.removeDocumentTouchMoveListener(); + this.removeDocumentTouchEndListener(); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleKeyDown', + value: function handleKeyDown(event) { + this.props.onSliderKeyDown(event, this.props.type); + } + + /** + * @override + * @return {JSX.Element} + */ + + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var style = this.getStyle(); + + return _react2.default.createElement( + 'span', + { + className: this.props.classNames.sliderContainer, + ref: function ref(node) { + _this2.node = node; + }, + style: style }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'value' }, + this.props.value + ), + _react2.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' }) + ); + } + }]); + + return Slider; +}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchEnd'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyDown'), _class.prototype)), _class); +exports.default = Slider; +module.exports = exports['default']; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _desc, _value, _class; + +var _react = __webpack_require__(3); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = __webpack_require__(2); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _autobindDecorator = __webpack_require__(4); + +var _autobindDecorator2 = _interopRequireDefault(_autobindDecorator); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; +} + +/** + * @ignore + */ +var Track = (_class = function (_React$Component) { + _inherits(Track, _React$Component); + + _createClass(Track, null, [{ + key: 'propTypes', + + /** + * @override + * @return {Object} + * @property {Function} children + * @property {Function} classNames + * @property {Boolean} draggableTrack + * @property {Function} onTrackDrag + * @property {Function} onTrackMouseDown + * @property {Function} percentages + */ + get: function get() { + return { + children: _propTypes2.default.node.isRequired, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired, + draggableTrack: _propTypes2.default.bool, + onTrackDrag: _propTypes2.default.func, + onTrackMouseDown: _propTypes2.default.func.isRequired, + percentages: _propTypes2.default.objectOf(_propTypes2.default.number).isRequired + }; + } + + /** + * @param {Object} props + * @param {InputRangeClassNames} props.classNames + * @param {Boolean} props.draggableTrack + * @param {Function} props.onTrackDrag + * @param {Function} props.onTrackMouseDown + * @param {number} props.percentages + */ + + }]); + + function Track(props) { + _classCallCheck(this, Track); + + /** + * @private + * @type {?Component} + */ + var _this = _possibleConstructorReturn(this, (Track.__proto__ || Object.getPrototypeOf(Track)).call(this, props)); + + _this.node = null; + _this.trackDragEvent = null; + return _this; + } + + /** + * @private + * @return {ClientRect} + */ + + + _createClass(Track, [{ + key: 'getClientRect', + value: function getClientRect() { + return this.node.getBoundingClientRect(); + } + + /** + * @private + * @return {Object} CSS styles + */ + + }, { + key: 'getActiveTrackStyle', + value: function getActiveTrackStyle() { + var width = (this.props.percentages.max - this.props.percentages.min) * 100 + '%'; + var left = this.props.percentages.min * 100 + '%'; + + return { left: left, width: width }; + } + + /** + * Listen to mousemove event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseMoveListener', + value: function addDocumentMouseMoveListener() { + this.removeDocumentMouseMoveListener(); + this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove); + } + + /** + * Listen to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseUpListener', + value: function addDocumentMouseUpListener() { + this.removeDocumentMouseUpListener(); + this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseMoveListener', + value: function removeDocumentMouseMoveListener() { + this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseUpListener', + value: function removeDocumentMouseUpListener() { + this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleMouseMove', + value: function handleMouseMove(event) { + if (!this.props.draggableTrack) { + return; + } + + if (this.trackDragEvent !== null) { + this.props.onTrackDrag(event, this.trackDragEvent); + } + + this.trackDragEvent = event; + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleMouseUp', + value: function handleMouseUp() { + if (!this.props.draggableTrack) { + return; + } + + this.removeDocumentMouseMoveListener(); + this.removeDocumentMouseUpListener(); + this.trackDragEvent = null; + } + + /** + * @private + * @param {SyntheticEvent} event - User event + */ + + }, { + key: 'handleMouseDown', + value: function handleMouseDown(event) { + var clientX = event.touches ? event.touches[0].clientX : event.clientX; + var trackClientRect = this.getClientRect(); + var position = { + x: clientX - trackClientRect.left, + y: 0 + }; + + this.props.onTrackMouseDown(event, position); + + if (this.props.draggableTrack) { + this.addDocumentMouseMoveListener(); + this.addDocumentMouseUpListener(); + } + } + + /** + * @private + * @param {SyntheticEvent} event - User event + */ + + }, { + key: 'handleTouchStart', + value: function handleTouchStart(event) { + event.preventDefault(); + + this.handleMouseDown(event); + } + + /** + * @override + * @return {JSX.Element} + */ + + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var activeTrackStyle = this.getActiveTrackStyle(); + + return _react2.default.createElement( + 'div', + { + className: this.props.classNames.track, + onMouseDown: this.handleMouseDown, + onTouchStart: this.handleTouchStart, + ref: function ref(node) { + _this2.node = node; + } }, + _react2.default.createElement('div', { + style: activeTrackStyle, + className: this.props.classNames.activeTrack }), + this.props.children + ); + } + }]); + + return Track; +}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleMouseMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype)), _class); +exports.default = Track; +module.exports = exports['default']; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = valuePropType; + +var _utils = __webpack_require__(1); + +/** + * @ignore + * @param {Object} props + * @return {?Error} Return Error if validation fails + */ +function valuePropType(props, propName) { + var maxValue = props.maxValue, + minValue = props.minValue; + + var value = props[propName]; + + if (!(0, _utils.isNumber)(value) && (!(0, _utils.isObject)(value) || !(0, _utils.isNumber)(value.min) || !(0, _utils.isNumber)(value.max))) { + return new Error('"' + propName + '" must be a number or a range object'); + } + + if ((0, _utils.isNumber)(value) && (value < minValue || value > maxValue)) { + return new Error('"' + propName + '" must be in between "minValue" and "maxValue"'); + } + + if ((0, _utils.isObject)(value) && (value.min < minValue || value.min > maxValue || value.max < minValue || value.max > maxValue)) { + return new Error('"' + propName + '" must be in between "minValue" and "maxValue"'); + } +} +module.exports = exports['default']; + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +exports.getPercentageFromPosition = getPercentageFromPosition; +exports.getValueFromPosition = getValueFromPosition; +exports.getValueFromProps = getValueFromProps; +exports.getPercentageFromValue = getPercentageFromValue; +exports.getPercentagesFromValues = getPercentagesFromValues; +exports.getPositionFromValue = getPositionFromValue; +exports.getPositionsFromValues = getPositionsFromValues; +exports.getPositionFromEvent = getPositionFromEvent; +exports.getStepValueFromValue = getStepValueFromValue; + +var _utils = __webpack_require__(1); + +/** + * Convert a point into a percentage value + * @ignore + * @param {Point} position + * @param {ClientRect} clientRect + * @return {number} Percentage value + */ +function getPercentageFromPosition(position, clientRect) { + var length = clientRect.width; + var sizePerc = position.x / length; + + return sizePerc || 0; +} + +/** + * Convert a point into a model value + * @ignore + * @param {Point} position + * @param {number} minValue + * @param {number} maxValue + * @param {ClientRect} clientRect + * @return {number} + */ +function getValueFromPosition(position, minValue, maxValue, clientRect) { + var sizePerc = getPercentageFromPosition(position, clientRect); + var valueDiff = maxValue - minValue; + + return minValue + valueDiff * sizePerc; +} + +/** + * Convert props into a range value + * @ignore + * @param {Object} props + * @param {boolean} isMultiValue + * @return {Range} + */ +function getValueFromProps(props, isMultiValue) { + if (isMultiValue) { + return _extends({}, props.value); + } + + return { + min: props.minValue, + max: props.value + }; +} + +/** + * Convert a model value into a percentage value + * @ignore + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @return {number} + */ +function getPercentageFromValue(value, minValue, maxValue) { + var validValue = (0, _utils.clamp)(value, minValue, maxValue); + var valueDiff = maxValue - minValue; + var valuePerc = (validValue - minValue) / valueDiff; + + return valuePerc || 0; +} + +/** + * Convert model values into percentage values + * @ignore + * @param {Range} values + * @param {number} minValue + * @param {number} maxValue + * @return {Range} + */ +function getPercentagesFromValues(values, minValue, maxValue) { + return { + min: getPercentageFromValue(values.min, minValue, maxValue), + max: getPercentageFromValue(values.max, minValue, maxValue) + }; +} + +/** + * Convert a value into a point + * @ignore + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @param {ClientRect} clientRect + * @return {Point} Position + */ +function getPositionFromValue(value, minValue, maxValue, clientRect) { + var length = clientRect.width; + var valuePerc = getPercentageFromValue(value, minValue, maxValue); + var positionValue = valuePerc * length; + + return { + x: positionValue, + y: 0 + }; +} + +/** + * Convert a range of values into points + * @ignore + * @param {Range} values + * @param {number} minValue + * @param {number} maxValue + * @param {ClientRect} clientRect + * @return {Range} + */ +function getPositionsFromValues(values, minValue, maxValue, clientRect) { + return { + min: getPositionFromValue(values.min, minValue, maxValue, clientRect), + max: getPositionFromValue(values.max, minValue, maxValue, clientRect) + }; +} + +/** + * Convert an event into a point + * @ignore + * @param {Event} event + * @param {ClientRect} clientRect + * @return {Point} + */ +function getPositionFromEvent(event, clientRect) { + var length = clientRect.width; + + var _ref = event.touches ? event.touches[0] : event, + clientX = _ref.clientX; + + return { + x: (0, _utils.clamp)(clientX - clientRect.left, 0, length), + y: 0 + }; +} + +/** + * Convert a value into a step value + * @ignore + * @param {number} value + * @param {number} valuePerStep + * @return {number} + */ +function getStepValueFromValue(value, valuePerStep) { + return Math.round(value / valuePerStep) * valuePerStep; +} + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = captialize; +/** + * Captialize a string + * @ignore + * @param {string} string + * @return {string} + */ +function captialize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} +module.exports = exports["default"]; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = clamp; +/** + * Clamp a value between a min and max value + * @ignore + * @param {number} value + * @param {number} min + * @param {number} max + * @return {number} + */ +function clamp(value, min, max) { + return Math.min(Math.max(value, min), max); +} +module.exports = exports["default"]; + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = distanceTo; +/** + * Calculate the distance between pointA and pointB + * @ignore + * @param {Point} pointA + * @param {Point} pointB + * @return {number} Distance + */ +function distanceTo(pointA, pointB) { + var xDiff = Math.pow(pointB.x - pointA.x, 2); + var yDiff = Math.pow(pointB.y - pointA.y, 2); + + return Math.sqrt(xDiff + yDiff); +} +module.exports = exports["default"]; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isDefined; +/** + * Check if a value is defined + * @ignore + * @param {*} value + * @return {boolean} + */ +function isDefined(value) { + return value !== undefined && value !== null; +} +module.exports = exports["default"]; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isNumber; +/** + * Check if a value is a number + * @ignore + * @param {*} value + * @return {boolean} + */ +function isNumber(value) { + return typeof value === 'number'; +} +module.exports = exports['default']; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +exports.default = isObject; +/** + * Check if a value is an object + * @ignore + * @param {*} value + * @return {boolean} + */ +function isObject(value) { + return value !== null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object'; +} +module.exports = exports['default']; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = length; +/** + * Calculate the absolute difference between two numbers + * @ignore + * @param {number} numA + * @param {number} numB + * @return {number} + */ +function length(numA, numB) { + return Math.abs(numA - numB); +} +module.exports = exports["default"]; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +if (process.env.NODE_ENV !== 'production') { + var invariant = __webpack_require__(6); + var warning = __webpack_require__(8); + var ReactPropTypesSecret = __webpack_require__(9); + var loggedTypeFailures = {}; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } +} + +module.exports = checkPropTypes; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +var emptyFunction = __webpack_require__(5); +var invariant = __webpack_require__(6); + +module.exports = function() { + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + function shim() { + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + + +var emptyFunction = __webpack_require__(5); +var invariant = __webpack_require__(6); +var warning = __webpack_require__(8); + +var ReactPropTypesSecret = __webpack_require__(9); +var checkPropTypes = __webpack_require__(26); + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }) +/******/ ]); +}); +//# sourceMappingURL=react-input-range.js.map \ No newline at end of file diff --git a/lib/bundle/react-input-range.js.map b/lib/bundle/react-input-range.js.map new file mode 100644 index 0000000..5da9449 --- /dev/null +++ b/lib/bundle/react-input-range.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 238432aff56508ce40b6","webpack:///./~/process/browser.js","webpack:///./src/js/utils/index.js","webpack:///./~/prop-types/index.js","webpack:///external {\"amd\":\"react\",\"commonjs\":\"react\",\"commonjs2\":\"react\",\"root\":\"React\"}","webpack:///./~/autobind-decorator/lib/index.js","webpack:///./~/fbjs/lib/emptyFunction.js","webpack:///./~/fbjs/lib/invariant.js","webpack:///./src/js/input-range/label.jsx","webpack:///./~/fbjs/lib/warning.js","webpack:///./~/prop-types/lib/ReactPropTypesSecret.js","webpack:///./src/js/input-range/input-range.jsx","webpack:///./src/js/index.js","webpack:///./src/js/input-range/default-class-names.js","webpack:///./src/js/input-range/key-codes.js","webpack:///./src/js/input-range/range-prop-type.js","webpack:///./src/js/input-range/slider.jsx","webpack:///./src/js/input-range/track.jsx","webpack:///./src/js/input-range/value-prop-type.js","webpack:///./src/js/input-range/value-transformer.js","webpack:///./src/js/utils/captialize.js","webpack:///./src/js/utils/clamp.js","webpack:///./src/js/utils/distance-to.js","webpack:///./src/js/utils/is-defined.js","webpack:///./src/js/utils/is-number.js","webpack:///./src/js/utils/is-object.js","webpack:///./src/js/utils/length.js","webpack:///./~/prop-types/checkPropTypes.js","webpack:///./~/prop-types/factoryWithThrowingShims.js","webpack:///./~/prop-types/factoryWithTypeCheckers.js"],"names":["default","Label","props","labelValue","formatLabel","children","type","classNames","labelContainer","propTypes","node","isRequired","objectOf","string","func","valueTransformer","InputRange","allowSameValues","bool","ariaLabelledby","ariaControls","disabled","draggableTrack","maxValue","minValue","name","onChangeStart","onChange","onChangeComplete","step","number","value","renderSubLabels","startValue","trackNode","isSliderDragging","lastKeyMoved","removeDocumentMouseUpListener","removeDocumentTouchEndListener","inputRange","disabledInputRange","getClientRect","position","values","getValueFromProps","isMultiValue","positions","getPositionsFromValues","getTrackClientRect","distanceToMin","min","distanceToMax","max","val","perc","style","left","currentValues","isWithinRange","hasStepDifference","key","updatePositions","getValueFromPosition","transformedValues","getStepValueFromValue","updateValues","shouldUpdate","updateValue","ownerDocument","addEventListener","handleMouseUp","handleTouchEnd","removeEventListener","event","getPositionFromEvent","requestAnimationFrame","updatePosition","prevEvent","stepValue","prevPosition","prevValue","prevStepValue","offset","keyCode","preventDefault","decrementValue","incrementValue","getKeyByPosition","handleInteractionStart","handleInteractionEnd","addDocumentMouseUpListener","addDocumentTouchEndListener","percentages","getPercentagesFromValues","keys","getKeys","reverse","map","percentage","slider","handleSliderDrag","handleSliderKeyDown","componentClassName","getComponentClassName","fstLabelVal","sndLabelVal","thdLabelVal","fstLabelStyle","sndLabelStyle","thdLabelStyle","Math","round","getStyle","inactiveSeqValues","inactiveSeq","i","push","inactiveCircleLabel","handleKeyDown","handleKeyUp","handleMouseDown","handleTouchStart","sublabel","handleTrackDrag","handleTrackMouseDown","renderSliders","renderHiddenInputs","Component","DEFAULT_CLASS_NAMES","activeTrack","maxLabel","minLabel","fstLabel","sndLabel","thdLabel","sliderContainer","track","valueLabel","DOWN_ARROW","LEFT_ARROW","RIGHT_ARROW","UP_ARROW","rangePropType","Error","Slider","onSliderDrag","onSliderKeyDown","removeDocumentMouseMoveListener","removeDocumentTouchMoveListener","handleMouseMove","handleTouchMove","addDocumentMouseMoveListener","addDocumentTouchMoveListener","Track","onTrackDrag","onTrackMouseDown","trackDragEvent","getBoundingClientRect","width","clientX","touches","trackClientRect","x","y","activeTrackStyle","getActiveTrackStyle","valuePropType","propName","getPercentageFromPosition","getPercentageFromValue","getPositionFromValue","clientRect","length","sizePerc","valueDiff","validValue","valuePerc","positionValue","valuePerStep","captialize","charAt","toUpperCase","slice","clamp","distanceTo","pointA","pointB","xDiff","yDiff","sqrt","isDefined","undefined","isNumber","isObject","numA","numB","abs"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AChEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;;;;;;;+CCnL7BA,O;;;;;;;;;0CACAA,O;;;;;;;;;+CACAA,O;;;;;;;;;8CACAA,O;;;;;;;;;6CACAA,O;;;;;;;;;6CACAA,O;;;;;;;;;2CACAA,O;;;;;;;;;;ACNT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;;;;;;;AC7BA,+C;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;AAEA;AACA,iEAAiE,aAAa;AAC9E;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+B;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;A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;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B;AAC7B,QAAQ;AACR;AACA;AACA;AACA;AACA,+BAA+B,KAAK;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,4BAA4B;AAC5B,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,gCAAgC;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA","file":"react-input-range.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"InputRange\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"InputRange\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 238432aff56508ce40b6","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 0\n// module chunks = 0 1","export { default as captialize } from './captialize';\nexport { default as clamp } from './clamp';\nexport { default as distanceTo } from './distance-to';\nexport { default as isDefined } from './is-defined';\nexport { default as isNumber } from './is-number';\nexport { default as isObject } from './is-object';\nexport { default as length } from './length';\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/index.js","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 2\n// module chunks = 0 1","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"react\",\"commonjs\":\"react\",\"commonjs2\":\"react\",\"root\":\"React\"}\n// module id = 3\n// module chunks = 0 1","/**\n * @copyright 2015, Andrey Popp <8mayday@gmail.com>\n *\n * The decorator may be used on classes or methods\n * ```\n * @autobind\n * class FullBound {}\n *\n * class PartBound {\n * @autobind\n * method () {}\n * }\n * ```\n */\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports['default'] = autobind;\n\nfunction autobind() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 1) {\n return boundClass.apply(undefined, args);\n } else {\n return boundMethod.apply(undefined, args);\n }\n}\n\n/**\n * Use boundMethod to bind all methods on the target.prototype\n */\nfunction boundClass(target) {\n // (Using reflect to get all keys including symbols)\n var keys = undefined;\n // Use Reflect if exists\n if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') {\n keys = Reflect.ownKeys(target.prototype);\n } else {\n keys = Object.getOwnPropertyNames(target.prototype);\n // use symbols if support is provided\n if (typeof Object.getOwnPropertySymbols === 'function') {\n keys = keys.concat(Object.getOwnPropertySymbols(target.prototype));\n }\n }\n\n keys.forEach(function (key) {\n // Ignore special case target method\n if (key === 'constructor') {\n return;\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(target.prototype, key);\n\n // Only methods need binding\n if (typeof descriptor.value === 'function') {\n Object.defineProperty(target.prototype, key, boundMethod(target, key, descriptor));\n }\n });\n return target;\n}\n\n/**\n * Return a descriptor removing the value and returning a getter\n * The getter will return a .bind version of the function\n * and memoize the result against a symbol on the instance\n */\nfunction boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn);\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n definingProperty = false;\n return boundFn;\n }\n };\n}\nmodule.exports = exports['default'];\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/autobind-decorator/lib/index.js\n// module id = 4\n// module chunks = 0 1","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyFunction.js\n// module id = 5\n// module chunks = 0 1","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/invariant.js\n// module id = 6\n// module chunks = 0 1","import React from 'react';\nimport PropTypes from 'prop-types';\n\n/**\n * @ignore\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} props.formatLabel\n * @param {string} props.type\n */\nexport default function Label(props) {\n const labelValue = props.formatLabel ? props.formatLabel(props.children, props.type) : props.children;\n\n return (\n \n \n {labelValue}\n \n \n );\n}\n\n/**\n * @type {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Function} formatLabel\n * @property {Function} type\n */\nLabel.propTypes = {\n children: PropTypes.node.isRequired,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n formatLabel: PropTypes.func,\n type: PropTypes.string.isRequired,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/label.jsx","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n (function () {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n })();\n}\n\nmodule.exports = warning;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/warning.js\n// module id = 8\n// module chunks = 0 1","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 9\n// module chunks = 0 1","import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\nimport * as valueTransformer from './value-transformer';\nimport DEFAULT_CLASS_NAMES from './default-class-names';\nimport Label from './label';\nimport rangePropType from './range-prop-type';\nimport valuePropType from './value-prop-type';\nimport Slider from './slider';\nimport Track from './track';\nimport { captialize, distanceTo, isDefined, isObject, length, isNumber } from '../utils';\nimport { DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, UP_ARROW } from './key-codes';\n\n/**\n * A React component that allows users to input numeric values within a range\n * by dragging its sliders.\n */\nexport default class InputRange extends React.Component {\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n static get propTypes() {\n return {\n allowSameValues: PropTypes.bool,\n ariaLabelledby: PropTypes.string,\n ariaControls: PropTypes.string,\n classNames: PropTypes.objectOf(PropTypes.string),\n disabled: PropTypes.bool,\n draggableTrack: PropTypes.bool,\n formatLabel: PropTypes.func,\n maxValue: rangePropType,\n minValue: rangePropType,\n name: PropTypes.string,\n onChangeStart: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n onChangeComplete: PropTypes.func,\n step: PropTypes.number,\n value: valuePropType,\n renderSubLabels: PropTypes.bool,\n };\n }\n\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n static get defaultProps() {\n return {\n allowSameValues: false,\n classNames: DEFAULT_CLASS_NAMES,\n disabled: false,\n maxValue: 10,\n minValue: 0,\n step: 1,\n renderSubLabels: false,\n };\n }\n\n /**\n * @param {Object} props\n * @param {boolean} [props.allowSameValues]\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} [props.classNames]\n * @param {boolean} [props.disabled = false]\n * @param {Function} [props.formatLabel]\n * @param {number|Range} [props.maxValue = 10]\n * @param {number|Range} [props.minValue = 0]\n * @param {string} [props.name]\n * @param {string} props.onChange\n * @param {Function} [props.onChangeComplete]\n * @param {Function} [props.onChangeStart]\n * @param {number} [props.step = 1]\n * @param {number|Range} props.value\n * @param {boolean} props.renderSubLabels\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?number}\n */\n this.startValue = null;\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n\n /**\n * @private\n * @type {?Component}\n */\n this.trackNode = null;\n\n /**\n * @private\n * @type {bool}\n */\n this.isSliderDragging = false;\n\n /**\n * @private\n * @type {?string}\n */\n this.lastKeyMoved = null;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n componentWillUnmount() {\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return the CSS class name of the component\n * @private\n * @return {string}\n */\n getComponentClassName() {\n if (!this.props.disabled) {\n return this.props.classNames.inputRange;\n }\n\n return this.props.classNames.disabledInputRange;\n }\n\n /**\n * Return the bounding rect of the track\n * @private\n * @return {ClientRect}\n */\n getTrackClientRect() {\n return this.trackNode.getClientRect();\n }\n\n /**\n * Return the slider key closest to a point\n * @private\n * @param {Point} position\n * @return {string}\n */\n getKeyByPosition(position) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n if (this.isMultiValue()) {\n const distanceToMin = distanceTo(position, positions.min);\n const distanceToMax = distanceTo(position, positions.max);\n\n if (distanceToMin < distanceToMax) {\n return 'min';\n }\n }\n\n return 'max';\n }\n\n /**\n * Return all the slider keys\n * @private\n * @return {string[]}\n */\n getKeys() {\n if (this.isMultiValue()) {\n return ['min', 'max'];\n }\n\n return ['max'];\n }\n\n /**\n * @private\n * @return {Object}\n */\n getStyle(val) {\n const { maxValue, minValue } = this.props;\n const perc = ((val - minValue) / (maxValue - minValue)) * 100;\n const style = {\n position: 'absolute',\n left: `${perc}%`,\n };\n\n return style;\n }\n\n /**\n * Return true if the difference between the new and the current value is\n * greater or equal to the step amount of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n hasStepDifference(values) {\n const currentValues = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n return length(values.min, currentValues.min) >= this.props.step ||\n length(values.max, currentValues.max) >= this.props.step;\n }\n\n /**\n * Return true if the component accepts a min and max value\n * @private\n * @return {boolean}\n */\n isMultiValue() {\n return isObject(this.props.value);\n }\n\n /**\n * Return true if the range is within the max and min value of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n isWithinRange(values) {\n if (this.isMultiValue()) {\n return values.min >= this.props.minValue &&\n values.max <= this.props.maxValue &&\n this.props.allowSameValues\n ? values.min <= values.max\n : values.min < values.max;\n }\n\n return values.max >= this.props.minValue && values.max <= this.props.maxValue;\n }\n\n /**\n * Return true if the new value should trigger a render\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n shouldUpdate(values) {\n return this.isWithinRange(values) && this.hasStepDifference(values);\n }\n\n /**\n * Update the position of a slider\n * @private\n * @param {string} key\n * @param {Point} position\n * @return {void}\n */\n updatePosition(key, position) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n positions[key] = position;\n this.lastKeyMoved = key;\n\n this.updatePositions(positions);\n }\n\n /**\n * Update the positions of multiple sliders\n * @private\n * @param {Object} positions\n * @param {Point} positions.min\n * @param {Point} positions.max\n * @return {void}\n */\n updatePositions(positions) {\n const values = {\n min: valueTransformer.getValueFromPosition(positions.min, this.props.minValue, this.props.maxValue, this.getTrackClientRect()),\n max: valueTransformer.getValueFromPosition(positions.max, this.props.minValue, this.props.maxValue, this.getTrackClientRect()),\n };\n\n const transformedValues = {\n min: valueTransformer.getStepValueFromValue(values.min, this.props.step),\n max: valueTransformer.getStepValueFromValue(values.max, this.props.step),\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Update the value of a slider\n * @private\n * @param {string} key\n * @param {number} value\n * @return {void}\n */\n updateValue(key, value) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n values[key] = value;\n\n this.updateValues(values);\n }\n\n /**\n * Update the values of multiple sliders\n * @private\n * @param {Range|number} values\n * @return {void}\n */\n updateValues(values) {\n if (!this.shouldUpdate(values)) {\n return;\n }\n\n this.props.onChange(this.isMultiValue() ? values : values.max);\n }\n\n /**\n * Increment the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n incrementValue(key) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const value = values[key] + this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Decrement the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n decrementValue(key) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const value = values[key] - this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Stop listening to mouseup event\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Stop listening to touchend event\n * @private\n * @return {void}\n */\n removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Handle any \"mousemove\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n @autobind\n handleSliderDrag(event, key) {\n if (this.props.disabled) {\n return;\n }\n\n const position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n this.isSliderDragging = true;\n requestAnimationFrame(() => this.updatePosition(key, position));\n }\n\n /**\n * Handle any \"mousemove\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTrackDrag(event, prevEvent) {\n if (this.props.disabled || !this.props.draggableTrack || this.isSliderDragging) {\n return;\n }\n\n const {\n maxValue,\n minValue,\n value: { max, min },\n } = this.props;\n\n const position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n const value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n const stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n const prevPosition = valueTransformer.getPositionFromEvent(prevEvent, this.getTrackClientRect());\n const prevValue = valueTransformer.getValueFromPosition(prevPosition, minValue, maxValue, this.getTrackClientRect());\n const prevStepValue = valueTransformer.getStepValueFromValue(prevValue, this.props.step);\n\n const offset = prevStepValue - stepValue;\n\n const transformedValues = {\n min: min - offset,\n max: max - offset,\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Handle any \"keydown\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n @autobind\n handleSliderKeyDown(event, key) {\n if (this.props.disabled) {\n return;\n }\n\n switch (event.keyCode) {\n case LEFT_ARROW:\n case DOWN_ARROW:\n event.preventDefault();\n this.decrementValue(key);\n break;\n\n case RIGHT_ARROW:\n case UP_ARROW:\n event.preventDefault();\n this.incrementValue(key);\n break;\n\n default:\n break;\n }\n }\n\n /**\n * Handle any \"mousedown\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @param {Point} position\n * @return {void}\n */\n @autobind\n handleTrackMouseDown(event, position) {\n if (this.props.disabled) {\n return;\n }\n\n const {\n maxValue,\n minValue,\n value: { max, min },\n } = this.props;\n\n event.preventDefault();\n\n const value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n const stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n if (!this.props.draggableTrack || stepValue > max || stepValue < min) {\n this.updatePosition(this.getKeyByPosition(position), position);\n }\n }\n\n /**\n * Handle the start of any mouse/touch event\n * @private\n * @return {void}\n */\n @autobind\n handleInteractionStart() {\n if (this.props.onChangeStart) {\n this.props.onChangeStart(this.props.value);\n }\n\n if (this.props.onChangeComplete && !isDefined(this.startValue)) {\n this.startValue = this.props.value;\n }\n }\n\n /**\n * Handle the end of any mouse/touch event\n * @private\n * @return {void}\n */\n @autobind\n handleInteractionEnd() {\n if (this.isSliderDragging) {\n this.isSliderDragging = false;\n }\n\n if (!this.props.onChangeComplete || !isDefined(this.startValue)) {\n return;\n }\n\n if (this.startValue !== this.props.value) {\n this.props.onChangeComplete(this.props.value);\n }\n\n this.startValue = null;\n }\n\n /**\n * Handle any \"keydown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyDown(event) {\n this.handleInteractionStart(event);\n }\n\n /**\n * Handle any \"keyup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyUp(event) {\n this.handleInteractionEnd(event);\n }\n\n /**\n * Handle any \"mousedown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseDown(event) {\n this.handleInteractionStart(event);\n this.addDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"mouseup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n @autobind\n handleMouseUp(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"touchstart\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTouchStart(event) {\n this.handleInteractionStart(event);\n this.addDocumentTouchEndListener();\n }\n\n /**\n * Handle any \"touchend\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n @autobind\n handleTouchEnd(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return JSX of sliders\n * @private\n * @return {JSX.Element}\n */\n renderSliders() {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n const keys = this.props.allowSameValues &&\n this.lastKeyMoved === 'min'\n ? this.getKeys().reverse()\n : this.getKeys();\n\n return keys.map((key) => {\n const value = values[key];\n const percentage = percentages[key];\n\n let { maxValue, minValue } = this.props;\n\n if (key === 'min') {\n maxValue = values.max;\n } else {\n minValue = values.min;\n }\n\n const slider = (\n \n );\n\n return slider;\n });\n }\n\n /**\n * Return JSX of hidden inputs\n * @private\n * @return {JSX.Element}\n */\n renderHiddenInputs() {\n if (!this.props.name) {\n return [];\n }\n\n const isMultiValue = this.isMultiValue();\n const values = valueTransformer.getValueFromProps(this.props, isMultiValue);\n\n return this.getKeys().map((key) => {\n const value = values[key];\n const name = isMultiValue ? `${this.props.name}${captialize(key)}` : this.props.name;\n\n return (\n \n );\n });\n }\n\n /**\n * @ignore\n * @override\n * @return {JSX.Element}\n */\n render() {\n const componentClassName = this.getComponentClassName();\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n\n let fstLabelVal = 0;\n let sndLabelVal = 0;\n let thdLabelVal = 0;\n let fstLabelStyle = {};\n let sndLabelStyle = {};\n let thdLabelStyle = {};\n\n if (this.props.renderSubLabels) {\n fstLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 1) + this.props.minValue;\n sndLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 2) + this.props.minValue;\n thdLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 3) + this.props.minValue;\n\n fstLabelStyle = this.getStyle(fstLabelVal);\n sndLabelStyle = this.getStyle(sndLabelVal);\n thdLabelStyle = this.getStyle(thdLabelVal);\n }\n\n const inactiveSeqValues = [];\n let inactiveSeq = null;\n if (isNumber(this.props.value)) {\n for (let i = this.props.value; i < this.props.maxValue; i++) {\n inactiveSeqValues.push(i);\n }\n inactiveSeq = inactiveSeqValues.map((value) => {\n const style = this.getStyle(value);\n return
;\n });\n }\n\n return (\n { this.node = node; }}\n className={componentClassName}\n onKeyDown={this.handleKeyDown}\n onKeyUp={this.handleKeyUp}\n onMouseDown={this.handleMouseDown}\n onTouchStart={this.handleTouchStart}>\n \n {this.props.minValue}\n \n\n {this.props.renderSubLabels &&\n
\n \n \n {fstLabelVal}\n \n \n\n \n \n {sndLabelVal}\n \n \n\n \n \n {thdLabelVal}\n \n \n
\n }\n\n { this.trackNode = trackNode; }}\n percentages={percentages}\n onTrackDrag={this.handleTrackDrag}\n onTrackMouseDown={this.handleTrackMouseDown}>\n\n {this.renderSliders()}\n \n\n {isNumber(this.props.value) &&\n
\n {inactiveSeq}\n
\n }\n\n \n {this.props.maxValue}\n \n\n {this.renderHiddenInputs()}\n
\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/input-range.jsx","import InputRange from './input-range/input-range';\n\n/**\n * @ignore\n * @typedef {Object} ClientRect\n * @property {number} height\n * @property {number} left\n * @property {number} top\n * @property {number} width\n */\n\n/**\n * @typedef {Object} InputRangeClassNames\n * @property {string} activeTrack\n * @property {string} disabledInputRange\n * @property {string} inputRange\n * @property {string} labelContainer\n * @property {string} maxLabel\n * @property {string} minLabel\n * @property {string} slider\n * @property {string} sliderContainer\n * @property {string} track\n * @property {string} valueLabel\n */\n\n/**\n * @typedef {Function} LabelFormatter\n * @param {number} value\n * @param {string} type\n * @return {string}\n */\n\n/**\n * @ignore\n * @typedef {Object} Point\n * @property {number} x\n * @property {number} y\n */\n\n/**\n * @typedef {Object} Range\n * @property {number} min - Min value\n * @property {number} max - Max value\n */\n\nexport default InputRange;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/index.js","/**\n * Default CSS class names\n * @ignore\n * @type {InputRangeClassNames}\n */\nconst DEFAULT_CLASS_NAMES = {\n activeTrack: 'input-range__track input-range__track--active',\n disabledInputRange: 'input-range input-range--disabled',\n inputRange: 'input-range',\n labelContainer: 'input-range__label-container',\n maxLabel: 'input-range__label input-range__label--max',\n minLabel: 'input-range__label input-range__label--min',\n fstLabel: 'input-range__label input-range__label--fst',\n sndLabel: 'input-range__label input-range__label--snd',\n thdLabel: 'input-range__label input-range__label--thd',\n sublabel: 'input-range__label--sublabel',\n inactiveCircleLabel: 'input-range__label--inactive',\n slider: 'input-range__slider',\n sliderContainer: 'input-range__slider-container',\n track: 'input-range__track input-range__track--background',\n valueLabel: 'input-range__label input-range__label--value',\n};\n\nexport default DEFAULT_CLASS_NAMES;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/default-class-names.js","/** @ignore */\nexport const DOWN_ARROW = 40;\n\n/** @ignore */\nexport const LEFT_ARROW = 37;\n\n/** @ignore */\nexport const RIGHT_ARROW = 39;\n\n/** @ignore */\nexport const UP_ARROW = 38;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/key-codes.js","import { isNumber } from '../utils';\n\n/**\n * @ignore\n * @param {Object} props - React component props\n * @return {?Error} Return Error if validation fails\n */\nexport default function rangePropType(props) {\n const { maxValue, minValue } = props;\n\n if (!isNumber(minValue) || !isNumber(maxValue)) {\n return new Error('\"minValue\" and \"maxValue\" must be a number');\n }\n\n if (minValue >= maxValue) {\n return new Error('\"minValue\" must be smaller than \"maxValue\"');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/range-prop-type.js","import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\nimport Label from './label';\n\n/**\n * @ignore\n */\nexport default class Slider extends React.Component {\n /**\n * Accepted propTypes of Slider\n * @override\n * @return {Object}\n * @property {Function} ariaLabelledby\n * @property {Function} ariaControls\n * @property {Function} className\n * @property {Function} formatLabel\n * @property {Function} maxValue\n * @property {Function} minValue\n * @property {Function} onSliderDrag\n * @property {Function} onSliderKeyDown\n * @property {Function} percentage\n * @property {Function} type\n * @property {Function} value\n */\n static get propTypes() {\n return {\n ariaLabelledby: PropTypes.string,\n ariaControls: PropTypes.string,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n formatLabel: PropTypes.func,\n maxValue: PropTypes.number,\n minValue: PropTypes.number,\n onSliderDrag: PropTypes.func.isRequired,\n onSliderKeyDown: PropTypes.func.isRequired,\n percentage: PropTypes.number.isRequired,\n type: PropTypes.string.isRequired,\n value: PropTypes.number.isRequired,\n };\n }\n\n /**\n * @param {Object} props\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} [props.formatLabel]\n * @param {number} [props.maxValue]\n * @param {number} [props.minValue]\n * @param {Function} props.onSliderKeyDown\n * @param {Function} props.onSliderDrag\n * @param {number} props.percentage\n * @param {number} props.type\n * @param {number} props.value\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n componentWillUnmount() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n this.removeDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @return {Object}\n */\n getStyle() {\n const perc = (this.props.percentage || 0) * 100;\n const style = {\n position: 'absolute',\n left: `${perc}%`,\n };\n\n return style;\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchmove event\n * @private\n * @return {void}\n */\n addDocumentTouchMoveListener() {\n this.removeDocumentTouchMoveListener();\n this.node.ownerDocument.addEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentTouchMoveListener() {\n this.node.ownerDocument.removeEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseDown() {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseUp() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleTouchStart() {\n this.addDocumentTouchEndListener();\n this.addDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTouchMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleTouchEnd() {\n this.removeDocumentTouchMoveListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyDown(event) {\n this.props.onSliderKeyDown(event, this.props.type);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n render() {\n const style = this.getStyle();\n\n return (\n { this.node = node; }}\n style={style}>\n \n {this.props.value}\n \n\n \n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/slider.jsx","import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\n\n/**\n * @ignore\n */\nexport default class Track extends React.Component {\n /**\n * @override\n * @return {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Boolean} draggableTrack\n * @property {Function} onTrackDrag\n * @property {Function} onTrackMouseDown\n * @property {Function} percentages\n */\n static get propTypes() {\n return {\n children: PropTypes.node.isRequired,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n draggableTrack: PropTypes.bool,\n onTrackDrag: PropTypes.func,\n onTrackMouseDown: PropTypes.func.isRequired,\n percentages: PropTypes.objectOf(PropTypes.number).isRequired,\n };\n }\n\n /**\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Boolean} props.draggableTrack\n * @param {Function} props.onTrackDrag\n * @param {Function} props.onTrackMouseDown\n * @param {number} props.percentages\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n this.trackDragEvent = null;\n }\n\n /**\n * @private\n * @return {ClientRect}\n */\n getClientRect() {\n return this.node.getBoundingClientRect();\n }\n\n /**\n * @private\n * @return {Object} CSS styles\n */\n getActiveTrackStyle() {\n const width = `${(this.props.percentages.max - this.props.percentages.min) * 100}%`;\n const left = `${this.props.percentages.min * 100}%`;\n\n return { left, width };\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseMove(event) {\n if (!this.props.draggableTrack) {\n return;\n }\n\n if (this.trackDragEvent !== null) {\n this.props.onTrackDrag(event, this.trackDragEvent);\n }\n\n this.trackDragEvent = event;\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseUp() {\n if (!this.props.draggableTrack) {\n return;\n }\n\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.trackDragEvent = null;\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n @autobind\n handleMouseDown(event) {\n const clientX = event.touches ? event.touches[0].clientX : event.clientX;\n const trackClientRect = this.getClientRect();\n const position = {\n x: clientX - trackClientRect.left,\n y: 0,\n };\n\n this.props.onTrackMouseDown(event, position);\n\n if (this.props.draggableTrack) {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n @autobind\n handleTouchStart(event) {\n event.preventDefault();\n\n this.handleMouseDown(event);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n render() {\n const activeTrackStyle = this.getActiveTrackStyle();\n\n return (\n { this.node = node; }}>\n \n {this.props.children}\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/track.jsx","import { isNumber, isObject } from '../utils';\n\n/**\n * @ignore\n * @param {Object} props\n * @return {?Error} Return Error if validation fails\n */\nexport default function valuePropType(props, propName) {\n const { maxValue, minValue } = props;\n const value = props[propName];\n\n if (!isNumber(value) && (!isObject(value) || !isNumber(value.min) || !isNumber(value.max))) {\n return new Error(`\"${propName}\" must be a number or a range object`);\n }\n\n if (isNumber(value) && (value < minValue || value > maxValue)) {\n return new Error(`\"${propName}\" must be in between \"minValue\" and \"maxValue\"`);\n }\n\n if (isObject(value) && (value.min < minValue || value.min > maxValue || value.max < minValue || value.max > maxValue)) {\n return new Error(`\"${propName}\" must be in between \"minValue\" and \"maxValue\"`);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/value-prop-type.js","import { clamp } from '../utils';\n\n/**\n * Convert a point into a percentage value\n * @ignore\n * @param {Point} position\n * @param {ClientRect} clientRect\n * @return {number} Percentage value\n */\nexport function getPercentageFromPosition(position, clientRect) {\n const length = clientRect.width;\n const sizePerc = position.x / length;\n\n return sizePerc || 0;\n}\n\n/**\n * Convert a point into a model value\n * @ignore\n * @param {Point} position\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {number}\n */\nexport function getValueFromPosition(position, minValue, maxValue, clientRect) {\n const sizePerc = getPercentageFromPosition(position, clientRect);\n const valueDiff = maxValue - minValue;\n\n return minValue + (valueDiff * sizePerc);\n}\n\n/**\n * Convert props into a range value\n * @ignore\n * @param {Object} props\n * @param {boolean} isMultiValue\n * @return {Range}\n */\nexport function getValueFromProps(props, isMultiValue) {\n if (isMultiValue) {\n return { ...props.value };\n }\n\n return {\n min: props.minValue,\n max: props.value,\n };\n}\n\n/**\n * Convert a model value into a percentage value\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @return {number}\n */\nexport function getPercentageFromValue(value, minValue, maxValue) {\n const validValue = clamp(value, minValue, maxValue);\n const valueDiff = maxValue - minValue;\n const valuePerc = (validValue - minValue) / valueDiff;\n\n return valuePerc || 0;\n}\n\n/**\n * Convert model values into percentage values\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @return {Range}\n */\nexport function getPercentagesFromValues(values, minValue, maxValue) {\n return {\n min: getPercentageFromValue(values.min, minValue, maxValue),\n max: getPercentageFromValue(values.max, minValue, maxValue),\n };\n}\n\n/**\n * Convert a value into a point\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Point} Position\n */\nexport function getPositionFromValue(value, minValue, maxValue, clientRect) {\n const length = clientRect.width;\n const valuePerc = getPercentageFromValue(value, minValue, maxValue);\n const positionValue = valuePerc * length;\n\n return {\n x: positionValue,\n y: 0,\n };\n}\n\n/**\n * Convert a range of values into points\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Range}\n */\nexport function getPositionsFromValues(values, minValue, maxValue, clientRect) {\n return {\n min: getPositionFromValue(values.min, minValue, maxValue, clientRect),\n max: getPositionFromValue(values.max, minValue, maxValue, clientRect),\n };\n}\n\n/**\n * Convert an event into a point\n * @ignore\n * @param {Event} event\n * @param {ClientRect} clientRect\n * @return {Point}\n */\nexport function getPositionFromEvent(event, clientRect) {\n const length = clientRect.width;\n const { clientX } = event.touches ? event.touches[0] : event;\n\n return {\n x: clamp(clientX - clientRect.left, 0, length),\n y: 0,\n };\n}\n\n/**\n * Convert a value into a step value\n * @ignore\n * @param {number} value\n * @param {number} valuePerStep\n * @return {number}\n */\nexport function getStepValueFromValue(value, valuePerStep) {\n return Math.round(value / valuePerStep) * valuePerStep;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/value-transformer.js","/**\n * Captialize a string\n * @ignore\n * @param {string} string\n * @return {string}\n */\nexport default function captialize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/captialize.js","/**\n * Clamp a value between a min and max value\n * @ignore\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @return {number}\n */\nexport default function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/clamp.js","/**\n * Calculate the distance between pointA and pointB\n * @ignore\n * @param {Point} pointA\n * @param {Point} pointB\n * @return {number} Distance\n */\nexport default function distanceTo(pointA, pointB) {\n const xDiff = (pointB.x - pointA.x) ** 2;\n const yDiff = (pointB.y - pointA.y) ** 2;\n\n return Math.sqrt(xDiff + yDiff);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/distance-to.js","/**\n * Check if a value is defined\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isDefined(value) {\n return value !== undefined && value !== null;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/is-defined.js","/**\n * Check if a value is a number\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isNumber(value) {\n return typeof value === 'number';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/is-number.js","/**\n * Check if a value is an object\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isObject(value) {\n return value !== null && typeof value === 'object';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/is-object.js","/**\n * Calculate the absolute difference between two numbers\n * @ignore\n * @param {number} numA\n * @param {number} numB\n * @return {number}\n */\nexport default function length(numA, numB) {\n return Math.abs(numA - numB);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/length.js","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/checkPropTypes.js\n// module id = 26\n// module chunks = 0 1","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\n\nmodule.exports = function() {\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithThrowingShims.js\n// module id = 27\n// module chunks = 0 1","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithTypeCheckers.js\n// module id = 28\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/bundle/react-input-range.min.js b/lib/bundle/react-input-range.min.js new file mode 100644 index 0000000..684bb81 --- /dev/null +++ b/lib/bundle/react-input-range.min.js @@ -0,0 +1,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(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},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=11)}([function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function i(){m&&d&&(m=!1,d.length?h=d.concat(h):y=-1,h.length&&u())}function u(){if(!m){var e=o(i);m=!0;for(var t=h.length;t;){for(d=h,h=[];++y1)for(var n=1;n1?t-1:0),r=1;r2?r-2:0),a=2;a=this.props.step||(0,x.length)(e.max,t.max)>=this.props.step}},{key:"isMultiValue",value:function(){return(0,x.isObject)(this.props.value)}},{key:"isWithinRange",value:function(e){return this.isMultiValue()?e.min>=this.props.minValue&&e.max<=this.props.maxValue&&this.props.allowSameValues?e.min<=e.max:e.min=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=v.getValueFromProps(this.props,this.isMultiValue()),r=v.getPositionsFromValues(n,this.props.minValue,this.props.maxValue,this.getTrackClientRect());r[e]=t,this.lastKeyMoved=e,this.updatePositions(r)}},{key:"updatePositions",value:function(e){var t={min:v.getValueFromPosition(e.min,this.props.minValue,this.props.maxValue,this.getTrackClientRect()),max:v.getValueFromPosition(e.max,this.props.minValue,this.props.maxValue,this.getTrackClientRect())},n={min:v.getStepValueFromValue(t.min,this.props.step),max:v.getStepValueFromValue(t.max,this.props.step)};this.updateValues(n)}},{key:"updateValue",value:function(e,t){var n=v.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=v.getValueFromProps(this.props,this.isMultiValue()),n=t[e]+this.props.step;this.updateValue(e,n)}},{key:"decrementValue",value:function(e){var t=v.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 r=v.getPositionFromEvent(e,this.getTrackClientRect());this.isSliderDragging=!0,requestAnimationFrame(function(){return n.updatePosition(t,r)})}}},{key:"handleTrackDrag",value:function(e,t){if(!this.props.disabled&&this.props.draggableTrack&&!this.isSliderDragging){var n=this.props,r=n.maxValue,o=n.minValue,a=n.value,i=a.max,u=a.min,s=v.getPositionFromEvent(e,this.getTrackClientRect()),l=v.getValueFromPosition(s,o,r,this.getTrackClientRect()),c=v.getStepValueFromValue(l,this.props.step),p=v.getPositionFromEvent(t,this.getTrackClientRect()),f=v.getValueFromPosition(p,o,r,this.getTrackClientRect()),d=v.getStepValueFromValue(f,this.props.step),h=d-c,m={min:u-h,max:i-h};this.updateValues(m)}}},{key:"handleSliderKeyDown",value:function(e,t){if(!this.props.disabled)switch(e.keyCode){case j.LEFT_ARROW:case j.DOWN_ARROW:e.preventDefault(),this.decrementValue(t);break;case j.RIGHT_ARROW:case j.UP_ARROW:e.preventDefault(),this.incrementValue(t)}}},{key:"handleTrackMouseDown",value:function(e,t){if(!this.props.disabled){var n=this.props,r=n.maxValue,o=n.minValue,a=n.value,i=a.max,u=a.min;e.preventDefault();var s=v.getValueFromPosition(t,o,r,this.getTrackClientRect()),l=v.getStepValueFromValue(s,this.props.step);(!this.props.draggableTrack||l>i||l=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=r;var o=n(1);e.exports=t.default},function(e,t,n){"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 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 i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t,n,r,o){var a={};return Object.keys(r).forEach(function(e){a[e]=r[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,r){return r(e,t,n)||n},a),o&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(o):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;nn)?new Error('"'+t+'" must be in between "minValue" and "maxValue"'):(0,o.isObject)(a)&&(a.minn||a.maxn)?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=r;var o=n(1);e.exports=t.default},function(e,t,n){"use strict";function r(e,t){var n=t.width;return e.x/n||0}function o(e,t,n,o){return t+(n-t)*r(e,o)}function a(e,t){return t?f({},e.value):{min:e.minValue,max:e.value}}function i(e,t,n){return((0,d.clamp)(e,t,n)-t)/(n-t)||0}function u(e,t,n){return{min:i(e.min,t,n),max:i(e.max,t,n)}}function s(e,t,n,r){var o=r.width;return{x:i(e,t,n)*o,y:0}}function l(e,t,n,r){return{min:s(e.min,t,n,r),max:s(e.max,t,n,r)}}function c(e,t){var n=t.width,r=e.touches?e.touches[0]:e,o=r.clientX;return{x:(0,d.clamp)(o-t.left,0,n),y:0}}function p(e,t){return Math.round(e/t)*t}Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _captialize = __webpack_require__(19);\n\nObject.defineProperty(exports, 'captialize', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_captialize).default;\n }\n});\n\nvar _clamp = __webpack_require__(20);\n\nObject.defineProperty(exports, 'clamp', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_clamp).default;\n }\n});\n\nvar _distanceTo = __webpack_require__(21);\n\nObject.defineProperty(exports, 'distanceTo', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_distanceTo).default;\n }\n});\n\nvar _isDefined = __webpack_require__(22);\n\nObject.defineProperty(exports, 'isDefined', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_isDefined).default;\n }\n});\n\nvar _isNumber = __webpack_require__(23);\n\nObject.defineProperty(exports, 'isNumber', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_isNumber).default;\n }\n});\n\nvar _isObject = __webpack_require__(24);\n\nObject.defineProperty(exports, 'isObject', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_isObject).default;\n }\n});\n\nvar _length = __webpack_require__(25);\n\nObject.defineProperty(exports, 'length', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_length).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(process) {/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(28)(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(27)();\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * @copyright 2015, Andrey Popp <8mayday@gmail.com>\n *\n * The decorator may be used on classes or methods\n * ```\n * @autobind\n * class FullBound {}\n *\n * class PartBound {\n * @autobind\n * method () {}\n * }\n * ```\n */\n\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports['default'] = autobind;\n\nfunction autobind() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 1) {\n return boundClass.apply(undefined, args);\n } else {\n return boundMethod.apply(undefined, args);\n }\n}\n\n/**\n * Use boundMethod to bind all methods on the target.prototype\n */\nfunction boundClass(target) {\n // (Using reflect to get all keys including symbols)\n var keys = undefined;\n // Use Reflect if exists\n if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') {\n keys = Reflect.ownKeys(target.prototype);\n } else {\n keys = Object.getOwnPropertyNames(target.prototype);\n // use symbols if support is provided\n if (typeof Object.getOwnPropertySymbols === 'function') {\n keys = keys.concat(Object.getOwnPropertySymbols(target.prototype));\n }\n }\n\n keys.forEach(function (key) {\n // Ignore special case target method\n if (key === 'constructor') {\n return;\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(target.prototype, key);\n\n // Only methods need binding\n if (typeof descriptor.value === 'function') {\n Object.defineProperty(target.prototype, key, boundMethod(target, key, descriptor));\n }\n });\n return target;\n}\n\n/**\n * Return a descriptor removing the value and returning a getter\n * The getter will return a .bind version of the function\n * and memoize the result against a symbol on the instance\n */\nfunction boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn);\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n definingProperty = false;\n return boundFn;\n }\n };\n}\nmodule.exports = exports['default'];\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = Label;\n\nvar _react = __webpack_require__(3);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(2);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} props.formatLabel\n * @param {string} props.type\n */\nfunction Label(props) {\n var labelValue = props.formatLabel ? props.formatLabel(props.children, props.type) : props.children;\n\n return _react2.default.createElement(\n 'span',\n { className: props.classNames[props.type + 'Label'] },\n _react2.default.createElement(\n 'span',\n { className: props.classNames.labelContainer },\n labelValue\n )\n );\n}\n\n/**\n * @type {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Function} formatLabel\n * @property {Function} type\n */\nLabel.propTypes = {\n children: _propTypes2.default.node.isRequired,\n classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired,\n formatLabel: _propTypes2.default.func,\n type: _propTypes2.default.string.isRequired\n};\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n\n\nvar emptyFunction = __webpack_require__(5);\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n (function () {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n })();\n}\n\nmodule.exports = warning;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _desc, _value, _class;\n\nvar _react = __webpack_require__(3);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(2);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _autobindDecorator = __webpack_require__(4);\n\nvar _autobindDecorator2 = _interopRequireDefault(_autobindDecorator);\n\nvar _valueTransformer = __webpack_require__(18);\n\nvar valueTransformer = _interopRequireWildcard(_valueTransformer);\n\nvar _defaultClassNames = __webpack_require__(12);\n\nvar _defaultClassNames2 = _interopRequireDefault(_defaultClassNames);\n\nvar _label = __webpack_require__(7);\n\nvar _label2 = _interopRequireDefault(_label);\n\nvar _rangePropType = __webpack_require__(14);\n\nvar _rangePropType2 = _interopRequireDefault(_rangePropType);\n\nvar _valuePropType = __webpack_require__(17);\n\nvar _valuePropType2 = _interopRequireDefault(_valuePropType);\n\nvar _slider = __webpack_require__(15);\n\nvar _slider2 = _interopRequireDefault(_slider);\n\nvar _track = __webpack_require__(16);\n\nvar _track2 = _interopRequireDefault(_track);\n\nvar _utils = __webpack_require__(1);\n\nvar _keyCodes = __webpack_require__(13);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\n/**\n * A React component that allows users to input numeric values within a range\n * by dragging its sliders.\n */\nvar InputRange = (_class = function (_React$Component) {\n _inherits(InputRange, _React$Component);\n\n _createClass(InputRange, null, [{\n key: 'propTypes',\n\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n get: function get() {\n return {\n allowSameValues: _propTypes2.default.bool,\n ariaLabelledby: _propTypes2.default.string,\n ariaControls: _propTypes2.default.string,\n classNames: _propTypes2.default.objectOf(_propTypes2.default.string),\n disabled: _propTypes2.default.bool,\n draggableTrack: _propTypes2.default.bool,\n formatLabel: _propTypes2.default.func,\n maxValue: _rangePropType2.default,\n minValue: _rangePropType2.default,\n name: _propTypes2.default.string,\n onChangeStart: _propTypes2.default.func,\n onChange: _propTypes2.default.func.isRequired,\n onChangeComplete: _propTypes2.default.func,\n step: _propTypes2.default.number,\n value: _valuePropType2.default,\n renderSubLabels: _propTypes2.default.bool\n };\n }\n\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n\n }, {\n key: 'defaultProps',\n get: function get() {\n return {\n allowSameValues: false,\n classNames: _defaultClassNames2.default,\n disabled: false,\n maxValue: 10,\n minValue: 0,\n step: 1,\n renderSubLabels: false\n };\n }\n\n /**\n * @param {Object} props\n * @param {boolean} [props.allowSameValues]\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} [props.classNames]\n * @param {boolean} [props.disabled = false]\n * @param {Function} [props.formatLabel]\n * @param {number|Range} [props.maxValue = 10]\n * @param {number|Range} [props.minValue = 0]\n * @param {string} [props.name]\n * @param {string} props.onChange\n * @param {Function} [props.onChangeComplete]\n * @param {Function} [props.onChangeStart]\n * @param {number} [props.step = 1]\n * @param {number|Range} props.value\n * @param {boolean} props.renderSubLabels\n */\n\n }]);\n\n function InputRange(props) {\n _classCallCheck(this, InputRange);\n\n /**\n * @private\n * @type {?number}\n */\n var _this = _possibleConstructorReturn(this, (InputRange.__proto__ || Object.getPrototypeOf(InputRange)).call(this, props));\n\n _this.startValue = null;\n\n /**\n * @private\n * @type {?Component}\n */\n _this.node = null;\n\n /**\n * @private\n * @type {?Component}\n */\n _this.trackNode = null;\n\n /**\n * @private\n * @type {bool}\n */\n _this.isSliderDragging = false;\n\n /**\n * @private\n * @type {?string}\n */\n _this.lastKeyMoved = null;\n return _this;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n\n\n _createClass(InputRange, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return the CSS class name of the component\n * @private\n * @return {string}\n */\n\n }, {\n key: 'getComponentClassName',\n value: function getComponentClassName() {\n if (!this.props.disabled) {\n return this.props.classNames.inputRange;\n }\n\n return this.props.classNames.disabledInputRange;\n }\n\n /**\n * Return the bounding rect of the track\n * @private\n * @return {ClientRect}\n */\n\n }, {\n key: 'getTrackClientRect',\n value: function getTrackClientRect() {\n return this.trackNode.getClientRect();\n }\n\n /**\n * Return the slider key closest to a point\n * @private\n * @param {Point} position\n * @return {string}\n */\n\n }, {\n key: 'getKeyByPosition',\n value: function getKeyByPosition(position) {\n var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n var positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n if (this.isMultiValue()) {\n var distanceToMin = (0, _utils.distanceTo)(position, positions.min);\n var distanceToMax = (0, _utils.distanceTo)(position, positions.max);\n\n if (distanceToMin < distanceToMax) {\n return 'min';\n }\n }\n\n return 'max';\n }\n\n /**\n * Return all the slider keys\n * @private\n * @return {string[]}\n */\n\n }, {\n key: 'getKeys',\n value: function getKeys() {\n if (this.isMultiValue()) {\n return ['min', 'max'];\n }\n\n return ['max'];\n }\n\n /**\n * @private\n * @return {Object}\n */\n\n }, {\n key: 'getStyle',\n value: function getStyle(val) {\n var _props = this.props,\n maxValue = _props.maxValue,\n minValue = _props.minValue;\n\n var perc = (val - minValue) / (maxValue - minValue) * 100;\n var style = {\n position: 'absolute',\n left: perc + '%'\n };\n\n return style;\n }\n\n /**\n * Return true if the difference between the new and the current value is\n * greater or equal to the step amount of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n\n }, {\n key: 'hasStepDifference',\n value: function hasStepDifference(values) {\n var currentValues = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n return (0, _utils.length)(values.min, currentValues.min) >= this.props.step || (0, _utils.length)(values.max, currentValues.max) >= this.props.step;\n }\n\n /**\n * Return true if the component accepts a min and max value\n * @private\n * @return {boolean}\n */\n\n }, {\n key: 'isMultiValue',\n value: function isMultiValue() {\n return (0, _utils.isObject)(this.props.value);\n }\n\n /**\n * Return true if the range is within the max and min value of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n\n }, {\n key: 'isWithinRange',\n value: function isWithinRange(values) {\n if (this.isMultiValue()) {\n return values.min >= this.props.minValue && values.max <= this.props.maxValue && this.props.allowSameValues ? values.min <= values.max : values.min < values.max;\n }\n\n return values.max >= this.props.minValue && values.max <= this.props.maxValue;\n }\n\n /**\n * Return true if the new value should trigger a render\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n\n }, {\n key: 'shouldUpdate',\n value: function shouldUpdate(values) {\n return this.isWithinRange(values) && this.hasStepDifference(values);\n }\n\n /**\n * Update the position of a slider\n * @private\n * @param {string} key\n * @param {Point} position\n * @return {void}\n */\n\n }, {\n key: 'updatePosition',\n value: function updatePosition(key, position) {\n var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n var positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n positions[key] = position;\n this.lastKeyMoved = key;\n\n this.updatePositions(positions);\n }\n\n /**\n * Update the positions of multiple sliders\n * @private\n * @param {Object} positions\n * @param {Point} positions.min\n * @param {Point} positions.max\n * @return {void}\n */\n\n }, {\n key: 'updatePositions',\n value: function updatePositions(positions) {\n var values = {\n min: valueTransformer.getValueFromPosition(positions.min, this.props.minValue, this.props.maxValue, this.getTrackClientRect()),\n max: valueTransformer.getValueFromPosition(positions.max, this.props.minValue, this.props.maxValue, this.getTrackClientRect())\n };\n\n var transformedValues = {\n min: valueTransformer.getStepValueFromValue(values.min, this.props.step),\n max: valueTransformer.getStepValueFromValue(values.max, this.props.step)\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Update the value of a slider\n * @private\n * @param {string} key\n * @param {number} value\n * @return {void}\n */\n\n }, {\n key: 'updateValue',\n value: function updateValue(key, value) {\n var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n values[key] = value;\n\n this.updateValues(values);\n }\n\n /**\n * Update the values of multiple sliders\n * @private\n * @param {Range|number} values\n * @return {void}\n */\n\n }, {\n key: 'updateValues',\n value: function updateValues(values) {\n if (!this.shouldUpdate(values)) {\n return;\n }\n\n this.props.onChange(this.isMultiValue() ? values : values.max);\n }\n\n /**\n * Increment the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n\n }, {\n key: 'incrementValue',\n value: function incrementValue(key) {\n var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n var value = values[key] + this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Decrement the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n\n }, {\n key: 'decrementValue',\n value: function decrementValue(key) {\n var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n var value = values[key] - this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentMouseUpListener',\n value: function addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentTouchEndListener',\n value: function addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Stop listening to mouseup event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentMouseUpListener',\n value: function removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Stop listening to touchend event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentTouchEndListener',\n value: function removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Handle any \"mousemove\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n\n }, {\n key: 'handleSliderDrag',\n value: function handleSliderDrag(event, key) {\n var _this2 = this;\n\n if (this.props.disabled) {\n return;\n }\n\n var position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n this.isSliderDragging = true;\n requestAnimationFrame(function () {\n return _this2.updatePosition(key, position);\n });\n }\n\n /**\n * Handle any \"mousemove\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleTrackDrag',\n value: function handleTrackDrag(event, prevEvent) {\n if (this.props.disabled || !this.props.draggableTrack || this.isSliderDragging) {\n return;\n }\n\n var _props2 = this.props,\n maxValue = _props2.maxValue,\n minValue = _props2.minValue,\n _props2$value = _props2.value,\n max = _props2$value.max,\n min = _props2$value.min;\n\n\n var position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n var value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n var stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n var prevPosition = valueTransformer.getPositionFromEvent(prevEvent, this.getTrackClientRect());\n var prevValue = valueTransformer.getValueFromPosition(prevPosition, minValue, maxValue, this.getTrackClientRect());\n var prevStepValue = valueTransformer.getStepValueFromValue(prevValue, this.props.step);\n\n var offset = prevStepValue - stepValue;\n\n var transformedValues = {\n min: min - offset,\n max: max - offset\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Handle any \"keydown\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n\n }, {\n key: 'handleSliderKeyDown',\n value: function handleSliderKeyDown(event, key) {\n if (this.props.disabled) {\n return;\n }\n\n switch (event.keyCode) {\n case _keyCodes.LEFT_ARROW:\n case _keyCodes.DOWN_ARROW:\n event.preventDefault();\n this.decrementValue(key);\n break;\n\n case _keyCodes.RIGHT_ARROW:\n case _keyCodes.UP_ARROW:\n event.preventDefault();\n this.incrementValue(key);\n break;\n\n default:\n break;\n }\n }\n\n /**\n * Handle any \"mousedown\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @param {Point} position\n * @return {void}\n */\n\n }, {\n key: 'handleTrackMouseDown',\n value: function handleTrackMouseDown(event, position) {\n if (this.props.disabled) {\n return;\n }\n\n var _props3 = this.props,\n maxValue = _props3.maxValue,\n minValue = _props3.minValue,\n _props3$value = _props3.value,\n max = _props3$value.max,\n min = _props3$value.min;\n\n\n event.preventDefault();\n\n var value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n var stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n if (!this.props.draggableTrack || stepValue > max || stepValue < min) {\n this.updatePosition(this.getKeyByPosition(position), position);\n }\n }\n\n /**\n * Handle the start of any mouse/touch event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'handleInteractionStart',\n value: function handleInteractionStart() {\n if (this.props.onChangeStart) {\n this.props.onChangeStart(this.props.value);\n }\n\n if (this.props.onChangeComplete && !(0, _utils.isDefined)(this.startValue)) {\n this.startValue = this.props.value;\n }\n }\n\n /**\n * Handle the end of any mouse/touch event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'handleInteractionEnd',\n value: function handleInteractionEnd() {\n if (this.isSliderDragging) {\n this.isSliderDragging = false;\n }\n\n if (!this.props.onChangeComplete || !(0, _utils.isDefined)(this.startValue)) {\n return;\n }\n\n if (this.startValue !== this.props.value) {\n this.props.onChangeComplete(this.props.value);\n }\n\n this.startValue = null;\n }\n\n /**\n * Handle any \"keydown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleKeyDown',\n value: function handleKeyDown(event) {\n this.handleInteractionStart(event);\n }\n\n /**\n * Handle any \"keyup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleKeyUp',\n value: function handleKeyUp(event) {\n this.handleInteractionEnd(event);\n }\n\n /**\n * Handle any \"mousedown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleMouseDown',\n value: function handleMouseDown(event) {\n this.handleInteractionStart(event);\n this.addDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"mouseup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n\n }, {\n key: 'handleMouseUp',\n value: function handleMouseUp(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"touchstart\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleTouchStart',\n value: function handleTouchStart(event) {\n this.handleInteractionStart(event);\n this.addDocumentTouchEndListener();\n }\n\n /**\n * Handle any \"touchend\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n\n }, {\n key: 'handleTouchEnd',\n value: function handleTouchEnd(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return JSX of sliders\n * @private\n * @return {JSX.Element}\n */\n\n }, {\n key: 'renderSliders',\n value: function renderSliders() {\n var _this3 = this;\n\n var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n var percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n var keys = this.props.allowSameValues && this.lastKeyMoved === 'min' ? this.getKeys().reverse() : this.getKeys();\n\n return keys.map(function (key) {\n var value = values[key];\n var percentage = percentages[key];\n\n var _props4 = _this3.props,\n maxValue = _props4.maxValue,\n minValue = _props4.minValue;\n\n\n if (key === 'min') {\n maxValue = values.max;\n } else {\n minValue = values.min;\n }\n\n var slider = _react2.default.createElement(_slider2.default, {\n ariaLabelledby: _this3.props.ariaLabelledby,\n ariaControls: _this3.props.ariaControls,\n classNames: _this3.props.classNames,\n formatLabel: _this3.props.formatLabel,\n key: key,\n maxValue: maxValue,\n minValue: minValue,\n onSliderDrag: _this3.handleSliderDrag,\n onSliderKeyDown: _this3.handleSliderKeyDown,\n percentage: percentage,\n type: key,\n value: value });\n\n return slider;\n });\n }\n\n /**\n * Return JSX of hidden inputs\n * @private\n * @return {JSX.Element}\n */\n\n }, {\n key: 'renderHiddenInputs',\n value: function renderHiddenInputs() {\n var _this4 = this;\n\n if (!this.props.name) {\n return [];\n }\n\n var isMultiValue = this.isMultiValue();\n var values = valueTransformer.getValueFromProps(this.props, isMultiValue);\n\n return this.getKeys().map(function (key) {\n var value = values[key];\n var name = isMultiValue ? '' + _this4.props.name + (0, _utils.captialize)(key) : _this4.props.name;\n\n return _react2.default.createElement('input', { key: key, type: 'hidden', name: name, value: value });\n });\n }\n\n /**\n * @ignore\n * @override\n * @return {JSX.Element}\n */\n\n }, {\n key: 'render',\n value: function render() {\n var _this5 = this;\n\n var componentClassName = this.getComponentClassName();\n var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n var percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n\n var fstLabelVal = 0;\n var sndLabelVal = 0;\n var thdLabelVal = 0;\n var fstLabelStyle = {};\n var sndLabelStyle = {};\n var thdLabelStyle = {};\n\n if (this.props.renderSubLabels) {\n fstLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 1 + this.props.minValue;\n sndLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 2 + this.props.minValue;\n thdLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 3 + this.props.minValue;\n\n fstLabelStyle = this.getStyle(fstLabelVal);\n sndLabelStyle = this.getStyle(sndLabelVal);\n thdLabelStyle = this.getStyle(thdLabelVal);\n }\n\n var inactiveSeqValues = [];\n var inactiveSeq = null;\n if ((0, _utils.isNumber)(this.props.value)) {\n for (var i = this.props.value; i < this.props.maxValue; i++) {\n inactiveSeqValues.push(i);\n }\n inactiveSeq = inactiveSeqValues.map(function (value) {\n var style = _this5.getStyle(value);\n return _react2.default.createElement('div', { key: value, style: style, className: _this5.props.classNames.inactiveCircleLabel });\n });\n }\n\n return _react2.default.createElement(\n 'div',\n {\n 'aria-disabled': this.props.disabled,\n ref: function ref(node) {\n _this5.node = node;\n },\n className: componentClassName,\n onKeyDown: this.handleKeyDown,\n onKeyUp: this.handleKeyUp,\n onMouseDown: this.handleMouseDown,\n onTouchStart: this.handleTouchStart },\n _react2.default.createElement(\n _label2.default,\n {\n classNames: this.props.classNames,\n formatLabel: this.props.formatLabel,\n type: 'min' },\n this.props.minValue\n ),\n this.props.renderSubLabels && _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'span',\n { style: fstLabelStyle, className: this.props.classNames.sublabel },\n _react2.default.createElement(\n _label2.default,\n {\n classNames: this.props.classNames,\n formatLabel: this.props.formatLabel,\n type: 'fst' },\n fstLabelVal\n )\n ),\n _react2.default.createElement(\n 'span',\n { style: sndLabelStyle, className: this.props.classNames.sublabel },\n _react2.default.createElement(\n _label2.default,\n {\n classNames: this.props.classNames,\n formatLabel: this.props.formatLabel,\n style: sndLabelStyle,\n type: 'snd' },\n sndLabelVal\n )\n ),\n _react2.default.createElement(\n 'span',\n { style: thdLabelStyle, className: this.props.classNames.sublabel },\n _react2.default.createElement(\n _label2.default,\n {\n classNames: this.props.classNames,\n formatLabel: this.props.formatLabel,\n style: thdLabelStyle,\n type: 'thd' },\n thdLabelVal\n )\n )\n ),\n _react2.default.createElement(\n _track2.default,\n {\n classNames: this.props.classNames,\n draggableTrack: this.props.draggableTrack,\n ref: function ref(trackNode) {\n _this5.trackNode = trackNode;\n },\n percentages: percentages,\n onTrackDrag: this.handleTrackDrag,\n onTrackMouseDown: this.handleTrackMouseDown },\n this.renderSliders()\n ),\n (0, _utils.isNumber)(this.props.value) && _react2.default.createElement(\n 'div',\n { className: 'InactiveCircleLabels' },\n inactiveSeq\n ),\n _react2.default.createElement(\n _label2.default,\n {\n classNames: this.props.classNames,\n formatLabel: this.props.formatLabel,\n type: 'max' },\n this.props.maxValue\n ),\n this.renderHiddenInputs()\n );\n }\n }]);\n\n return InputRange;\n}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleSliderDrag', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleSliderDrag'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTrackDrag', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTrackDrag'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleSliderKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleSliderKeyDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTrackMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTrackMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleInteractionStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleInteractionStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleInteractionEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleInteractionEnd'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchEnd'), _class.prototype)), _class);\nexports.default = InputRange;\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inputRange = __webpack_require__(10);\n\nvar _inputRange2 = _interopRequireDefault(_inputRange);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore\n * @typedef {Object} ClientRect\n * @property {number} height\n * @property {number} left\n * @property {number} top\n * @property {number} width\n */\n\n/**\n * @typedef {Object} InputRangeClassNames\n * @property {string} activeTrack\n * @property {string} disabledInputRange\n * @property {string} inputRange\n * @property {string} labelContainer\n * @property {string} maxLabel\n * @property {string} minLabel\n * @property {string} slider\n * @property {string} sliderContainer\n * @property {string} track\n * @property {string} valueLabel\n */\n\n/**\n * @typedef {Function} LabelFormatter\n * @param {number} value\n * @param {string} type\n * @return {string}\n */\n\n/**\n * @ignore\n * @typedef {Object} Point\n * @property {number} x\n * @property {number} y\n */\n\n/**\n * @typedef {Object} Range\n * @property {number} min - Min value\n * @property {number} max - Max value\n */\n\nexports.default = _inputRange2.default;\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n * Default CSS class names\n * @ignore\n * @type {InputRangeClassNames}\n */\nvar DEFAULT_CLASS_NAMES = {\n activeTrack: 'input-range__track input-range__track--active',\n disabledInputRange: 'input-range input-range--disabled',\n inputRange: 'input-range',\n labelContainer: 'input-range__label-container',\n maxLabel: 'input-range__label input-range__label--max',\n minLabel: 'input-range__label input-range__label--min',\n fstLabel: 'input-range__label input-range__label--fst',\n sndLabel: 'input-range__label input-range__label--snd',\n thdLabel: 'input-range__label input-range__label--thd',\n sublabel: 'input-range__label--sublabel',\n inactiveCircleLabel: 'input-range__label--inactive',\n slider: 'input-range__slider',\n sliderContainer: 'input-range__slider-container',\n track: 'input-range__track input-range__track--background',\n valueLabel: 'input-range__label input-range__label--value'\n};\n\nexports.default = DEFAULT_CLASS_NAMES;\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/** @ignore */\nvar DOWN_ARROW = exports.DOWN_ARROW = 40;\n\n/** @ignore */\nvar LEFT_ARROW = exports.LEFT_ARROW = 37;\n\n/** @ignore */\nvar RIGHT_ARROW = exports.RIGHT_ARROW = 39;\n\n/** @ignore */\nvar UP_ARROW = exports.UP_ARROW = 38;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rangePropType;\n\nvar _utils = __webpack_require__(1);\n\n/**\n * @ignore\n * @param {Object} props - React component props\n * @return {?Error} Return Error if validation fails\n */\nfunction rangePropType(props) {\n var maxValue = props.maxValue,\n minValue = props.minValue;\n\n\n if (!(0, _utils.isNumber)(minValue) || !(0, _utils.isNumber)(maxValue)) {\n return new Error('\"minValue\" and \"maxValue\" must be a number');\n }\n\n if (minValue >= maxValue) {\n return new Error('\"minValue\" must be smaller than \"maxValue\"');\n }\n}\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _desc, _value, _class;\n\nvar _react = __webpack_require__(3);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(2);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _autobindDecorator = __webpack_require__(4);\n\nvar _autobindDecorator2 = _interopRequireDefault(_autobindDecorator);\n\nvar _label = __webpack_require__(7);\n\nvar _label2 = _interopRequireDefault(_label);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\n/**\n * @ignore\n */\nvar Slider = (_class = function (_React$Component) {\n _inherits(Slider, _React$Component);\n\n _createClass(Slider, null, [{\n key: 'propTypes',\n\n /**\n * Accepted propTypes of Slider\n * @override\n * @return {Object}\n * @property {Function} ariaLabelledby\n * @property {Function} ariaControls\n * @property {Function} className\n * @property {Function} formatLabel\n * @property {Function} maxValue\n * @property {Function} minValue\n * @property {Function} onSliderDrag\n * @property {Function} onSliderKeyDown\n * @property {Function} percentage\n * @property {Function} type\n * @property {Function} value\n */\n get: function get() {\n return {\n ariaLabelledby: _propTypes2.default.string,\n ariaControls: _propTypes2.default.string,\n classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired,\n formatLabel: _propTypes2.default.func,\n maxValue: _propTypes2.default.number,\n minValue: _propTypes2.default.number,\n onSliderDrag: _propTypes2.default.func.isRequired,\n onSliderKeyDown: _propTypes2.default.func.isRequired,\n percentage: _propTypes2.default.number.isRequired,\n type: _propTypes2.default.string.isRequired,\n value: _propTypes2.default.number.isRequired\n };\n }\n\n /**\n * @param {Object} props\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} [props.formatLabel]\n * @param {number} [props.maxValue]\n * @param {number} [props.minValue]\n * @param {Function} props.onSliderKeyDown\n * @param {Function} props.onSliderDrag\n * @param {number} props.percentage\n * @param {number} props.type\n * @param {number} props.value\n */\n\n }]);\n\n function Slider(props) {\n _classCallCheck(this, Slider);\n\n /**\n * @private\n * @type {?Component}\n */\n var _this = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, props));\n\n _this.node = null;\n return _this;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n\n\n _createClass(Slider, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n this.removeDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @return {Object}\n */\n\n }, {\n key: 'getStyle',\n value: function getStyle() {\n var perc = (this.props.percentage || 0) * 100;\n var style = {\n position: 'absolute',\n left: perc + '%'\n };\n\n return style;\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentMouseMoveListener',\n value: function addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentMouseUpListener',\n value: function addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchmove event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentTouchMoveListener',\n value: function addDocumentTouchMoveListener() {\n this.removeDocumentTouchMoveListener();\n this.node.ownerDocument.addEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentTouchEndListener',\n value: function addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentMouseMoveListener',\n value: function removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentMouseUpListener',\n value: function removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentTouchMoveListener',\n value: function removeDocumentTouchMoveListener() {\n this.node.ownerDocument.removeEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentTouchEndListener',\n value: function removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'handleMouseDown',\n value: function handleMouseDown() {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'handleMouseUp',\n value: function handleMouseUp() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleMouseMove',\n value: function handleMouseMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'handleTouchStart',\n value: function handleTouchStart() {\n this.addDocumentTouchEndListener();\n this.addDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleTouchMove',\n value: function handleTouchMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'handleTouchEnd',\n value: function handleTouchEnd() {\n this.removeDocumentTouchMoveListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleKeyDown',\n value: function handleKeyDown(event) {\n this.props.onSliderKeyDown(event, this.props.type);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var style = this.getStyle();\n\n return _react2.default.createElement(\n 'span',\n {\n className: this.props.classNames.sliderContainer,\n ref: function ref(node) {\n _this2.node = node;\n },\n style: style },\n _react2.default.createElement(\n _label2.default,\n {\n classNames: this.props.classNames,\n formatLabel: this.props.formatLabel,\n type: 'value' },\n this.props.value\n ),\n _react2.default.createElement('div', {\n 'aria-labelledby': this.props.ariaLabelledby,\n 'aria-controls': this.props.ariaControls,\n 'aria-valuemax': this.props.maxValue,\n 'aria-valuemin': this.props.minValue,\n 'aria-valuenow': this.props.value,\n className: this.props.classNames.slider,\n draggable: 'false',\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleMouseDown,\n onTouchStart: this.handleTouchStart,\n role: 'slider',\n tabIndex: '0' })\n );\n }\n }]);\n\n return Slider;\n}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchEnd'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyDown'), _class.prototype)), _class);\nexports.default = Slider;\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _desc, _value, _class;\n\nvar _react = __webpack_require__(3);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = __webpack_require__(2);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _autobindDecorator = __webpack_require__(4);\n\nvar _autobindDecorator2 = _interopRequireDefault(_autobindDecorator);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object['ke' + 'ys'](descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object['define' + 'Property'](target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\n/**\n * @ignore\n */\nvar Track = (_class = function (_React$Component) {\n _inherits(Track, _React$Component);\n\n _createClass(Track, null, [{\n key: 'propTypes',\n\n /**\n * @override\n * @return {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Boolean} draggableTrack\n * @property {Function} onTrackDrag\n * @property {Function} onTrackMouseDown\n * @property {Function} percentages\n */\n get: function get() {\n return {\n children: _propTypes2.default.node.isRequired,\n classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired,\n draggableTrack: _propTypes2.default.bool,\n onTrackDrag: _propTypes2.default.func,\n onTrackMouseDown: _propTypes2.default.func.isRequired,\n percentages: _propTypes2.default.objectOf(_propTypes2.default.number).isRequired\n };\n }\n\n /**\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Boolean} props.draggableTrack\n * @param {Function} props.onTrackDrag\n * @param {Function} props.onTrackMouseDown\n * @param {number} props.percentages\n */\n\n }]);\n\n function Track(props) {\n _classCallCheck(this, Track);\n\n /**\n * @private\n * @type {?Component}\n */\n var _this = _possibleConstructorReturn(this, (Track.__proto__ || Object.getPrototypeOf(Track)).call(this, props));\n\n _this.node = null;\n _this.trackDragEvent = null;\n return _this;\n }\n\n /**\n * @private\n * @return {ClientRect}\n */\n\n\n _createClass(Track, [{\n key: 'getClientRect',\n value: function getClientRect() {\n return this.node.getBoundingClientRect();\n }\n\n /**\n * @private\n * @return {Object} CSS styles\n */\n\n }, {\n key: 'getActiveTrackStyle',\n value: function getActiveTrackStyle() {\n var width = (this.props.percentages.max - this.props.percentages.min) * 100 + '%';\n var left = this.props.percentages.min * 100 + '%';\n\n return { left: left, width: width };\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentMouseMoveListener',\n value: function addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n\n }, {\n key: 'addDocumentMouseUpListener',\n value: function addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentMouseMoveListener',\n value: function removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'removeDocumentMouseUpListener',\n value: function removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n\n }, {\n key: 'handleMouseMove',\n value: function handleMouseMove(event) {\n if (!this.props.draggableTrack) {\n return;\n }\n\n if (this.trackDragEvent !== null) {\n this.props.onTrackDrag(event, this.trackDragEvent);\n }\n\n this.trackDragEvent = event;\n }\n\n /**\n * @private\n * @return {void}\n */\n\n }, {\n key: 'handleMouseUp',\n value: function handleMouseUp() {\n if (!this.props.draggableTrack) {\n return;\n }\n\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.trackDragEvent = null;\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n\n }, {\n key: 'handleMouseDown',\n value: function handleMouseDown(event) {\n var clientX = event.touches ? event.touches[0].clientX : event.clientX;\n var trackClientRect = this.getClientRect();\n var position = {\n x: clientX - trackClientRect.left,\n y: 0\n };\n\n this.props.onTrackMouseDown(event, position);\n\n if (this.props.draggableTrack) {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n\n }, {\n key: 'handleTouchStart',\n value: function handleTouchStart(event) {\n event.preventDefault();\n\n this.handleMouseDown(event);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var activeTrackStyle = this.getActiveTrackStyle();\n\n return _react2.default.createElement(\n 'div',\n {\n className: this.props.classNames.track,\n onMouseDown: this.handleMouseDown,\n onTouchStart: this.handleTouchStart,\n ref: function ref(node) {\n _this2.node = node;\n } },\n _react2.default.createElement('div', {\n style: activeTrackStyle,\n className: this.props.classNames.activeTrack }),\n this.props.children\n );\n }\n }]);\n\n return Track;\n}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleMouseMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype)), _class);\nexports.default = Track;\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = valuePropType;\n\nvar _utils = __webpack_require__(1);\n\n/**\n * @ignore\n * @param {Object} props\n * @return {?Error} Return Error if validation fails\n */\nfunction valuePropType(props, propName) {\n var maxValue = props.maxValue,\n minValue = props.minValue;\n\n var value = props[propName];\n\n if (!(0, _utils.isNumber)(value) && (!(0, _utils.isObject)(value) || !(0, _utils.isNumber)(value.min) || !(0, _utils.isNumber)(value.max))) {\n return new Error('\"' + propName + '\" must be a number or a range object');\n }\n\n if ((0, _utils.isNumber)(value) && (value < minValue || value > maxValue)) {\n return new Error('\"' + propName + '\" must be in between \"minValue\" and \"maxValue\"');\n }\n\n if ((0, _utils.isObject)(value) && (value.min < minValue || value.min > maxValue || value.max < minValue || value.max > maxValue)) {\n return new Error('\"' + propName + '\" must be in between \"minValue\" and \"maxValue\"');\n }\n}\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.getPercentageFromPosition = getPercentageFromPosition;\nexports.getValueFromPosition = getValueFromPosition;\nexports.getValueFromProps = getValueFromProps;\nexports.getPercentageFromValue = getPercentageFromValue;\nexports.getPercentagesFromValues = getPercentagesFromValues;\nexports.getPositionFromValue = getPositionFromValue;\nexports.getPositionsFromValues = getPositionsFromValues;\nexports.getPositionFromEvent = getPositionFromEvent;\nexports.getStepValueFromValue = getStepValueFromValue;\n\nvar _utils = __webpack_require__(1);\n\n/**\n * Convert a point into a percentage value\n * @ignore\n * @param {Point} position\n * @param {ClientRect} clientRect\n * @return {number} Percentage value\n */\nfunction getPercentageFromPosition(position, clientRect) {\n var length = clientRect.width;\n var sizePerc = position.x / length;\n\n return sizePerc || 0;\n}\n\n/**\n * Convert a point into a model value\n * @ignore\n * @param {Point} position\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {number}\n */\nfunction getValueFromPosition(position, minValue, maxValue, clientRect) {\n var sizePerc = getPercentageFromPosition(position, clientRect);\n var valueDiff = maxValue - minValue;\n\n return minValue + valueDiff * sizePerc;\n}\n\n/**\n * Convert props into a range value\n * @ignore\n * @param {Object} props\n * @param {boolean} isMultiValue\n * @return {Range}\n */\nfunction getValueFromProps(props, isMultiValue) {\n if (isMultiValue) {\n return _extends({}, props.value);\n }\n\n return {\n min: props.minValue,\n max: props.value\n };\n}\n\n/**\n * Convert a model value into a percentage value\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @return {number}\n */\nfunction getPercentageFromValue(value, minValue, maxValue) {\n var validValue = (0, _utils.clamp)(value, minValue, maxValue);\n var valueDiff = maxValue - minValue;\n var valuePerc = (validValue - minValue) / valueDiff;\n\n return valuePerc || 0;\n}\n\n/**\n * Convert model values into percentage values\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @return {Range}\n */\nfunction getPercentagesFromValues(values, minValue, maxValue) {\n return {\n min: getPercentageFromValue(values.min, minValue, maxValue),\n max: getPercentageFromValue(values.max, minValue, maxValue)\n };\n}\n\n/**\n * Convert a value into a point\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Point} Position\n */\nfunction getPositionFromValue(value, minValue, maxValue, clientRect) {\n var length = clientRect.width;\n var valuePerc = getPercentageFromValue(value, minValue, maxValue);\n var positionValue = valuePerc * length;\n\n return {\n x: positionValue,\n y: 0\n };\n}\n\n/**\n * Convert a range of values into points\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Range}\n */\nfunction getPositionsFromValues(values, minValue, maxValue, clientRect) {\n return {\n min: getPositionFromValue(values.min, minValue, maxValue, clientRect),\n max: getPositionFromValue(values.max, minValue, maxValue, clientRect)\n };\n}\n\n/**\n * Convert an event into a point\n * @ignore\n * @param {Event} event\n * @param {ClientRect} clientRect\n * @return {Point}\n */\nfunction getPositionFromEvent(event, clientRect) {\n var length = clientRect.width;\n\n var _ref = event.touches ? event.touches[0] : event,\n clientX = _ref.clientX;\n\n return {\n x: (0, _utils.clamp)(clientX - clientRect.left, 0, length),\n y: 0\n };\n}\n\n/**\n * Convert a value into a step value\n * @ignore\n * @param {number} value\n * @param {number} valuePerStep\n * @return {number}\n */\nfunction getStepValueFromValue(value, valuePerStep) {\n return Math.round(value / valuePerStep) * valuePerStep;\n}\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = captialize;\n/**\n * Captialize a string\n * @ignore\n * @param {string} string\n * @return {string}\n */\nfunction captialize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\nmodule.exports = exports[\"default\"];\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = clamp;\n/**\n * Clamp a value between a min and max value\n * @ignore\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @return {number}\n */\nfunction clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\nmodule.exports = exports[\"default\"];\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = distanceTo;\n/**\n * Calculate the distance between pointA and pointB\n * @ignore\n * @param {Point} pointA\n * @param {Point} pointB\n * @return {number} Distance\n */\nfunction distanceTo(pointA, pointB) {\n var xDiff = Math.pow(pointB.x - pointA.x, 2);\n var yDiff = Math.pow(pointB.y - pointA.y, 2);\n\n return Math.sqrt(xDiff + yDiff);\n}\nmodule.exports = exports[\"default\"];\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isDefined;\n/**\n * Check if a value is defined\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nmodule.exports = exports[\"default\"];\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isNumber;\n/**\n * Check if a value is a number\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nfunction isNumber(value) {\n return typeof value === 'number';\n}\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = isObject;\n/**\n * Check if a value is an object\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nfunction isObject(value) {\n return value !== null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object';\n}\nmodule.exports = exports['default'];\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = length;\n/**\n * Calculate the absolute difference between two numbers\n * @ignore\n * @param {number} numA\n * @param {number} numB\n * @return {number}\n */\nfunction length(numA, numB) {\n return Math.abs(numA - numB);\n}\nmodule.exports = exports[\"default\"];\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = __webpack_require__(6);\n var warning = __webpack_require__(8);\n var ReactPropTypesSecret = __webpack_require__(9);\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n\nvar emptyFunction = __webpack_require__(5);\nvar invariant = __webpack_require__(6);\n\nmodule.exports = function() {\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(process) {/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n\nvar emptyFunction = __webpack_require__(5);\nvar invariant = __webpack_require__(6);\nvar warning = __webpack_require__(8);\n\nvar ReactPropTypesSecret = __webpack_require__(9);\nvar checkPropTypes = __webpack_require__(26);\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// react-input-range.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 238432aff56508ce40b6","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 0\n// module chunks = 0 1","export { default as captialize } from './captialize';\nexport { default as clamp } from './clamp';\nexport { default as distanceTo } from './distance-to';\nexport { default as isDefined } from './is-defined';\nexport { default as isNumber } from './is-number';\nexport { default as isObject } from './is-object';\nexport { default as length } from './length';\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/index.js","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 2\n// module chunks = 0 1","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"amd\":\"react\",\"commonjs\":\"react\",\"commonjs2\":\"react\",\"root\":\"React\"}\n// module id = 3\n// module chunks = 0 1","/**\n * @copyright 2015, Andrey Popp <8mayday@gmail.com>\n *\n * The decorator may be used on classes or methods\n * ```\n * @autobind\n * class FullBound {}\n *\n * class PartBound {\n * @autobind\n * method () {}\n * }\n * ```\n */\n'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\nexports['default'] = autobind;\n\nfunction autobind() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 1) {\n return boundClass.apply(undefined, args);\n } else {\n return boundMethod.apply(undefined, args);\n }\n}\n\n/**\n * Use boundMethod to bind all methods on the target.prototype\n */\nfunction boundClass(target) {\n // (Using reflect to get all keys including symbols)\n var keys = undefined;\n // Use Reflect if exists\n if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') {\n keys = Reflect.ownKeys(target.prototype);\n } else {\n keys = Object.getOwnPropertyNames(target.prototype);\n // use symbols if support is provided\n if (typeof Object.getOwnPropertySymbols === 'function') {\n keys = keys.concat(Object.getOwnPropertySymbols(target.prototype));\n }\n }\n\n keys.forEach(function (key) {\n // Ignore special case target method\n if (key === 'constructor') {\n return;\n }\n\n var descriptor = Object.getOwnPropertyDescriptor(target.prototype, key);\n\n // Only methods need binding\n if (typeof descriptor.value === 'function') {\n Object.defineProperty(target.prototype, key, boundMethod(target, key, descriptor));\n }\n });\n return target;\n}\n\n/**\n * Return a descriptor removing the value and returning a getter\n * The getter will return a .bind version of the function\n * and memoize the result against a symbol on the instance\n */\nfunction boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn);\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n definingProperty = false;\n return boundFn;\n }\n };\n}\nmodule.exports = exports['default'];\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/autobind-decorator/lib/index.js\n// module id = 4\n// module chunks = 0 1","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyFunction.js\n// module id = 5\n// module chunks = 0 1","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/invariant.js\n// module id = 6\n// module chunks = 0 1","import React from 'react';\nimport PropTypes from 'prop-types';\n\n/**\n * @ignore\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} props.formatLabel\n * @param {string} props.type\n */\nexport default function Label(props) {\n const labelValue = props.formatLabel ? props.formatLabel(props.children, props.type) : props.children;\n\n return (\n \n \n {labelValue}\n \n \n );\n}\n\n/**\n * @type {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Function} formatLabel\n * @property {Function} type\n */\nLabel.propTypes = {\n children: PropTypes.node.isRequired,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n formatLabel: PropTypes.func,\n type: PropTypes.string.isRequired,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/label.jsx","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n (function () {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n })();\n}\n\nmodule.exports = warning;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/warning.js\n// module id = 8\n// module chunks = 0 1","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 9\n// module chunks = 0 1","import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\nimport * as valueTransformer from './value-transformer';\nimport DEFAULT_CLASS_NAMES from './default-class-names';\nimport Label from './label';\nimport rangePropType from './range-prop-type';\nimport valuePropType from './value-prop-type';\nimport Slider from './slider';\nimport Track from './track';\nimport { captialize, distanceTo, isDefined, isObject, length, isNumber } from '../utils';\nimport { DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, UP_ARROW } from './key-codes';\n\n/**\n * A React component that allows users to input numeric values within a range\n * by dragging its sliders.\n */\nexport default class InputRange extends React.Component {\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n static get propTypes() {\n return {\n allowSameValues: PropTypes.bool,\n ariaLabelledby: PropTypes.string,\n ariaControls: PropTypes.string,\n classNames: PropTypes.objectOf(PropTypes.string),\n disabled: PropTypes.bool,\n draggableTrack: PropTypes.bool,\n formatLabel: PropTypes.func,\n maxValue: rangePropType,\n minValue: rangePropType,\n name: PropTypes.string,\n onChangeStart: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n onChangeComplete: PropTypes.func,\n step: PropTypes.number,\n value: valuePropType,\n renderSubLabels: PropTypes.bool,\n };\n }\n\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n static get defaultProps() {\n return {\n allowSameValues: false,\n classNames: DEFAULT_CLASS_NAMES,\n disabled: false,\n maxValue: 10,\n minValue: 0,\n step: 1,\n renderSubLabels: false,\n };\n }\n\n /**\n * @param {Object} props\n * @param {boolean} [props.allowSameValues]\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} [props.classNames]\n * @param {boolean} [props.disabled = false]\n * @param {Function} [props.formatLabel]\n * @param {number|Range} [props.maxValue = 10]\n * @param {number|Range} [props.minValue = 0]\n * @param {string} [props.name]\n * @param {string} props.onChange\n * @param {Function} [props.onChangeComplete]\n * @param {Function} [props.onChangeStart]\n * @param {number} [props.step = 1]\n * @param {number|Range} props.value\n * @param {boolean} props.renderSubLabels\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?number}\n */\n this.startValue = null;\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n\n /**\n * @private\n * @type {?Component}\n */\n this.trackNode = null;\n\n /**\n * @private\n * @type {bool}\n */\n this.isSliderDragging = false;\n\n /**\n * @private\n * @type {?string}\n */\n this.lastKeyMoved = null;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n componentWillUnmount() {\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return the CSS class name of the component\n * @private\n * @return {string}\n */\n getComponentClassName() {\n if (!this.props.disabled) {\n return this.props.classNames.inputRange;\n }\n\n return this.props.classNames.disabledInputRange;\n }\n\n /**\n * Return the bounding rect of the track\n * @private\n * @return {ClientRect}\n */\n getTrackClientRect() {\n return this.trackNode.getClientRect();\n }\n\n /**\n * Return the slider key closest to a point\n * @private\n * @param {Point} position\n * @return {string}\n */\n getKeyByPosition(position) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n if (this.isMultiValue()) {\n const distanceToMin = distanceTo(position, positions.min);\n const distanceToMax = distanceTo(position, positions.max);\n\n if (distanceToMin < distanceToMax) {\n return 'min';\n }\n }\n\n return 'max';\n }\n\n /**\n * Return all the slider keys\n * @private\n * @return {string[]}\n */\n getKeys() {\n if (this.isMultiValue()) {\n return ['min', 'max'];\n }\n\n return ['max'];\n }\n\n /**\n * @private\n * @return {Object}\n */\n getStyle(val) {\n const { maxValue, minValue } = this.props;\n const perc = ((val - minValue) / (maxValue - minValue)) * 100;\n const style = {\n position: 'absolute',\n left: `${perc}%`,\n };\n\n return style;\n }\n\n /**\n * Return true if the difference between the new and the current value is\n * greater or equal to the step amount of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n hasStepDifference(values) {\n const currentValues = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n return length(values.min, currentValues.min) >= this.props.step ||\n length(values.max, currentValues.max) >= this.props.step;\n }\n\n /**\n * Return true if the component accepts a min and max value\n * @private\n * @return {boolean}\n */\n isMultiValue() {\n return isObject(this.props.value);\n }\n\n /**\n * Return true if the range is within the max and min value of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n isWithinRange(values) {\n if (this.isMultiValue()) {\n return values.min >= this.props.minValue &&\n values.max <= this.props.maxValue &&\n this.props.allowSameValues\n ? values.min <= values.max\n : values.min < values.max;\n }\n\n return values.max >= this.props.minValue && values.max <= this.props.maxValue;\n }\n\n /**\n * Return true if the new value should trigger a render\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n shouldUpdate(values) {\n return this.isWithinRange(values) && this.hasStepDifference(values);\n }\n\n /**\n * Update the position of a slider\n * @private\n * @param {string} key\n * @param {Point} position\n * @return {void}\n */\n updatePosition(key, position) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n positions[key] = position;\n this.lastKeyMoved = key;\n\n this.updatePositions(positions);\n }\n\n /**\n * Update the positions of multiple sliders\n * @private\n * @param {Object} positions\n * @param {Point} positions.min\n * @param {Point} positions.max\n * @return {void}\n */\n updatePositions(positions) {\n const values = {\n min: valueTransformer.getValueFromPosition(positions.min, this.props.minValue, this.props.maxValue, this.getTrackClientRect()),\n max: valueTransformer.getValueFromPosition(positions.max, this.props.minValue, this.props.maxValue, this.getTrackClientRect()),\n };\n\n const transformedValues = {\n min: valueTransformer.getStepValueFromValue(values.min, this.props.step),\n max: valueTransformer.getStepValueFromValue(values.max, this.props.step),\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Update the value of a slider\n * @private\n * @param {string} key\n * @param {number} value\n * @return {void}\n */\n updateValue(key, value) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n values[key] = value;\n\n this.updateValues(values);\n }\n\n /**\n * Update the values of multiple sliders\n * @private\n * @param {Range|number} values\n * @return {void}\n */\n updateValues(values) {\n if (!this.shouldUpdate(values)) {\n return;\n }\n\n this.props.onChange(this.isMultiValue() ? values : values.max);\n }\n\n /**\n * Increment the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n incrementValue(key) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const value = values[key] + this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Decrement the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n decrementValue(key) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const value = values[key] - this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Stop listening to mouseup event\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Stop listening to touchend event\n * @private\n * @return {void}\n */\n removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Handle any \"mousemove\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n @autobind\n handleSliderDrag(event, key) {\n if (this.props.disabled) {\n return;\n }\n\n const position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n this.isSliderDragging = true;\n requestAnimationFrame(() => this.updatePosition(key, position));\n }\n\n /**\n * Handle any \"mousemove\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTrackDrag(event, prevEvent) {\n if (this.props.disabled || !this.props.draggableTrack || this.isSliderDragging) {\n return;\n }\n\n const {\n maxValue,\n minValue,\n value: { max, min },\n } = this.props;\n\n const position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n const value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n const stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n const prevPosition = valueTransformer.getPositionFromEvent(prevEvent, this.getTrackClientRect());\n const prevValue = valueTransformer.getValueFromPosition(prevPosition, minValue, maxValue, this.getTrackClientRect());\n const prevStepValue = valueTransformer.getStepValueFromValue(prevValue, this.props.step);\n\n const offset = prevStepValue - stepValue;\n\n const transformedValues = {\n min: min - offset,\n max: max - offset,\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Handle any \"keydown\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n @autobind\n handleSliderKeyDown(event, key) {\n if (this.props.disabled) {\n return;\n }\n\n switch (event.keyCode) {\n case LEFT_ARROW:\n case DOWN_ARROW:\n event.preventDefault();\n this.decrementValue(key);\n break;\n\n case RIGHT_ARROW:\n case UP_ARROW:\n event.preventDefault();\n this.incrementValue(key);\n break;\n\n default:\n break;\n }\n }\n\n /**\n * Handle any \"mousedown\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @param {Point} position\n * @return {void}\n */\n @autobind\n handleTrackMouseDown(event, position) {\n if (this.props.disabled) {\n return;\n }\n\n const {\n maxValue,\n minValue,\n value: { max, min },\n } = this.props;\n\n event.preventDefault();\n\n const value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n const stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n if (!this.props.draggableTrack || stepValue > max || stepValue < min) {\n this.updatePosition(this.getKeyByPosition(position), position);\n }\n }\n\n /**\n * Handle the start of any mouse/touch event\n * @private\n * @return {void}\n */\n @autobind\n handleInteractionStart() {\n if (this.props.onChangeStart) {\n this.props.onChangeStart(this.props.value);\n }\n\n if (this.props.onChangeComplete && !isDefined(this.startValue)) {\n this.startValue = this.props.value;\n }\n }\n\n /**\n * Handle the end of any mouse/touch event\n * @private\n * @return {void}\n */\n @autobind\n handleInteractionEnd() {\n if (this.isSliderDragging) {\n this.isSliderDragging = false;\n }\n\n if (!this.props.onChangeComplete || !isDefined(this.startValue)) {\n return;\n }\n\n if (this.startValue !== this.props.value) {\n this.props.onChangeComplete(this.props.value);\n }\n\n this.startValue = null;\n }\n\n /**\n * Handle any \"keydown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyDown(event) {\n this.handleInteractionStart(event);\n }\n\n /**\n * Handle any \"keyup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyUp(event) {\n this.handleInteractionEnd(event);\n }\n\n /**\n * Handle any \"mousedown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseDown(event) {\n this.handleInteractionStart(event);\n this.addDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"mouseup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n @autobind\n handleMouseUp(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"touchstart\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTouchStart(event) {\n this.handleInteractionStart(event);\n this.addDocumentTouchEndListener();\n }\n\n /**\n * Handle any \"touchend\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n @autobind\n handleTouchEnd(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return JSX of sliders\n * @private\n * @return {JSX.Element}\n */\n renderSliders() {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n const keys = this.props.allowSameValues &&\n this.lastKeyMoved === 'min'\n ? this.getKeys().reverse()\n : this.getKeys();\n\n return keys.map((key) => {\n const value = values[key];\n const percentage = percentages[key];\n\n let { maxValue, minValue } = this.props;\n\n if (key === 'min') {\n maxValue = values.max;\n } else {\n minValue = values.min;\n }\n\n const slider = (\n \n );\n\n return slider;\n });\n }\n\n /**\n * Return JSX of hidden inputs\n * @private\n * @return {JSX.Element}\n */\n renderHiddenInputs() {\n if (!this.props.name) {\n return [];\n }\n\n const isMultiValue = this.isMultiValue();\n const values = valueTransformer.getValueFromProps(this.props, isMultiValue);\n\n return this.getKeys().map((key) => {\n const value = values[key];\n const name = isMultiValue ? `${this.props.name}${captialize(key)}` : this.props.name;\n\n return (\n \n );\n });\n }\n\n /**\n * @ignore\n * @override\n * @return {JSX.Element}\n */\n render() {\n const componentClassName = this.getComponentClassName();\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n\n let fstLabelVal = 0;\n let sndLabelVal = 0;\n let thdLabelVal = 0;\n let fstLabelStyle = {};\n let sndLabelStyle = {};\n let thdLabelStyle = {};\n\n if (this.props.renderSubLabels) {\n fstLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 1) + this.props.minValue;\n sndLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 2) + this.props.minValue;\n thdLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 3) + this.props.minValue;\n\n fstLabelStyle = this.getStyle(fstLabelVal);\n sndLabelStyle = this.getStyle(sndLabelVal);\n thdLabelStyle = this.getStyle(thdLabelVal);\n }\n\n const inactiveSeqValues = [];\n let inactiveSeq = null;\n if (isNumber(this.props.value)) {\n for (let i = this.props.value; i < this.props.maxValue; i++) {\n inactiveSeqValues.push(i);\n }\n inactiveSeq = inactiveSeqValues.map((value) => {\n const style = this.getStyle(value);\n return
;\n });\n }\n\n return (\n { this.node = node; }}\n className={componentClassName}\n onKeyDown={this.handleKeyDown}\n onKeyUp={this.handleKeyUp}\n onMouseDown={this.handleMouseDown}\n onTouchStart={this.handleTouchStart}>\n \n {this.props.minValue}\n \n\n {this.props.renderSubLabels &&\n
\n \n \n {fstLabelVal}\n \n \n\n \n \n {sndLabelVal}\n \n \n\n \n \n {thdLabelVal}\n \n \n
\n }\n\n { this.trackNode = trackNode; }}\n percentages={percentages}\n onTrackDrag={this.handleTrackDrag}\n onTrackMouseDown={this.handleTrackMouseDown}>\n\n {this.renderSliders()}\n \n\n {isNumber(this.props.value) &&\n
\n {inactiveSeq}\n
\n }\n\n \n {this.props.maxValue}\n \n\n {this.renderHiddenInputs()}\n
\n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/input-range.jsx","import InputRange from './input-range/input-range';\n\n/**\n * @ignore\n * @typedef {Object} ClientRect\n * @property {number} height\n * @property {number} left\n * @property {number} top\n * @property {number} width\n */\n\n/**\n * @typedef {Object} InputRangeClassNames\n * @property {string} activeTrack\n * @property {string} disabledInputRange\n * @property {string} inputRange\n * @property {string} labelContainer\n * @property {string} maxLabel\n * @property {string} minLabel\n * @property {string} slider\n * @property {string} sliderContainer\n * @property {string} track\n * @property {string} valueLabel\n */\n\n/**\n * @typedef {Function} LabelFormatter\n * @param {number} value\n * @param {string} type\n * @return {string}\n */\n\n/**\n * @ignore\n * @typedef {Object} Point\n * @property {number} x\n * @property {number} y\n */\n\n/**\n * @typedef {Object} Range\n * @property {number} min - Min value\n * @property {number} max - Max value\n */\n\nexport default InputRange;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/index.js","/**\n * Default CSS class names\n * @ignore\n * @type {InputRangeClassNames}\n */\nconst DEFAULT_CLASS_NAMES = {\n activeTrack: 'input-range__track input-range__track--active',\n disabledInputRange: 'input-range input-range--disabled',\n inputRange: 'input-range',\n labelContainer: 'input-range__label-container',\n maxLabel: 'input-range__label input-range__label--max',\n minLabel: 'input-range__label input-range__label--min',\n fstLabel: 'input-range__label input-range__label--fst',\n sndLabel: 'input-range__label input-range__label--snd',\n thdLabel: 'input-range__label input-range__label--thd',\n sublabel: 'input-range__label--sublabel',\n inactiveCircleLabel: 'input-range__label--inactive',\n slider: 'input-range__slider',\n sliderContainer: 'input-range__slider-container',\n track: 'input-range__track input-range__track--background',\n valueLabel: 'input-range__label input-range__label--value',\n};\n\nexport default DEFAULT_CLASS_NAMES;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/default-class-names.js","/** @ignore */\nexport const DOWN_ARROW = 40;\n\n/** @ignore */\nexport const LEFT_ARROW = 37;\n\n/** @ignore */\nexport const RIGHT_ARROW = 39;\n\n/** @ignore */\nexport const UP_ARROW = 38;\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/key-codes.js","import { isNumber } from '../utils';\n\n/**\n * @ignore\n * @param {Object} props - React component props\n * @return {?Error} Return Error if validation fails\n */\nexport default function rangePropType(props) {\n const { maxValue, minValue } = props;\n\n if (!isNumber(minValue) || !isNumber(maxValue)) {\n return new Error('\"minValue\" and \"maxValue\" must be a number');\n }\n\n if (minValue >= maxValue) {\n return new Error('\"minValue\" must be smaller than \"maxValue\"');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/range-prop-type.js","import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\nimport Label from './label';\n\n/**\n * @ignore\n */\nexport default class Slider extends React.Component {\n /**\n * Accepted propTypes of Slider\n * @override\n * @return {Object}\n * @property {Function} ariaLabelledby\n * @property {Function} ariaControls\n * @property {Function} className\n * @property {Function} formatLabel\n * @property {Function} maxValue\n * @property {Function} minValue\n * @property {Function} onSliderDrag\n * @property {Function} onSliderKeyDown\n * @property {Function} percentage\n * @property {Function} type\n * @property {Function} value\n */\n static get propTypes() {\n return {\n ariaLabelledby: PropTypes.string,\n ariaControls: PropTypes.string,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n formatLabel: PropTypes.func,\n maxValue: PropTypes.number,\n minValue: PropTypes.number,\n onSliderDrag: PropTypes.func.isRequired,\n onSliderKeyDown: PropTypes.func.isRequired,\n percentage: PropTypes.number.isRequired,\n type: PropTypes.string.isRequired,\n value: PropTypes.number.isRequired,\n };\n }\n\n /**\n * @param {Object} props\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} [props.formatLabel]\n * @param {number} [props.maxValue]\n * @param {number} [props.minValue]\n * @param {Function} props.onSliderKeyDown\n * @param {Function} props.onSliderDrag\n * @param {number} props.percentage\n * @param {number} props.type\n * @param {number} props.value\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n componentWillUnmount() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n this.removeDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @return {Object}\n */\n getStyle() {\n const perc = (this.props.percentage || 0) * 100;\n const style = {\n position: 'absolute',\n left: `${perc}%`,\n };\n\n return style;\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchmove event\n * @private\n * @return {void}\n */\n addDocumentTouchMoveListener() {\n this.removeDocumentTouchMoveListener();\n this.node.ownerDocument.addEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentTouchMoveListener() {\n this.node.ownerDocument.removeEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseDown() {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseUp() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleTouchStart() {\n this.addDocumentTouchEndListener();\n this.addDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTouchMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleTouchEnd() {\n this.removeDocumentTouchMoveListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyDown(event) {\n this.props.onSliderKeyDown(event, this.props.type);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n render() {\n const style = this.getStyle();\n\n return (\n { this.node = node; }}\n style={style}>\n \n {this.props.value}\n \n\n \n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/slider.jsx","import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\n\n/**\n * @ignore\n */\nexport default class Track extends React.Component {\n /**\n * @override\n * @return {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Boolean} draggableTrack\n * @property {Function} onTrackDrag\n * @property {Function} onTrackMouseDown\n * @property {Function} percentages\n */\n static get propTypes() {\n return {\n children: PropTypes.node.isRequired,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n draggableTrack: PropTypes.bool,\n onTrackDrag: PropTypes.func,\n onTrackMouseDown: PropTypes.func.isRequired,\n percentages: PropTypes.objectOf(PropTypes.number).isRequired,\n };\n }\n\n /**\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Boolean} props.draggableTrack\n * @param {Function} props.onTrackDrag\n * @param {Function} props.onTrackMouseDown\n * @param {number} props.percentages\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n this.trackDragEvent = null;\n }\n\n /**\n * @private\n * @return {ClientRect}\n */\n getClientRect() {\n return this.node.getBoundingClientRect();\n }\n\n /**\n * @private\n * @return {Object} CSS styles\n */\n getActiveTrackStyle() {\n const width = `${(this.props.percentages.max - this.props.percentages.min) * 100}%`;\n const left = `${this.props.percentages.min * 100}%`;\n\n return { left, width };\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseMove(event) {\n if (!this.props.draggableTrack) {\n return;\n }\n\n if (this.trackDragEvent !== null) {\n this.props.onTrackDrag(event, this.trackDragEvent);\n }\n\n this.trackDragEvent = event;\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseUp() {\n if (!this.props.draggableTrack) {\n return;\n }\n\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.trackDragEvent = null;\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n @autobind\n handleMouseDown(event) {\n const clientX = event.touches ? event.touches[0].clientX : event.clientX;\n const trackClientRect = this.getClientRect();\n const position = {\n x: clientX - trackClientRect.left,\n y: 0,\n };\n\n this.props.onTrackMouseDown(event, position);\n\n if (this.props.draggableTrack) {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n @autobind\n handleTouchStart(event) {\n event.preventDefault();\n\n this.handleMouseDown(event);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n render() {\n const activeTrackStyle = this.getActiveTrackStyle();\n\n return (\n { this.node = node; }}>\n \n {this.props.children}\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/track.jsx","import { isNumber, isObject } from '../utils';\n\n/**\n * @ignore\n * @param {Object} props\n * @return {?Error} Return Error if validation fails\n */\nexport default function valuePropType(props, propName) {\n const { maxValue, minValue } = props;\n const value = props[propName];\n\n if (!isNumber(value) && (!isObject(value) || !isNumber(value.min) || !isNumber(value.max))) {\n return new Error(`\"${propName}\" must be a number or a range object`);\n }\n\n if (isNumber(value) && (value < minValue || value > maxValue)) {\n return new Error(`\"${propName}\" must be in between \"minValue\" and \"maxValue\"`);\n }\n\n if (isObject(value) && (value.min < minValue || value.min > maxValue || value.max < minValue || value.max > maxValue)) {\n return new Error(`\"${propName}\" must be in between \"minValue\" and \"maxValue\"`);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/value-prop-type.js","import { clamp } from '../utils';\n\n/**\n * Convert a point into a percentage value\n * @ignore\n * @param {Point} position\n * @param {ClientRect} clientRect\n * @return {number} Percentage value\n */\nexport function getPercentageFromPosition(position, clientRect) {\n const length = clientRect.width;\n const sizePerc = position.x / length;\n\n return sizePerc || 0;\n}\n\n/**\n * Convert a point into a model value\n * @ignore\n * @param {Point} position\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {number}\n */\nexport function getValueFromPosition(position, minValue, maxValue, clientRect) {\n const sizePerc = getPercentageFromPosition(position, clientRect);\n const valueDiff = maxValue - minValue;\n\n return minValue + (valueDiff * sizePerc);\n}\n\n/**\n * Convert props into a range value\n * @ignore\n * @param {Object} props\n * @param {boolean} isMultiValue\n * @return {Range}\n */\nexport function getValueFromProps(props, isMultiValue) {\n if (isMultiValue) {\n return { ...props.value };\n }\n\n return {\n min: props.minValue,\n max: props.value,\n };\n}\n\n/**\n * Convert a model value into a percentage value\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @return {number}\n */\nexport function getPercentageFromValue(value, minValue, maxValue) {\n const validValue = clamp(value, minValue, maxValue);\n const valueDiff = maxValue - minValue;\n const valuePerc = (validValue - minValue) / valueDiff;\n\n return valuePerc || 0;\n}\n\n/**\n * Convert model values into percentage values\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @return {Range}\n */\nexport function getPercentagesFromValues(values, minValue, maxValue) {\n return {\n min: getPercentageFromValue(values.min, minValue, maxValue),\n max: getPercentageFromValue(values.max, minValue, maxValue),\n };\n}\n\n/**\n * Convert a value into a point\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Point} Position\n */\nexport function getPositionFromValue(value, minValue, maxValue, clientRect) {\n const length = clientRect.width;\n const valuePerc = getPercentageFromValue(value, minValue, maxValue);\n const positionValue = valuePerc * length;\n\n return {\n x: positionValue,\n y: 0,\n };\n}\n\n/**\n * Convert a range of values into points\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Range}\n */\nexport function getPositionsFromValues(values, minValue, maxValue, clientRect) {\n return {\n min: getPositionFromValue(values.min, minValue, maxValue, clientRect),\n max: getPositionFromValue(values.max, minValue, maxValue, clientRect),\n };\n}\n\n/**\n * Convert an event into a point\n * @ignore\n * @param {Event} event\n * @param {ClientRect} clientRect\n * @return {Point}\n */\nexport function getPositionFromEvent(event, clientRect) {\n const length = clientRect.width;\n const { clientX } = event.touches ? event.touches[0] : event;\n\n return {\n x: clamp(clientX - clientRect.left, 0, length),\n y: 0,\n };\n}\n\n/**\n * Convert a value into a step value\n * @ignore\n * @param {number} value\n * @param {number} valuePerStep\n * @return {number}\n */\nexport function getStepValueFromValue(value, valuePerStep) {\n return Math.round(value / valuePerStep) * valuePerStep;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/input-range/value-transformer.js","/**\n * Captialize a string\n * @ignore\n * @param {string} string\n * @return {string}\n */\nexport default function captialize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/captialize.js","/**\n * Clamp a value between a min and max value\n * @ignore\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @return {number}\n */\nexport default function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/clamp.js","/**\n * Calculate the distance between pointA and pointB\n * @ignore\n * @param {Point} pointA\n * @param {Point} pointB\n * @return {number} Distance\n */\nexport default function distanceTo(pointA, pointB) {\n const xDiff = (pointB.x - pointA.x) ** 2;\n const yDiff = (pointB.y - pointA.y) ** 2;\n\n return Math.sqrt(xDiff + yDiff);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/distance-to.js","/**\n * Check if a value is defined\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isDefined(value) {\n return value !== undefined && value !== null;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/is-defined.js","/**\n * Check if a value is a number\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isNumber(value) {\n return typeof value === 'number';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/is-number.js","/**\n * Check if a value is an object\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isObject(value) {\n return value !== null && typeof value === 'object';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/is-object.js","/**\n * Calculate the absolute difference between two numbers\n * @ignore\n * @param {number} numA\n * @param {number} numB\n * @return {number}\n */\nexport default function length(numA, numB) {\n return Math.abs(numA - numB);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/utils/length.js","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/checkPropTypes.js\n// module id = 26\n// module chunks = 0 1","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\n\nmodule.exports = function() {\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithThrowingShims.js\n// module id = 27\n// module chunks = 0 1","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithTypeCheckers.js\n// module id = 28\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/css/index.css b/lib/css/index.css new file mode 100644 index 0000000..316db96 --- /dev/null +++ b/lib/css/index.css @@ -0,0 +1,104 @@ +.input-range__slider { + appearance: none; + background: #0052f3; + border: 5px solid #5790ff; + border-radius: 100%; + cursor: pointer; + display: block; + height: 1rem; + margin-left: -0.5rem; + margin-top: -0.65rem; + outline: none; + position: relative; + top: -7px; + transition: transform 0.3s ease-out, box-shadow 0.3s ease-out; + width: 1rem; + z-index: 10; } + .input-range__slider:active { + transform: scale(1.3); } + .input-range__slider:focus { + box-shadow: 0 0 0 5px rgba(0, 82, 243, 0.2); } + .input-range--disabled .input-range__slider { + background: #cccccc; + border: 1px solid #cccccc; + box-shadow: none; + transform: none; } + +.input-range__slider-container { + transition: left 0.3s ease-out; } + +.input-range__label { + color: #082865; + font-family: "Helvetica Neue", san-serif; + font-size: 12px; + font-weight: 500; + transform: translateZ(0); + white-space: nowrap; } + +.input-range__label--min, +.input-range__label--max, +.input-range__label--fst, +.input-range__label--snd, +.input-range__label--thd { + bottom: -1.4rem; + position: absolute; } + +.input-range__label--sublabel { + height: 1rem; } + +.input-range__label--min { + left: 0; } + +.input-range__label--max { + right: 0; } + +.input-range__label--value { + position: absolute; + top: -1.8rem; + display: none; } + +.input-range__label--inactive { + background-color: #e0e7f1; + border-radius: 100%; + width: 7px; + height: 7px; + top: 28%; + pointer-events: none; } + +.input-range__label-container { + left: -50%; + position: relative; } + .input-range__label--max .input-range__label-container { + left: 50%; } + +.input-range__track { + background: #eeeeee; + border-radius: 0.3rem; + cursor: pointer; + display: block; + height: 0.3rem; + position: relative; + transition: left 0.3s ease-out, width 0.3s ease-out; } + .input-range--disabled .input-range__track { + background: #eeeeee; } + +.input-range__track--background { + left: 0; + margin-top: -0.15rem; + position: absolute; + right: 0; + top: 50%; } + +.input-range__track--active { + background-color: rgba(162, 193, 255, 0.93); + height: 7px; + position: relative; + top: -2px; + z-index: 10; } + +.input-range { + height: 1rem; + position: relative; + width: 100%; } + +/*# sourceMappingURL=index.css.map */ \ No newline at end of file diff --git a/lib/css/index.css.map b/lib/css/index.css.map new file mode 100644 index 0000000..439fbe4 --- /dev/null +++ b/lib/css/index.css.map @@ -0,0 +1,15 @@ +{ + "version": 3, + "file": "index.css", + "sources": [ + "../../src/scss/index.scss", + "../../src/scss/input-range/input-range.scss", + "../../src/scss/input-range/_input-range-variables.scss", + "../../src/scss/input-range/_input-range-slider.scss", + "../../src/scss/input-range/_input-range-label.scss", + "../../src/scss/input-range/_input-range-label-container.scss", + "../../src/scss/input-range/_input-range-track.scss" + ], + "names": [], + "mappings": "AGAA,AAAA,oBAAoB,CAAC;EACnB,UAAU,EAAE,IAAI;EAChB,UAAU,EDKoB,OAAO;ECJrC,MAAM,EDKoB,GAAG,CAAC,KAAK,CAAC,OAAO;ECJ3C,aAAa,EAAE,IAAI;EACnB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,KAAK;EACd,MAAM,EDIoB,IAAI;ECH9B,WAAW,EAAE,OAA8B;EAC3C,UAAU,EAAE,QAAgE;EAC5E,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,IAAI;EACT,UAAU,EDAoB,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ;ECC/E,KAAK,EDFoB,IAAI;ECG7B,OAAO,EAAE,EAAE,GAgBZ;EA/BD,AAiBE,oBAjBkB,AAiBlB,OAAQ,CAAC;IACP,SAAS,EDHyB,UAAU,GCI7C;EAnBH,AAqBE,oBArBkB,AAqBlB,MAAO,CAAC;IACN,UAAU,E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,QAAQ,GAKnB;EAHC,AAAyB,wBAAD,CAJ1B,6BAA6B,CAIA;IACzB,IAAI,EAAE,GAAG,GACV;;ACNH,AAAA,mBAAmB,CAAC;EAClB,UAAU,EJEsB,OAAO;EIDvC,aAAa,EJyBY,MAAM;EIxB/B,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,KAAK;EACd,MAAM,EJsBmB,MAAM;EIrB/B,QAAQ,EAAE,QAAQ;EAClB,UAAU,EJqBmB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,GIhBrE;EAHC,AAAuB,sBAAD,CATxB,mBAAmB,CASQ;IACvB,UAAU,EJPoB,OAAO,GIQtC;;AAGH,AAAA,+BAA+B,CAAC;EAC9B,IAAI,EAAE,CAAC;EACP,UAAU,EAAE,QAAgC;EAC5C,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,CAAC;EACR,GAAG,EAAE,GAAG,GACT;;AAED,AAAA,2BAA2B,CAAC;EAC1B,gBAAgB,EJOoB,yBAAyB;EIN7D,MAAM,EAAE,GAAG;EACX,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,IAAI;EACT,OAAO,EAAE,EAAE,GACZ;;ALtBD,AAAA,YAAY,CAAC;EACX,MAAM,ECIoB,IAAI;EDH9B,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI,GACZ" +} \ No newline at end of file diff --git a/lib/css/input-range/input-range.css b/lib/css/input-range/input-range.css new file mode 100644 index 0000000..c8bd0cf --- /dev/null +++ b/lib/css/input-range/input-range.css @@ -0,0 +1,104 @@ +.input-range__slider { + appearance: none; + background: #0052f3; + border: 5px solid #5790ff; + border-radius: 100%; + cursor: pointer; + display: block; + height: 1rem; + margin-left: -0.5rem; + margin-top: -0.65rem; + outline: none; + position: relative; + top: -7px; + transition: transform 0.3s ease-out, box-shadow 0.3s ease-out; + width: 1rem; + z-index: 10; } + .input-range__slider:active { + transform: scale(1.3); } + .input-range__slider:focus { + box-shadow: 0 0 0 5px rgba(0, 82, 243, 0.2); } + .input-range--disabled .input-range__slider { + background: #cccccc; + border: 1px solid #cccccc; + box-shadow: none; + transform: none; } + +.input-range__slider-container { + transition: left 0.3s ease-out; } + +.input-range__label { + color: #082865; + font-family: "Helvetica Neue", san-serif; + font-size: 12px; + font-weight: 500; + transform: translateZ(0); + white-space: nowrap; } + +.input-range__label--min, +.input-range__label--max, +.input-range__label--fst, +.input-range__label--snd, +.input-range__label--thd { + bottom: -1.4rem; + position: absolute; } + +.input-range__label--sublabel { + height: 1rem; } + +.input-range__label--min { + left: 0; } + +.input-range__label--max { + right: 0; } + +.input-range__label--value { + position: absolute; + top: -1.8rem; + display: none; } + +.input-range__label--inactive { + background-color: #e0e7f1; + border-radius: 100%; + width: 7px; + height: 7px; + top: 28%; + pointer-events: none; } + +.input-range__label-container { + left: -50%; + position: relative; } + .input-range__label--max .input-range__label-container { + left: 50%; } + +.input-range__track { + background: #eeeeee; + border-radius: 0.3rem; + cursor: pointer; + display: block; + height: 0.3rem; + position: relative; + transition: left 0.3s ease-out, width 0.3s ease-out; } + .input-range--disabled .input-range__track { + background: #eeeeee; } + +.input-range__track--background { + left: 0; + margin-top: -0.15rem; + position: absolute; + right: 0; + top: 50%; } + +.input-range__track--active { + background-color: rgba(162, 193, 255, 0.93); + height: 7px; + position: relative; + top: -2px; + z-index: 10; } + +.input-range { + height: 1rem; + position: relative; + width: 100%; } + +/*# sourceMappingURL=input-range.css.map */ \ No newline at end of file diff --git a/lib/css/input-range/input-range.css.map b/lib/css/input-range/input-range.css.map new file mode 100644 index 0000000..b0263e0 --- /dev/null +++ b/lib/css/input-range/input-range.css.map @@ -0,0 +1,14 @@ +{ + "version": 3, + "file": "input-range.css", + "sources": [ + "../../../src/scss/input-range/input-range.scss", + "../../../src/scss/input-range/_input-range-variables.scss", + "../../../src/scss/input-range/_input-range-slider.scss", + "../../../src/scss/input-range/_input-range-label.scss", + "../../../src/scss/input-range/_input-range-label-container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ClB,KAAK,EAAE,CAAC;EACR,GAAG,EAAE,GAAG,GACT;;AAED,AAAA,2BAA2B,CAAC;EAC1B,gBAAgB,EJOoB,yBAAyB;EIN7D,MAAM,EAAE,GAAG;EACX,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,IAAI;EACT,OAAO,EAAE,EAAE,GACZ;;ALtBD,AAAA,YAAY,CAAC;EACX,MAAM,ECIoB,IAAI;EDH9B,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI,GACZ" +} \ No newline at end of file diff --git a/lib/js/index.js b/lib/js/index.js new file mode 100644 index 0000000..2e2d31a --- /dev/null +++ b/lib/js/index.js @@ -0,0 +1,58 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inputRange = require('./input-range/input-range'); + +var _inputRange2 = _interopRequireDefault(_inputRange); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @ignore + * @typedef {Object} ClientRect + * @property {number} height + * @property {number} left + * @property {number} top + * @property {number} width + */ + +/** + * @typedef {Object} InputRangeClassNames + * @property {string} activeTrack + * @property {string} disabledInputRange + * @property {string} inputRange + * @property {string} labelContainer + * @property {string} maxLabel + * @property {string} minLabel + * @property {string} slider + * @property {string} sliderContainer + * @property {string} track + * @property {string} valueLabel + */ + +/** + * @typedef {Function} LabelFormatter + * @param {number} value + * @param {string} type + * @return {string} + */ + +/** + * @ignore + * @typedef {Object} Point + * @property {number} x + * @property {number} y + */ + +/** + * @typedef {Object} Range + * @property {number} min - Min value + * @property {number} max - Max value + */ + +exports.default = _inputRange2.default; +module.exports = exports['default']; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/js/index.js.map b/lib/js/index.js.map new file mode 100644 index 0000000..db86e27 --- /dev/null +++ b/lib/js/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../src/js/index.js"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAEA;;;;;;;;;AASA;;;;;;;;;;;;;;AAcA;;;;;;;AAOA;;;;;;;AAOA","file":"index.js","sourcesContent":["import InputRange from './input-range/input-range';\n\n/**\n * @ignore\n * @typedef {Object} ClientRect\n * @property {number} height\n * @property {number} left\n * @property {number} top\n * @property {number} width\n */\n\n/**\n * @typedef {Object} InputRangeClassNames\n * @property {string} activeTrack\n * @property {string} disabledInputRange\n * @property {string} inputRange\n * @property {string} labelContainer\n * @property {string} maxLabel\n * @property {string} minLabel\n * @property {string} slider\n * @property {string} sliderContainer\n * @property {string} track\n * @property {string} valueLabel\n */\n\n/**\n * @typedef {Function} LabelFormatter\n * @param {number} value\n * @param {string} type\n * @return {string}\n */\n\n/**\n * @ignore\n * @typedef {Object} Point\n * @property {number} x\n * @property {number} y\n */\n\n/**\n * @typedef {Object} Range\n * @property {number} min - Min value\n * @property {number} max - Max value\n */\n\nexport default InputRange;\n"]} \ No newline at end of file diff --git a/lib/js/input-range/default-class-names.js b/lib/js/input-range/default-class-names.js new file mode 100644 index 0000000..75a9ddc --- /dev/null +++ b/lib/js/input-range/default-class-names.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Default CSS class names + * @ignore + * @type {InputRangeClassNames} + */ +var DEFAULT_CLASS_NAMES = { + 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', + fstLabel: 'input-range__label input-range__label--fst', + sndLabel: 'input-range__label input-range__label--snd', + thdLabel: 'input-range__label input-range__label--thd', + sublabel: 'input-range__label--sublabel', + inactiveCircleLabel: 'input-range__label--inactive', + 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' +}; + +exports.default = DEFAULT_CLASS_NAMES; +module.exports = exports['default']; +//# sourceMappingURL=default-class-names.js.map \ No newline at end of file diff --git a/lib/js/input-range/default-class-names.js.map b/lib/js/input-range/default-class-names.js.map new file mode 100644 index 0000000..89d8f45 --- /dev/null +++ b/lib/js/input-range/default-class-names.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/default-class-names.js"],"names":["DEFAULT_CLASS_NAMES","activeTrack","disabledInputRange","inputRange","labelContainer","maxLabel","minLabel","fstLabel","sndLabel","thdLabel","sublabel","inactiveCircleLabel","slider","sliderContainer","track","valueLabel"],"mappings":";;;;;AAAA;;;;;AAKA,IAAMA,sBAAsB;AAC1BC,eAAa,+CADa;AAE1BC,sBAAoB,mCAFM;AAG1BC,cAAY,aAHc;AAI1BC,kBAAgB,8BAJU;AAK1BC,YAAU,4CALgB;AAM1BC,YAAU,4CANgB;AAO1BC,YAAU,4CAPgB;AAQ1BC,YAAU,4CARgB;AAS1BC,YAAU,4CATgB;AAU1BC,YAAU,8BAVgB;AAW1BC,uBAAqB,8BAXK;AAY1BC,UAAQ,qBAZkB;AAa1BC,mBAAiB,+BAbS;AAc1BC,SAAO,mDAdmB;AAe1BC,cAAY;AAfc,CAA5B;;kBAkBef,mB","file":"default-class-names.js","sourcesContent":["/**\n * Default CSS class names\n * @ignore\n * @type {InputRangeClassNames}\n */\nconst DEFAULT_CLASS_NAMES = {\n activeTrack: 'input-range__track input-range__track--active',\n disabledInputRange: 'input-range input-range--disabled',\n inputRange: 'input-range',\n labelContainer: 'input-range__label-container',\n maxLabel: 'input-range__label input-range__label--max',\n minLabel: 'input-range__label input-range__label--min',\n fstLabel: 'input-range__label input-range__label--fst',\n sndLabel: 'input-range__label input-range__label--snd',\n thdLabel: 'input-range__label input-range__label--thd',\n sublabel: 'input-range__label--sublabel',\n inactiveCircleLabel: 'input-range__label--inactive',\n slider: 'input-range__slider',\n sliderContainer: 'input-range__slider-container',\n track: 'input-range__track input-range__track--background',\n valueLabel: 'input-range__label input-range__label--value',\n};\n\nexport default DEFAULT_CLASS_NAMES;\n"]} \ No newline at end of file diff --git a/lib/js/input-range/input-range.js b/lib/js/input-range/input-range.js new file mode 100644 index 0000000..b3e1d8f --- /dev/null +++ b/lib/js/input-range/input-range.js @@ -0,0 +1,1000 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _desc, _value, _class; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _autobindDecorator = require('autobind-decorator'); + +var _autobindDecorator2 = _interopRequireDefault(_autobindDecorator); + +var _valueTransformer = require('./value-transformer'); + +var valueTransformer = _interopRequireWildcard(_valueTransformer); + +var _defaultClassNames = require('./default-class-names'); + +var _defaultClassNames2 = _interopRequireDefault(_defaultClassNames); + +var _label = require('./label'); + +var _label2 = _interopRequireDefault(_label); + +var _rangePropType = require('./range-prop-type'); + +var _rangePropType2 = _interopRequireDefault(_rangePropType); + +var _valuePropType = require('./value-prop-type'); + +var _valuePropType2 = _interopRequireDefault(_valuePropType); + +var _slider = require('./slider'); + +var _slider2 = _interopRequireDefault(_slider); + +var _track = require('./track'); + +var _track2 = _interopRequireDefault(_track); + +var _utils = require('../utils'); + +var _keyCodes = require('./key-codes'); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; +} + +/** + * A React component that allows users to input numeric values within a range + * by dragging its sliders. + */ +var InputRange = (_class = function (_React$Component) { + _inherits(InputRange, _React$Component); + + _createClass(InputRange, null, [{ + key: 'propTypes', + + /** + * @ignore + * @override + * @return {Object} + */ + get: function get() { + return { + allowSameValues: _propTypes2.default.bool, + ariaLabelledby: _propTypes2.default.string, + ariaControls: _propTypes2.default.string, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string), + disabled: _propTypes2.default.bool, + draggableTrack: _propTypes2.default.bool, + formatLabel: _propTypes2.default.func, + maxValue: _rangePropType2.default, + minValue: _rangePropType2.default, + name: _propTypes2.default.string, + onChangeStart: _propTypes2.default.func, + onChange: _propTypes2.default.func.isRequired, + onChangeComplete: _propTypes2.default.func, + step: _propTypes2.default.number, + value: _valuePropType2.default, + renderSubLabels: _propTypes2.default.bool + }; + } + + /** + * @ignore + * @override + * @return {Object} + */ + + }, { + key: 'defaultProps', + get: function get() { + return { + allowSameValues: false, + classNames: _defaultClassNames2.default, + disabled: false, + maxValue: 10, + minValue: 0, + step: 1, + renderSubLabels: false + }; + } + + /** + * @param {Object} props + * @param {boolean} [props.allowSameValues] + * @param {string} [props.ariaLabelledby] + * @param {string} [props.ariaControls] + * @param {InputRangeClassNames} [props.classNames] + * @param {boolean} [props.disabled = false] + * @param {Function} [props.formatLabel] + * @param {number|Range} [props.maxValue = 10] + * @param {number|Range} [props.minValue = 0] + * @param {string} [props.name] + * @param {string} props.onChange + * @param {Function} [props.onChangeComplete] + * @param {Function} [props.onChangeStart] + * @param {number} [props.step = 1] + * @param {number|Range} props.value + * @param {boolean} props.renderSubLabels + */ + + }]); + + function InputRange(props) { + _classCallCheck(this, InputRange); + + /** + * @private + * @type {?number} + */ + var _this = _possibleConstructorReturn(this, (InputRange.__proto__ || Object.getPrototypeOf(InputRange)).call(this, props)); + + _this.startValue = null; + + /** + * @private + * @type {?Component} + */ + _this.node = null; + + /** + * @private + * @type {?Component} + */ + _this.trackNode = null; + + /** + * @private + * @type {bool} + */ + _this.isSliderDragging = false; + + /** + * @private + * @type {?string} + */ + _this.lastKeyMoved = null; + return _this; + } + + /** + * @ignore + * @override + * @return {void} + */ + + + _createClass(InputRange, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.removeDocumentMouseUpListener(); + this.removeDocumentTouchEndListener(); + } + + /** + * Return the CSS class name of the component + * @private + * @return {string} + */ + + }, { + key: 'getComponentClassName', + value: function getComponentClassName() { + if (!this.props.disabled) { + return this.props.classNames.inputRange; + } + + return this.props.classNames.disabledInputRange; + } + + /** + * Return the bounding rect of the track + * @private + * @return {ClientRect} + */ + + }, { + key: 'getTrackClientRect', + value: function getTrackClientRect() { + return this.trackNode.getClientRect(); + } + + /** + * Return the slider key closest to a point + * @private + * @param {Point} position + * @return {string} + */ + + }, { + key: 'getKeyByPosition', + value: function getKeyByPosition(position) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect()); + + if (this.isMultiValue()) { + var distanceToMin = (0, _utils.distanceTo)(position, positions.min); + var distanceToMax = (0, _utils.distanceTo)(position, positions.max); + + if (distanceToMin < distanceToMax) { + return 'min'; + } + } + + return 'max'; + } + + /** + * Return all the slider keys + * @private + * @return {string[]} + */ + + }, { + key: 'getKeys', + value: function getKeys() { + if (this.isMultiValue()) { + return ['min', 'max']; + } + + return ['max']; + } + + /** + * @private + * @return {Object} + */ + + }, { + key: 'getStyle', + value: function getStyle(val) { + var _props = this.props, + maxValue = _props.maxValue, + minValue = _props.minValue; + + var perc = (val - minValue) / (maxValue - minValue) * 100; + var style = { + position: 'absolute', + left: perc + '%' + }; + + return style; + } + + /** + * Return true if the difference between the new and the current value is + * greater or equal to the step amount of the component + * @private + * @param {Range} values + * @return {boolean} + */ + + }, { + key: 'hasStepDifference', + value: function hasStepDifference(values) { + var currentValues = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + + return (0, _utils.length)(values.min, currentValues.min) >= this.props.step || (0, _utils.length)(values.max, currentValues.max) >= this.props.step; + } + + /** + * Return true if the component accepts a min and max value + * @private + * @return {boolean} + */ + + }, { + key: 'isMultiValue', + value: function isMultiValue() { + return (0, _utils.isObject)(this.props.value); + } + + /** + * Return true if the range is within the max and min value of the component + * @private + * @param {Range} values + * @return {boolean} + */ + + }, { + key: 'isWithinRange', + value: function isWithinRange(values) { + if (this.isMultiValue()) { + return values.min >= this.props.minValue && values.max <= this.props.maxValue && this.props.allowSameValues ? values.min <= values.max : values.min < values.max; + } + + return values.max >= this.props.minValue && values.max <= this.props.maxValue; + } + + /** + * Return true if the new value should trigger a render + * @private + * @param {Range} values + * @return {boolean} + */ + + }, { + key: 'shouldUpdate', + value: function shouldUpdate(values) { + return this.isWithinRange(values) && this.hasStepDifference(values); + } + + /** + * Update the position of a slider + * @private + * @param {string} key + * @param {Point} position + * @return {void} + */ + + }, { + key: 'updatePosition', + value: function updatePosition(key, position) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect()); + + positions[key] = position; + this.lastKeyMoved = key; + + this.updatePositions(positions); + } + + /** + * Update the positions of multiple sliders + * @private + * @param {Object} positions + * @param {Point} positions.min + * @param {Point} positions.max + * @return {void} + */ + + }, { + key: 'updatePositions', + value: function updatePositions(positions) { + var values = { + min: valueTransformer.getValueFromPosition(positions.min, this.props.minValue, this.props.maxValue, this.getTrackClientRect()), + max: valueTransformer.getValueFromPosition(positions.max, this.props.minValue, this.props.maxValue, this.getTrackClientRect()) + }; + + var transformedValues = { + min: valueTransformer.getStepValueFromValue(values.min, this.props.step), + max: valueTransformer.getStepValueFromValue(values.max, this.props.step) + }; + + this.updateValues(transformedValues); + } + + /** + * Update the value of a slider + * @private + * @param {string} key + * @param {number} value + * @return {void} + */ + + }, { + key: 'updateValue', + value: function updateValue(key, value) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + + values[key] = value; + + this.updateValues(values); + } + + /** + * Update the values of multiple sliders + * @private + * @param {Range|number} values + * @return {void} + */ + + }, { + key: 'updateValues', + value: function updateValues(values) { + if (!this.shouldUpdate(values)) { + return; + } + + this.props.onChange(this.isMultiValue() ? values : values.max); + } + + /** + * Increment the value of a slider by key name + * @private + * @param {string} key + * @return {void} + */ + + }, { + key: 'incrementValue', + value: function incrementValue(key) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var value = values[key] + this.props.step; + + this.updateValue(key, value); + } + + /** + * Decrement the value of a slider by key name + * @private + * @param {string} key + * @return {void} + */ + + }, { + key: 'decrementValue', + value: function decrementValue(key) { + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var value = values[key] - this.props.step; + + this.updateValue(key, value); + } + + /** + * Listen to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseUpListener', + value: function addDocumentMouseUpListener() { + this.removeDocumentMouseUpListener(); + this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp); + } + + /** + * Listen to touchend event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentTouchEndListener', + value: function addDocumentTouchEndListener() { + this.removeDocumentTouchEndListener(); + this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd); + } + + /** + * Stop listening to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseUpListener', + value: function removeDocumentMouseUpListener() { + this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + } + + /** + * Stop listening to touchend event + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentTouchEndListener', + value: function removeDocumentTouchEndListener() { + this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd); + } + + /** + * Handle any "mousemove" event received by the slider + * @private + * @param {SyntheticEvent} event + * @param {string} key + * @return {void} + */ + + }, { + key: 'handleSliderDrag', + value: function handleSliderDrag(event, key) { + var _this2 = this; + + if (this.props.disabled) { + return; + } + + var position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect()); + this.isSliderDragging = true; + requestAnimationFrame(function () { + return _this2.updatePosition(key, position); + }); + } + + /** + * Handle any "mousemove" event received by the track + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleTrackDrag', + value: function handleTrackDrag(event, prevEvent) { + if (this.props.disabled || !this.props.draggableTrack || this.isSliderDragging) { + return; + } + + var _props2 = this.props, + maxValue = _props2.maxValue, + minValue = _props2.minValue, + _props2$value = _props2.value, + max = _props2$value.max, + min = _props2$value.min; + + + var position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect()); + var value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect()); + var stepValue = valueTransformer.getStepValueFromValue(value, this.props.step); + + var prevPosition = valueTransformer.getPositionFromEvent(prevEvent, this.getTrackClientRect()); + var prevValue = valueTransformer.getValueFromPosition(prevPosition, minValue, maxValue, this.getTrackClientRect()); + var prevStepValue = valueTransformer.getStepValueFromValue(prevValue, this.props.step); + + var offset = prevStepValue - stepValue; + + var transformedValues = { + min: min - offset, + max: max - offset + }; + + this.updateValues(transformedValues); + } + + /** + * Handle any "keydown" event received by the slider + * @private + * @param {SyntheticEvent} event + * @param {string} key + * @return {void} + */ + + }, { + key: 'handleSliderKeyDown', + value: function handleSliderKeyDown(event, key) { + if (this.props.disabled) { + return; + } + + switch (event.keyCode) { + case _keyCodes.LEFT_ARROW: + case _keyCodes.DOWN_ARROW: + event.preventDefault(); + this.decrementValue(key); + break; + + case _keyCodes.RIGHT_ARROW: + case _keyCodes.UP_ARROW: + event.preventDefault(); + this.incrementValue(key); + break; + + default: + break; + } + } + + /** + * Handle any "mousedown" event received by the track + * @private + * @param {SyntheticEvent} event + * @param {Point} position + * @return {void} + */ + + }, { + key: 'handleTrackMouseDown', + value: function handleTrackMouseDown(event, position) { + if (this.props.disabled) { + return; + } + + var _props3 = this.props, + maxValue = _props3.maxValue, + minValue = _props3.minValue, + _props3$value = _props3.value, + max = _props3$value.max, + min = _props3$value.min; + + + event.preventDefault(); + + var value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect()); + var stepValue = valueTransformer.getStepValueFromValue(value, this.props.step); + + if (!this.props.draggableTrack || stepValue > max || stepValue < min) { + this.updatePosition(this.getKeyByPosition(position), position); + } + } + + /** + * Handle the start of any mouse/touch event + * @private + * @return {void} + */ + + }, { + key: 'handleInteractionStart', + value: function handleInteractionStart() { + if (this.props.onChangeStart) { + this.props.onChangeStart(this.props.value); + } + + if (this.props.onChangeComplete && !(0, _utils.isDefined)(this.startValue)) { + this.startValue = this.props.value; + } + } + + /** + * Handle the end of any mouse/touch event + * @private + * @return {void} + */ + + }, { + key: 'handleInteractionEnd', + value: function handleInteractionEnd() { + if (this.isSliderDragging) { + this.isSliderDragging = false; + } + + if (!this.props.onChangeComplete || !(0, _utils.isDefined)(this.startValue)) { + return; + } + + if (this.startValue !== this.props.value) { + this.props.onChangeComplete(this.props.value); + } + + this.startValue = null; + } + + /** + * Handle any "keydown" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleKeyDown', + value: function handleKeyDown(event) { + this.handleInteractionStart(event); + } + + /** + * Handle any "keyup" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleKeyUp', + value: function handleKeyUp(event) { + this.handleInteractionEnd(event); + } + + /** + * Handle any "mousedown" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleMouseDown', + value: function handleMouseDown(event) { + this.handleInteractionStart(event); + this.addDocumentMouseUpListener(); + } + + /** + * Handle any "mouseup" event received by the component + * @private + * @param {SyntheticEvent} event + */ + + }, { + key: 'handleMouseUp', + value: function handleMouseUp(event) { + this.handleInteractionEnd(event); + this.removeDocumentMouseUpListener(); + } + + /** + * Handle any "touchstart" event received by the component + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleTouchStart', + value: function handleTouchStart(event) { + this.handleInteractionStart(event); + this.addDocumentTouchEndListener(); + } + + /** + * Handle any "touchend" event received by the component + * @private + * @param {SyntheticEvent} event + */ + + }, { + key: 'handleTouchEnd', + value: function handleTouchEnd(event) { + this.handleInteractionEnd(event); + this.removeDocumentTouchEndListener(); + } + + /** + * Return JSX of sliders + * @private + * @return {JSX.Element} + */ + + }, { + key: 'renderSliders', + value: function renderSliders() { + var _this3 = this; + + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue); + var keys = this.props.allowSameValues && this.lastKeyMoved === 'min' ? this.getKeys().reverse() : this.getKeys(); + + return keys.map(function (key) { + var value = values[key]; + var percentage = percentages[key]; + + var _props4 = _this3.props, + maxValue = _props4.maxValue, + minValue = _props4.minValue; + + + if (key === 'min') { + maxValue = values.max; + } else { + minValue = values.min; + } + + var slider = _react2.default.createElement(_slider2.default, { + ariaLabelledby: _this3.props.ariaLabelledby, + ariaControls: _this3.props.ariaControls, + classNames: _this3.props.classNames, + formatLabel: _this3.props.formatLabel, + key: key, + maxValue: maxValue, + minValue: minValue, + onSliderDrag: _this3.handleSliderDrag, + onSliderKeyDown: _this3.handleSliderKeyDown, + percentage: percentage, + type: key, + value: value }); + + return slider; + }); + } + + /** + * Return JSX of hidden inputs + * @private + * @return {JSX.Element} + */ + + }, { + key: 'renderHiddenInputs', + value: function renderHiddenInputs() { + var _this4 = this; + + if (!this.props.name) { + return []; + } + + var isMultiValue = this.isMultiValue(); + var values = valueTransformer.getValueFromProps(this.props, isMultiValue); + + return this.getKeys().map(function (key) { + var value = values[key]; + var name = isMultiValue ? '' + _this4.props.name + (0, _utils.captialize)(key) : _this4.props.name; + + return _react2.default.createElement('input', { key: key, type: 'hidden', name: name, value: value }); + }); + } + + /** + * @ignore + * @override + * @return {JSX.Element} + */ + + }, { + key: 'render', + value: function render() { + var _this5 = this; + + var componentClassName = this.getComponentClassName(); + var values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); + var percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue); + + var fstLabelVal = 0; + var sndLabelVal = 0; + var thdLabelVal = 0; + var fstLabelStyle = {}; + var sndLabelStyle = {}; + var thdLabelStyle = {}; + + if (this.props.renderSubLabels) { + fstLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 1 + this.props.minValue; + sndLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 2 + this.props.minValue; + thdLabelVal = Math.round((this.props.maxValue - this.props.minValue) / 4) * 3 + this.props.minValue; + + fstLabelStyle = this.getStyle(fstLabelVal); + sndLabelStyle = this.getStyle(sndLabelVal); + thdLabelStyle = this.getStyle(thdLabelVal); + } + + var inactiveSeqValues = []; + var inactiveSeq = null; + if ((0, _utils.isNumber)(this.props.value)) { + for (var i = this.props.value; i < this.props.maxValue; i++) { + inactiveSeqValues.push(i); + } + inactiveSeq = inactiveSeqValues.map(function (value) { + var style = _this5.getStyle(value); + return _react2.default.createElement('div', { key: value, style: style, className: _this5.props.classNames.inactiveCircleLabel }); + }); + } + + return _react2.default.createElement( + 'div', + { + 'aria-disabled': this.props.disabled, + ref: function ref(node) { + _this5.node = node; + }, + className: componentClassName, + onKeyDown: this.handleKeyDown, + onKeyUp: this.handleKeyUp, + onMouseDown: this.handleMouseDown, + onTouchStart: this.handleTouchStart }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'min' }, + this.props.minValue + ), + this.props.renderSubLabels && _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'span', + { style: fstLabelStyle, className: this.props.classNames.sublabel }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'fst' }, + fstLabelVal + ) + ), + _react2.default.createElement( + 'span', + { style: sndLabelStyle, className: this.props.classNames.sublabel }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + style: sndLabelStyle, + type: 'snd' }, + sndLabelVal + ) + ), + _react2.default.createElement( + 'span', + { style: thdLabelStyle, className: this.props.classNames.sublabel }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + style: thdLabelStyle, + type: 'thd' }, + thdLabelVal + ) + ) + ), + _react2.default.createElement( + _track2.default, + { + classNames: this.props.classNames, + draggableTrack: this.props.draggableTrack, + ref: function ref(trackNode) { + _this5.trackNode = trackNode; + }, + percentages: percentages, + onTrackDrag: this.handleTrackDrag, + onTrackMouseDown: this.handleTrackMouseDown }, + this.renderSliders() + ), + (0, _utils.isNumber)(this.props.value) && _react2.default.createElement( + 'div', + { className: 'InactiveCircleLabels' }, + inactiveSeq + ), + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'max' }, + this.props.maxValue + ), + this.renderHiddenInputs() + ); + } + }]); + + return InputRange; +}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleSliderDrag', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleSliderDrag'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTrackDrag', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTrackDrag'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleSliderKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleSliderKeyDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTrackMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTrackMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleInteractionStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleInteractionStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleInteractionEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleInteractionEnd'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchEnd'), _class.prototype)), _class); +exports.default = InputRange; +module.exports = exports['default']; +//# sourceMappingURL=input-range.js.map \ No newline at end of file diff --git a/lib/js/input-range/input-range.js.map b/lib/js/input-range/input-range.js.map new file mode 100644 index 0000000..b165ed6 --- /dev/null +++ b/lib/js/input-range/input-range.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/input-range.jsx"],"names":["valueTransformer","InputRange","allowSameValues","bool","ariaLabelledby","string","ariaControls","classNames","objectOf","disabled","draggableTrack","formatLabel","func","maxValue","minValue","name","onChangeStart","onChange","isRequired","onChangeComplete","step","number","value","renderSubLabels","props","startValue","node","trackNode","isSliderDragging","lastKeyMoved","removeDocumentMouseUpListener","removeDocumentTouchEndListener","inputRange","disabledInputRange","getClientRect","position","values","getValueFromProps","isMultiValue","positions","getPositionsFromValues","getTrackClientRect","distanceToMin","min","distanceToMax","max","val","perc","style","left","currentValues","isWithinRange","hasStepDifference","key","updatePositions","getValueFromPosition","transformedValues","getStepValueFromValue","updateValues","shouldUpdate","updateValue","ownerDocument","addEventListener","handleMouseUp","handleTouchEnd","removeEventListener","event","getPositionFromEvent","requestAnimationFrame","updatePosition","prevEvent","stepValue","prevPosition","prevValue","prevStepValue","offset","keyCode","preventDefault","decrementValue","incrementValue","getKeyByPosition","handleInteractionStart","handleInteractionEnd","addDocumentMouseUpListener","addDocumentTouchEndListener","percentages","getPercentagesFromValues","keys","getKeys","reverse","map","percentage","slider","handleSliderDrag","handleSliderKeyDown","componentClassName","getComponentClassName","fstLabelVal","sndLabelVal","thdLabelVal","fstLabelStyle","sndLabelStyle","thdLabelStyle","Math","round","getStyle","inactiveSeqValues","inactiveSeq","i","push","inactiveCircleLabel","handleKeyDown","handleKeyUp","handleMouseDown","handleTouchStart","sublabel","handleTrackDrag","handleTrackMou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AAKA,SAAL,GAAiBA,SAAjB;AAA6B,aAHrD;AAIE,yBAAa0D,WAJf;AAKE,yBAAa,KAAK+B,eALpB;AAME,8BAAkB,KAAKC,oBANzB;AAQG,eAAKC,aAAL;AARH,SAhDF;AA2DG,6BAAS,KAAK9F,KAAL,CAAWF,KAApB,KACC;AAAA;AAAA,YAAK,WAAU,sBAAf;AACGqF;AADH,SA5DJ;AAiEE;AAAA;AAAA;AACE,wBAAY,KAAKnF,KAAL,CAAWjB,UADzB;AAEE,yBAAa,KAAKiB,KAAL,CAAWb,WAF1B;AAGE,kBAAK,KAHP;AAIG,eAAKa,KAAL,CAAWX;AAJd,SAjEF;AAwEG,aAAK0G,kBAAL;AAxEH,OADF;AA4ED;;;;EA5vBqC,gBAAMC,S;kBAAzBvH,U","file":"input-range.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\nimport * as valueTransformer from './value-transformer';\nimport DEFAULT_CLASS_NAMES from './default-class-names';\nimport Label from './label';\nimport rangePropType from './range-prop-type';\nimport valuePropType from './value-prop-type';\nimport Slider from './slider';\nimport Track from './track';\nimport { captialize, distanceTo, isDefined, isObject, length, isNumber } from '../utils';\nimport { DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, UP_ARROW } from './key-codes';\n\n/**\n * A React component that allows users to input numeric values within a range\n * by dragging its sliders.\n */\nexport default class InputRange extends React.Component {\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n static get propTypes() {\n return {\n allowSameValues: PropTypes.bool,\n ariaLabelledby: PropTypes.string,\n ariaControls: PropTypes.string,\n classNames: PropTypes.objectOf(PropTypes.string),\n disabled: PropTypes.bool,\n draggableTrack: PropTypes.bool,\n formatLabel: PropTypes.func,\n maxValue: rangePropType,\n minValue: rangePropType,\n name: PropTypes.string,\n onChangeStart: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n onChangeComplete: PropTypes.func,\n step: PropTypes.number,\n value: valuePropType,\n renderSubLabels: PropTypes.bool,\n };\n }\n\n /**\n * @ignore\n * @override\n * @return {Object}\n */\n static get defaultProps() {\n return {\n allowSameValues: false,\n classNames: DEFAULT_CLASS_NAMES,\n disabled: false,\n maxValue: 10,\n minValue: 0,\n step: 1,\n renderSubLabels: false,\n };\n }\n\n /**\n * @param {Object} props\n * @param {boolean} [props.allowSameValues]\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} [props.classNames]\n * @param {boolean} [props.disabled = false]\n * @param {Function} [props.formatLabel]\n * @param {number|Range} [props.maxValue = 10]\n * @param {number|Range} [props.minValue = 0]\n * @param {string} [props.name]\n * @param {string} props.onChange\n * @param {Function} [props.onChangeComplete]\n * @param {Function} [props.onChangeStart]\n * @param {number} [props.step = 1]\n * @param {number|Range} props.value\n * @param {boolean} props.renderSubLabels\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?number}\n */\n this.startValue = null;\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n\n /**\n * @private\n * @type {?Component}\n */\n this.trackNode = null;\n\n /**\n * @private\n * @type {bool}\n */\n this.isSliderDragging = false;\n\n /**\n * @private\n * @type {?string}\n */\n this.lastKeyMoved = null;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n componentWillUnmount() {\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return the CSS class name of the component\n * @private\n * @return {string}\n */\n getComponentClassName() {\n if (!this.props.disabled) {\n return this.props.classNames.inputRange;\n }\n\n return this.props.classNames.disabledInputRange;\n }\n\n /**\n * Return the bounding rect of the track\n * @private\n * @return {ClientRect}\n */\n getTrackClientRect() {\n return this.trackNode.getClientRect();\n }\n\n /**\n * Return the slider key closest to a point\n * @private\n * @param {Point} position\n * @return {string}\n */\n getKeyByPosition(position) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n if (this.isMultiValue()) {\n const distanceToMin = distanceTo(position, positions.min);\n const distanceToMax = distanceTo(position, positions.max);\n\n if (distanceToMin < distanceToMax) {\n return 'min';\n }\n }\n\n return 'max';\n }\n\n /**\n * Return all the slider keys\n * @private\n * @return {string[]}\n */\n getKeys() {\n if (this.isMultiValue()) {\n return ['min', 'max'];\n }\n\n return ['max'];\n }\n\n /**\n * @private\n * @return {Object}\n */\n getStyle(val) {\n const { maxValue, minValue } = this.props;\n const perc = ((val - minValue) / (maxValue - minValue)) * 100;\n const style = {\n position: 'absolute',\n left: `${perc}%`,\n };\n\n return style;\n }\n\n /**\n * Return true if the difference between the new and the current value is\n * greater or equal to the step amount of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n hasStepDifference(values) {\n const currentValues = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n return length(values.min, currentValues.min) >= this.props.step ||\n length(values.max, currentValues.max) >= this.props.step;\n }\n\n /**\n * Return true if the component accepts a min and max value\n * @private\n * @return {boolean}\n */\n isMultiValue() {\n return isObject(this.props.value);\n }\n\n /**\n * Return true if the range is within the max and min value of the component\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n isWithinRange(values) {\n if (this.isMultiValue()) {\n return values.min >= this.props.minValue &&\n values.max <= this.props.maxValue &&\n this.props.allowSameValues\n ? values.min <= values.max\n : values.min < values.max;\n }\n\n return values.max >= this.props.minValue && values.max <= this.props.maxValue;\n }\n\n /**\n * Return true if the new value should trigger a render\n * @private\n * @param {Range} values\n * @return {boolean}\n */\n shouldUpdate(values) {\n return this.isWithinRange(values) && this.hasStepDifference(values);\n }\n\n /**\n * Update the position of a slider\n * @private\n * @param {string} key\n * @param {Point} position\n * @return {void}\n */\n updatePosition(key, position) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const positions = valueTransformer.getPositionsFromValues(values, this.props.minValue, this.props.maxValue, this.getTrackClientRect());\n\n positions[key] = position;\n this.lastKeyMoved = key;\n\n this.updatePositions(positions);\n }\n\n /**\n * Update the positions of multiple sliders\n * @private\n * @param {Object} positions\n * @param {Point} positions.min\n * @param {Point} positions.max\n * @return {void}\n */\n updatePositions(positions) {\n const values = {\n min: valueTransformer.getValueFromPosition(positions.min, this.props.minValue, this.props.maxValue, this.getTrackClientRect()),\n max: valueTransformer.getValueFromPosition(positions.max, this.props.minValue, this.props.maxValue, this.getTrackClientRect()),\n };\n\n const transformedValues = {\n min: valueTransformer.getStepValueFromValue(values.min, this.props.step),\n max: valueTransformer.getStepValueFromValue(values.max, this.props.step),\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Update the value of a slider\n * @private\n * @param {string} key\n * @param {number} value\n * @return {void}\n */\n updateValue(key, value) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n\n values[key] = value;\n\n this.updateValues(values);\n }\n\n /**\n * Update the values of multiple sliders\n * @private\n * @param {Range|number} values\n * @return {void}\n */\n updateValues(values) {\n if (!this.shouldUpdate(values)) {\n return;\n }\n\n this.props.onChange(this.isMultiValue() ? values : values.max);\n }\n\n /**\n * Increment the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n incrementValue(key) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const value = values[key] + this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Decrement the value of a slider by key name\n * @private\n * @param {string} key\n * @return {void}\n */\n decrementValue(key) {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const value = values[key] - this.props.step;\n\n this.updateValue(key, value);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Stop listening to mouseup event\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Stop listening to touchend event\n * @private\n * @return {void}\n */\n removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * Handle any \"mousemove\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n @autobind\n handleSliderDrag(event, key) {\n if (this.props.disabled) {\n return;\n }\n\n const position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n this.isSliderDragging = true;\n requestAnimationFrame(() => this.updatePosition(key, position));\n }\n\n /**\n * Handle any \"mousemove\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTrackDrag(event, prevEvent) {\n if (this.props.disabled || !this.props.draggableTrack || this.isSliderDragging) {\n return;\n }\n\n const {\n maxValue,\n minValue,\n value: { max, min },\n } = this.props;\n\n const position = valueTransformer.getPositionFromEvent(event, this.getTrackClientRect());\n const value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n const stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n const prevPosition = valueTransformer.getPositionFromEvent(prevEvent, this.getTrackClientRect());\n const prevValue = valueTransformer.getValueFromPosition(prevPosition, minValue, maxValue, this.getTrackClientRect());\n const prevStepValue = valueTransformer.getStepValueFromValue(prevValue, this.props.step);\n\n const offset = prevStepValue - stepValue;\n\n const transformedValues = {\n min: min - offset,\n max: max - offset,\n };\n\n this.updateValues(transformedValues);\n }\n\n /**\n * Handle any \"keydown\" event received by the slider\n * @private\n * @param {SyntheticEvent} event\n * @param {string} key\n * @return {void}\n */\n @autobind\n handleSliderKeyDown(event, key) {\n if (this.props.disabled) {\n return;\n }\n\n switch (event.keyCode) {\n case LEFT_ARROW:\n case DOWN_ARROW:\n event.preventDefault();\n this.decrementValue(key);\n break;\n\n case RIGHT_ARROW:\n case UP_ARROW:\n event.preventDefault();\n this.incrementValue(key);\n break;\n\n default:\n break;\n }\n }\n\n /**\n * Handle any \"mousedown\" event received by the track\n * @private\n * @param {SyntheticEvent} event\n * @param {Point} position\n * @return {void}\n */\n @autobind\n handleTrackMouseDown(event, position) {\n if (this.props.disabled) {\n return;\n }\n\n const {\n maxValue,\n minValue,\n value: { max, min },\n } = this.props;\n\n event.preventDefault();\n\n const value = valueTransformer.getValueFromPosition(position, minValue, maxValue, this.getTrackClientRect());\n const stepValue = valueTransformer.getStepValueFromValue(value, this.props.step);\n\n if (!this.props.draggableTrack || stepValue > max || stepValue < min) {\n this.updatePosition(this.getKeyByPosition(position), position);\n }\n }\n\n /**\n * Handle the start of any mouse/touch event\n * @private\n * @return {void}\n */\n @autobind\n handleInteractionStart() {\n if (this.props.onChangeStart) {\n this.props.onChangeStart(this.props.value);\n }\n\n if (this.props.onChangeComplete && !isDefined(this.startValue)) {\n this.startValue = this.props.value;\n }\n }\n\n /**\n * Handle the end of any mouse/touch event\n * @private\n * @return {void}\n */\n @autobind\n handleInteractionEnd() {\n if (this.isSliderDragging) {\n this.isSliderDragging = false;\n }\n\n if (!this.props.onChangeComplete || !isDefined(this.startValue)) {\n return;\n }\n\n if (this.startValue !== this.props.value) {\n this.props.onChangeComplete(this.props.value);\n }\n\n this.startValue = null;\n }\n\n /**\n * Handle any \"keydown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyDown(event) {\n this.handleInteractionStart(event);\n }\n\n /**\n * Handle any \"keyup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyUp(event) {\n this.handleInteractionEnd(event);\n }\n\n /**\n * Handle any \"mousedown\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseDown(event) {\n this.handleInteractionStart(event);\n this.addDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"mouseup\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n @autobind\n handleMouseUp(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * Handle any \"touchstart\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTouchStart(event) {\n this.handleInteractionStart(event);\n this.addDocumentTouchEndListener();\n }\n\n /**\n * Handle any \"touchend\" event received by the component\n * @private\n * @param {SyntheticEvent} event\n */\n @autobind\n handleTouchEnd(event) {\n this.handleInteractionEnd(event);\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * Return JSX of sliders\n * @private\n * @return {JSX.Element}\n */\n renderSliders() {\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n const keys = this.props.allowSameValues &&\n this.lastKeyMoved === 'min'\n ? this.getKeys().reverse()\n : this.getKeys();\n\n return keys.map((key) => {\n const value = values[key];\n const percentage = percentages[key];\n\n let { maxValue, minValue } = this.props;\n\n if (key === 'min') {\n maxValue = values.max;\n } else {\n minValue = values.min;\n }\n\n const slider = (\n \n );\n\n return slider;\n });\n }\n\n /**\n * Return JSX of hidden inputs\n * @private\n * @return {JSX.Element}\n */\n renderHiddenInputs() {\n if (!this.props.name) {\n return [];\n }\n\n const isMultiValue = this.isMultiValue();\n const values = valueTransformer.getValueFromProps(this.props, isMultiValue);\n\n return this.getKeys().map((key) => {\n const value = values[key];\n const name = isMultiValue ? `${this.props.name}${captialize(key)}` : this.props.name;\n\n return (\n \n );\n });\n }\n\n /**\n * @ignore\n * @override\n * @return {JSX.Element}\n */\n render() {\n const componentClassName = this.getComponentClassName();\n const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue());\n const percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue);\n\n let fstLabelVal = 0;\n let sndLabelVal = 0;\n let thdLabelVal = 0;\n let fstLabelStyle = {};\n let sndLabelStyle = {};\n let thdLabelStyle = {};\n\n if (this.props.renderSubLabels) {\n fstLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 1) + this.props.minValue;\n sndLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 2) + this.props.minValue;\n thdLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 3) + this.props.minValue;\n\n fstLabelStyle = this.getStyle(fstLabelVal);\n sndLabelStyle = this.getStyle(sndLabelVal);\n thdLabelStyle = this.getStyle(thdLabelVal);\n }\n\n const inactiveSeqValues = [];\n let inactiveSeq = null;\n if (isNumber(this.props.value)) {\n for (let i = this.props.value; i < this.props.maxValue; i++) {\n inactiveSeqValues.push(i);\n }\n inactiveSeq = inactiveSeqValues.map((value) => {\n const style = this.getStyle(value);\n return
;\n });\n }\n\n return (\n { this.node = node; }}\n className={componentClassName}\n onKeyDown={this.handleKeyDown}\n onKeyUp={this.handleKeyUp}\n onMouseDown={this.handleMouseDown}\n onTouchStart={this.handleTouchStart}>\n \n {this.props.minValue}\n \n\n {this.props.renderSubLabels &&\n
\n \n \n {fstLabelVal}\n \n \n\n \n \n {sndLabelVal}\n \n \n\n \n \n {thdLabelVal}\n \n \n
\n }\n\n { this.trackNode = trackNode; }}\n percentages={percentages}\n onTrackDrag={this.handleTrackDrag}\n onTrackMouseDown={this.handleTrackMouseDown}>\n\n {this.renderSliders()}\n \n\n {isNumber(this.props.value) &&\n
\n {inactiveSeq}\n
\n }\n\n \n {this.props.maxValue}\n \n\n {this.renderHiddenInputs()}\n
\n );\n }\n}\n"]} \ No newline at end of file diff --git a/lib/js/input-range/key-codes.js b/lib/js/input-range/key-codes.js new file mode 100644 index 0000000..437450e --- /dev/null +++ b/lib/js/input-range/key-codes.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** @ignore */ +var DOWN_ARROW = exports.DOWN_ARROW = 40; + +/** @ignore */ +var LEFT_ARROW = exports.LEFT_ARROW = 37; + +/** @ignore */ +var RIGHT_ARROW = exports.RIGHT_ARROW = 39; + +/** @ignore */ +var UP_ARROW = exports.UP_ARROW = 38; +//# sourceMappingURL=key-codes.js.map \ No newline at end of file diff --git a/lib/js/input-range/key-codes.js.map b/lib/js/input-range/key-codes.js.map new file mode 100644 index 0000000..bf8dc03 --- /dev/null +++ b/lib/js/input-range/key-codes.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/key-codes.js"],"names":["DOWN_ARROW","LEFT_ARROW","RIGHT_ARROW","UP_ARROW"],"mappings":";;;;;AAAA;AACO,IAAMA,kCAAa,EAAnB;;AAEP;AACO,IAAMC,kCAAa,EAAnB;;AAEP;AACO,IAAMC,oCAAc,EAApB;;AAEP;AACO,IAAMC,8BAAW,EAAjB","file":"key-codes.js","sourcesContent":["/** @ignore */\nexport const DOWN_ARROW = 40;\n\n/** @ignore */\nexport const LEFT_ARROW = 37;\n\n/** @ignore */\nexport const RIGHT_ARROW = 39;\n\n/** @ignore */\nexport const UP_ARROW = 38;\n"]} \ No newline at end of file diff --git a/lib/js/input-range/label.js b/lib/js/input-range/label.js new file mode 100644 index 0000000..e72351d --- /dev/null +++ b/lib/js/input-range/label.js @@ -0,0 +1,53 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = Label; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @ignore + * @param {Object} props + * @param {InputRangeClassNames} props.classNames + * @param {Function} props.formatLabel + * @param {string} props.type + */ +function Label(props) { + var labelValue = props.formatLabel ? props.formatLabel(props.children, props.type) : props.children; + + return _react2.default.createElement( + 'span', + { className: props.classNames[props.type + 'Label'] }, + _react2.default.createElement( + 'span', + { className: props.classNames.labelContainer }, + labelValue + ) + ); +} + +/** + * @type {Object} + * @property {Function} children + * @property {Function} classNames + * @property {Function} formatLabel + * @property {Function} type + */ +Label.propTypes = { + children: _propTypes2.default.node.isRequired, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired, + formatLabel: _propTypes2.default.func, + type: _propTypes2.default.string.isRequired +}; +module.exports = exports['default']; +//# sourceMappingURL=label.js.map \ No newline at end of file diff --git a/lib/js/input-range/label.js.map b/lib/js/input-range/label.js.map new file mode 100644 index 0000000..6fbb75b --- /dev/null +++ b/lib/js/input-range/label.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/label.jsx"],"names":["Label","props","labelValue","formatLabel","children","type","classNames","labelContainer","propTypes","node","isRequired","objectOf","string","func"],"mappings":";;;;;kBAUwBA,K;;AAVxB;;;;AACA;;;;;;AAEA;;;;;;;AAOe,SAASA,KAAT,CAAeC,KAAf,EAAsB;AACnC,MAAMC,aAAaD,MAAME,WAAN,GAAoBF,MAAME,WAAN,CAAkBF,MAAMG,QAAxB,EAAkCH,MAAMI,IAAxC,CAApB,GAAoEJ,MAAMG,QAA7F;;AAEA,SACE;AAAA;AAAA,MAAM,WAAWH,MAAMK,UAAN,CAAoBL,MAAMI,IAA1B,WAAjB;AACE;AAAA;AAAA,QAAM,WAAWJ,MAAMK,UAAN,CAAiBC,cAAlC;AACGL;AADH;AADF,GADF;AAOD;;AAED;;;;;;;AAOAF,MAAMQ,SAAN,GAAkB;AAChBJ,YAAU,oBAAUK,IAAV,CAAeC,UADT;AAEhBJ,cAAY,oBAAUK,QAAV,CAAmB,oBAAUC,MAA7B,EAAqCF,UAFjC;AAGhBP,eAAa,oBAAUU,IAHP;AAIhBR,QAAM,oBAAUO,MAAV,CAAiBF;AAJP,CAAlB","file":"label.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\n/**\n * @ignore\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} props.formatLabel\n * @param {string} props.type\n */\nexport default function Label(props) {\n const labelValue = props.formatLabel ? props.formatLabel(props.children, props.type) : props.children;\n\n return (\n \n \n {labelValue}\n \n \n );\n}\n\n/**\n * @type {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Function} formatLabel\n * @property {Function} type\n */\nLabel.propTypes = {\n children: PropTypes.node.isRequired,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n formatLabel: PropTypes.func,\n type: PropTypes.string.isRequired,\n};\n"]} \ No newline at end of file diff --git a/lib/js/input-range/range-prop-type.js b/lib/js/input-range/range-prop-type.js new file mode 100644 index 0000000..0d68d71 --- /dev/null +++ b/lib/js/input-range/range-prop-type.js @@ -0,0 +1,29 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rangePropType; + +var _utils = require('../utils'); + +/** + * @ignore + * @param {Object} props - React component props + * @return {?Error} Return Error if validation fails + */ +function rangePropType(props) { + var maxValue = props.maxValue, + minValue = props.minValue; + + + if (!(0, _utils.isNumber)(minValue) || !(0, _utils.isNumber)(maxValue)) { + return new Error('"minValue" and "maxValue" must be a number'); + } + + if (minValue >= maxValue) { + return new Error('"minValue" must be smaller than "maxValue"'); + } +} +module.exports = exports['default']; +//# sourceMappingURL=range-prop-type.js.map \ No newline at end of file diff --git a/lib/js/input-range/range-prop-type.js.map b/lib/js/input-range/range-prop-type.js.map new file mode 100644 index 0000000..7a9b7f5 --- /dev/null +++ b/lib/js/input-range/range-prop-type.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/range-prop-type.js"],"names":["rangePropType","props","maxValue","minValue","Error"],"mappings":";;;;;kBAOwBA,a;;AAPxB;;AAEA;;;;;AAKe,SAASA,aAAT,CAAuBC,KAAvB,EAA8B;AAAA,MACnCC,QADmC,GACZD,KADY,CACnCC,QADmC;AAAA,MACzBC,QADyB,GACZF,KADY,CACzBE,QADyB;;;AAG3C,MAAI,CAAC,qBAASA,QAAT,CAAD,IAAuB,CAAC,qBAASD,QAAT,CAA5B,EAAgD;AAC9C,WAAO,IAAIE,KAAJ,CAAU,4CAAV,CAAP;AACD;;AAED,MAAID,YAAYD,QAAhB,EAA0B;AACxB,WAAO,IAAIE,KAAJ,CAAU,4CAAV,CAAP;AACD;AACF","file":"range-prop-type.js","sourcesContent":["import { isNumber } from '../utils';\n\n/**\n * @ignore\n * @param {Object} props - React component props\n * @return {?Error} Return Error if validation fails\n */\nexport default function rangePropType(props) {\n const { maxValue, minValue } = props;\n\n if (!isNumber(minValue) || !isNumber(maxValue)) {\n return new Error('\"minValue\" and \"maxValue\" must be a number');\n }\n\n if (minValue >= maxValue) {\n return new Error('\"minValue\" must be smaller than \"maxValue\"');\n }\n}\n"]} \ No newline at end of file diff --git a/lib/js/input-range/slider.js b/lib/js/input-range/slider.js new file mode 100644 index 0000000..355a889 --- /dev/null +++ b/lib/js/input-range/slider.js @@ -0,0 +1,398 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _desc, _value, _class; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _autobindDecorator = require('autobind-decorator'); + +var _autobindDecorator2 = _interopRequireDefault(_autobindDecorator); + +var _label = require('./label'); + +var _label2 = _interopRequireDefault(_label); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; +} + +/** + * @ignore + */ +var Slider = (_class = function (_React$Component) { + _inherits(Slider, _React$Component); + + _createClass(Slider, null, [{ + key: 'propTypes', + + /** + * Accepted propTypes of Slider + * @override + * @return {Object} + * @property {Function} ariaLabelledby + * @property {Function} ariaControls + * @property {Function} className + * @property {Function} formatLabel + * @property {Function} maxValue + * @property {Function} minValue + * @property {Function} onSliderDrag + * @property {Function} onSliderKeyDown + * @property {Function} percentage + * @property {Function} type + * @property {Function} value + */ + get: function get() { + return { + ariaLabelledby: _propTypes2.default.string, + ariaControls: _propTypes2.default.string, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired, + formatLabel: _propTypes2.default.func, + maxValue: _propTypes2.default.number, + minValue: _propTypes2.default.number, + onSliderDrag: _propTypes2.default.func.isRequired, + onSliderKeyDown: _propTypes2.default.func.isRequired, + percentage: _propTypes2.default.number.isRequired, + type: _propTypes2.default.string.isRequired, + value: _propTypes2.default.number.isRequired + }; + } + + /** + * @param {Object} props + * @param {string} [props.ariaLabelledby] + * @param {string} [props.ariaControls] + * @param {InputRangeClassNames} props.classNames + * @param {Function} [props.formatLabel] + * @param {number} [props.maxValue] + * @param {number} [props.minValue] + * @param {Function} props.onSliderKeyDown + * @param {Function} props.onSliderDrag + * @param {number} props.percentage + * @param {number} props.type + * @param {number} props.value + */ + + }]); + + function Slider(props) { + _classCallCheck(this, Slider); + + /** + * @private + * @type {?Component} + */ + var _this = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, props)); + + _this.node = null; + return _this; + } + + /** + * @ignore + * @override + * @return {void} + */ + + + _createClass(Slider, [{ + key: 'componentWillUnmount', + value: function componentWillUnmount() { + this.removeDocumentMouseMoveListener(); + this.removeDocumentMouseUpListener(); + this.removeDocumentTouchEndListener(); + this.removeDocumentTouchMoveListener(); + } + + /** + * @private + * @return {Object} + */ + + }, { + key: 'getStyle', + value: function getStyle() { + var perc = (this.props.percentage || 0) * 100; + var style = { + position: 'absolute', + left: perc + '%' + }; + + return style; + } + + /** + * Listen to mousemove event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseMoveListener', + value: function addDocumentMouseMoveListener() { + this.removeDocumentMouseMoveListener(); + this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove); + } + + /** + * Listen to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseUpListener', + value: function addDocumentMouseUpListener() { + this.removeDocumentMouseUpListener(); + this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp); + } + + /** + * Listen to touchmove event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentTouchMoveListener', + value: function addDocumentTouchMoveListener() { + this.removeDocumentTouchMoveListener(); + this.node.ownerDocument.addEventListener('touchmove', this.handleTouchMove); + } + + /** + * Listen to touchend event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentTouchEndListener', + value: function addDocumentTouchEndListener() { + this.removeDocumentTouchEndListener(); + this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseMoveListener', + value: function removeDocumentMouseMoveListener() { + this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseUpListener', + value: function removeDocumentMouseUpListener() { + this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentTouchMoveListener', + value: function removeDocumentTouchMoveListener() { + this.node.ownerDocument.removeEventListener('touchmove', this.handleTouchMove); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentTouchEndListener', + value: function removeDocumentTouchEndListener() { + this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleMouseDown', + value: function handleMouseDown() { + this.addDocumentMouseMoveListener(); + this.addDocumentMouseUpListener(); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleMouseUp', + value: function handleMouseUp() { + this.removeDocumentMouseMoveListener(); + this.removeDocumentMouseUpListener(); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleMouseMove', + value: function handleMouseMove(event) { + this.props.onSliderDrag(event, this.props.type); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleTouchStart', + value: function handleTouchStart() { + this.addDocumentTouchEndListener(); + this.addDocumentTouchMoveListener(); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleTouchMove', + value: function handleTouchMove(event) { + this.props.onSliderDrag(event, this.props.type); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleTouchEnd', + value: function handleTouchEnd() { + this.removeDocumentTouchMoveListener(); + this.removeDocumentTouchEndListener(); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleKeyDown', + value: function handleKeyDown(event) { + this.props.onSliderKeyDown(event, this.props.type); + } + + /** + * @override + * @return {JSX.Element} + */ + + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var style = this.getStyle(); + + return _react2.default.createElement( + 'span', + { + className: this.props.classNames.sliderContainer, + ref: function ref(node) { + _this2.node = node; + }, + style: style }, + _react2.default.createElement( + _label2.default, + { + classNames: this.props.classNames, + formatLabel: this.props.formatLabel, + type: 'value' }, + this.props.value + ), + _react2.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' }) + ); + } + }]); + + return Slider; +}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchEnd', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchEnd'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleKeyDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleKeyDown'), _class.prototype)), _class); +exports.default = Slider; +module.exports = exports['default']; +//# sourceMappingURL=slider.js.map \ No newline at end of file diff --git a/lib/js/input-range/slider.js.map b/lib/js/input-range/slider.js.map new file mode 100644 index 0000000..f849e32 --- /dev/null +++ b/lib/js/input-range/slider.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/slider.jsx"],"names":["Slider","ariaLabelledby","string","ariaControls","classNames","objectOf","isRequired","formatLabel","func","maxValue","number","minValue","onSliderDrag","onSliderKeyDown","percentage","type","value","props","node","removeDocumentMouseMoveListener","removeDocumentMouseUpListener","removeDocumentTouchEndListener","removeDocumentTouchMoveListener","perc","style","position","left","ownerDocument","addEventListener","handleMouseMove","handleMouseUp","handleTouchMove","handleTouchEnd","removeEventListener","addDocumentMouseMoveListener","addDocumentMouseUpListener","event","addDocumentTouchEndListener","addDocumentTouchMoveListener","getStyle","sliderContainer","slider","handleKeyDown","handleMouseDown","handleTouchStart","Component"],"mappings":";;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;IAGqBA,M;;;;;;AACnB;;;;;;;;;;;;;;;;wBAgBuB;AACrB,aAAO;AACLC,wBAAgB,oBAAUC,MADrB;AAELC,sBAAc,oBAAUD,MAFnB;AAGLE,oBAAY,oBAAUC,QAAV,CAAmB,oBAAUH,MAA7B,EAAqCI,UAH5C;AAILC,qBAAa,oBAAUC,IAJlB;AAKLC,kBAAU,oBAAUC,MALf;AAMLC,kBAAU,oBAAUD,MANf;AAOLE,sBAAc,oBAAUJ,IAAV,CAAeF,UAPxB;AAQLO,yBAAiB,oBAAUL,IAAV,CAAeF,UAR3B;AASLQ,oBAAY,oBAAUJ,MAAV,CAAiBJ,UATxB;AAULS,cAAM,oBAAUb,MAAV,CAAiBI,UAVlB;AAWLU,eAAO,oBAAUN,MAAV,CAAiBJ;AAXnB,OAAP;AAaD;;AAED;;;;;;;;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6BAAiB,KAAKC,KAAL,CAAWhB,cAD9B;AAEE,2BAAe,KAAKgB,KAAL,CAAWd,YAF5B;AAGE,2BAAe,KAAKc,KAAL,CAAWR,QAH5B;AAIE,2BAAe,KAAKQ,KAAL,CAAWN,QAJ5B;AAKE,2BAAe,KAAKM,KAAL,CAAWD,KAL5B;AAME,qBAAW,KAAKC,KAAL,CAAWb,UAAX,CAAsBqC,MANnC;AAOE,qBAAU,OAPZ;AAQE,qBAAW,KAAKC,aARlB;AASE,uBAAa,KAAKC,eATpB;AAUE,wBAAc,KAAKC,gBAVrB;AAWE,gBAAK,QAXP;AAYE,oBAAS,GAZX;AAXF,OADF;AA2BD;;;;EAnQiC,gBAAMC,S;kBAArB7C,M","file":"slider.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\nimport Label from './label';\n\n/**\n * @ignore\n */\nexport default class Slider extends React.Component {\n /**\n * Accepted propTypes of Slider\n * @override\n * @return {Object}\n * @property {Function} ariaLabelledby\n * @property {Function} ariaControls\n * @property {Function} className\n * @property {Function} formatLabel\n * @property {Function} maxValue\n * @property {Function} minValue\n * @property {Function} onSliderDrag\n * @property {Function} onSliderKeyDown\n * @property {Function} percentage\n * @property {Function} type\n * @property {Function} value\n */\n static get propTypes() {\n return {\n ariaLabelledby: PropTypes.string,\n ariaControls: PropTypes.string,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n formatLabel: PropTypes.func,\n maxValue: PropTypes.number,\n minValue: PropTypes.number,\n onSliderDrag: PropTypes.func.isRequired,\n onSliderKeyDown: PropTypes.func.isRequired,\n percentage: PropTypes.number.isRequired,\n type: PropTypes.string.isRequired,\n value: PropTypes.number.isRequired,\n };\n }\n\n /**\n * @param {Object} props\n * @param {string} [props.ariaLabelledby]\n * @param {string} [props.ariaControls]\n * @param {InputRangeClassNames} props.classNames\n * @param {Function} [props.formatLabel]\n * @param {number} [props.maxValue]\n * @param {number} [props.minValue]\n * @param {Function} props.onSliderKeyDown\n * @param {Function} props.onSliderDrag\n * @param {number} props.percentage\n * @param {number} props.type\n * @param {number} props.value\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n }\n\n /**\n * @ignore\n * @override\n * @return {void}\n */\n componentWillUnmount() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.removeDocumentTouchEndListener();\n this.removeDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @return {Object}\n */\n getStyle() {\n const perc = (this.props.percentage || 0) * 100;\n const style = {\n position: 'absolute',\n left: `${perc}%`,\n };\n\n return style;\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * Listen to touchmove event\n * @private\n * @return {void}\n */\n addDocumentTouchMoveListener() {\n this.removeDocumentTouchMoveListener();\n this.node.ownerDocument.addEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * Listen to touchend event\n * @private\n * @return {void}\n */\n addDocumentTouchEndListener() {\n this.removeDocumentTouchEndListener();\n this.node.ownerDocument.addEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentTouchMoveListener() {\n this.node.ownerDocument.removeEventListener('touchmove', this.handleTouchMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentTouchEndListener() {\n this.node.ownerDocument.removeEventListener('touchend', this.handleTouchEnd);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseDown() {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseUp() {\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleTouchStart() {\n this.addDocumentTouchEndListener();\n this.addDocumentTouchMoveListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleTouchMove(event) {\n this.props.onSliderDrag(event, this.props.type);\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleTouchEnd() {\n this.removeDocumentTouchMoveListener();\n this.removeDocumentTouchEndListener();\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleKeyDown(event) {\n this.props.onSliderKeyDown(event, this.props.type);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n render() {\n const style = this.getStyle();\n\n return (\n { this.node = node; }}\n style={style}>\n \n {this.props.value}\n \n\n \n \n );\n }\n}\n"]} \ No newline at end of file diff --git a/lib/js/input-range/track.js b/lib/js/input-range/track.js new file mode 100644 index 0000000..b824d74 --- /dev/null +++ b/lib/js/input-range/track.js @@ -0,0 +1,296 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _desc, _value, _class; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _autobindDecorator = require('autobind-decorator'); + +var _autobindDecorator2 = _interopRequireDefault(_autobindDecorator); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object['ke' + 'ys'](descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object['define' + 'Property'](target, property, desc); + desc = null; + } + + return desc; +} + +/** + * @ignore + */ +var Track = (_class = function (_React$Component) { + _inherits(Track, _React$Component); + + _createClass(Track, null, [{ + key: 'propTypes', + + /** + * @override + * @return {Object} + * @property {Function} children + * @property {Function} classNames + * @property {Boolean} draggableTrack + * @property {Function} onTrackDrag + * @property {Function} onTrackMouseDown + * @property {Function} percentages + */ + get: function get() { + return { + children: _propTypes2.default.node.isRequired, + classNames: _propTypes2.default.objectOf(_propTypes2.default.string).isRequired, + draggableTrack: _propTypes2.default.bool, + onTrackDrag: _propTypes2.default.func, + onTrackMouseDown: _propTypes2.default.func.isRequired, + percentages: _propTypes2.default.objectOf(_propTypes2.default.number).isRequired + }; + } + + /** + * @param {Object} props + * @param {InputRangeClassNames} props.classNames + * @param {Boolean} props.draggableTrack + * @param {Function} props.onTrackDrag + * @param {Function} props.onTrackMouseDown + * @param {number} props.percentages + */ + + }]); + + function Track(props) { + _classCallCheck(this, Track); + + /** + * @private + * @type {?Component} + */ + var _this = _possibleConstructorReturn(this, (Track.__proto__ || Object.getPrototypeOf(Track)).call(this, props)); + + _this.node = null; + _this.trackDragEvent = null; + return _this; + } + + /** + * @private + * @return {ClientRect} + */ + + + _createClass(Track, [{ + key: 'getClientRect', + value: function getClientRect() { + return this.node.getBoundingClientRect(); + } + + /** + * @private + * @return {Object} CSS styles + */ + + }, { + key: 'getActiveTrackStyle', + value: function getActiveTrackStyle() { + var width = (this.props.percentages.max - this.props.percentages.min) * 100 + '%'; + var left = this.props.percentages.min * 100 + '%'; + + return { left: left, width: width }; + } + + /** + * Listen to mousemove event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseMoveListener', + value: function addDocumentMouseMoveListener() { + this.removeDocumentMouseMoveListener(); + this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove); + } + + /** + * Listen to mouseup event + * @private + * @return {void} + */ + + }, { + key: 'addDocumentMouseUpListener', + value: function addDocumentMouseUpListener() { + this.removeDocumentMouseUpListener(); + this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseMoveListener', + value: function removeDocumentMouseMoveListener() { + this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove); + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'removeDocumentMouseUpListener', + value: function removeDocumentMouseUpListener() { + this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp); + } + + /** + * @private + * @param {SyntheticEvent} event + * @return {void} + */ + + }, { + key: 'handleMouseMove', + value: function handleMouseMove(event) { + if (!this.props.draggableTrack) { + return; + } + + if (this.trackDragEvent !== null) { + this.props.onTrackDrag(event, this.trackDragEvent); + } + + this.trackDragEvent = event; + } + + /** + * @private + * @return {void} + */ + + }, { + key: 'handleMouseUp', + value: function handleMouseUp() { + if (!this.props.draggableTrack) { + return; + } + + this.removeDocumentMouseMoveListener(); + this.removeDocumentMouseUpListener(); + this.trackDragEvent = null; + } + + /** + * @private + * @param {SyntheticEvent} event - User event + */ + + }, { + key: 'handleMouseDown', + value: function handleMouseDown(event) { + var clientX = event.touches ? event.touches[0].clientX : event.clientX; + var trackClientRect = this.getClientRect(); + var position = { + x: clientX - trackClientRect.left, + y: 0 + }; + + this.props.onTrackMouseDown(event, position); + + if (this.props.draggableTrack) { + this.addDocumentMouseMoveListener(); + this.addDocumentMouseUpListener(); + } + } + + /** + * @private + * @param {SyntheticEvent} event - User event + */ + + }, { + key: 'handleTouchStart', + value: function handleTouchStart(event) { + event.preventDefault(); + + this.handleMouseDown(event); + } + + /** + * @override + * @return {JSX.Element} + */ + + }, { + key: 'render', + value: function render() { + var _this2 = this; + + var activeTrackStyle = this.getActiveTrackStyle(); + + return _react2.default.createElement( + 'div', + { + className: this.props.classNames.track, + onMouseDown: this.handleMouseDown, + onTouchStart: this.handleTouchStart, + ref: function ref(node) { + _this2.node = node; + } }, + _react2.default.createElement('div', { + style: activeTrackStyle, + className: this.props.classNames.activeTrack }), + this.props.children + ); + } + }]); + + return Track; +}(_react2.default.Component), (_applyDecoratedDescriptor(_class.prototype, 'handleMouseMove', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseMove'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseUp', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseUp'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleMouseDown', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleMouseDown'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'handleTouchStart', [_autobindDecorator2.default], Object.getOwnPropertyDescriptor(_class.prototype, 'handleTouchStart'), _class.prototype)), _class); +exports.default = Track; +module.exports = exports['default']; +//# sourceMappingURL=track.js.map \ No newline at end of file diff --git a/lib/js/input-range/track.js.map b/lib/js/input-range/track.js.map new file mode 100644 index 0000000..e5b9c24 --- /dev/null +++ b/lib/js/input-range/track.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/track.jsx"],"names":["Track","children","node","isRequired","classNames","objectOf","string","draggableTrack","bool","onTrackDrag","func","onTrackMouseDown","percentages","number","props","trackDragEvent","getBoundingClientRect","width","max","min","left","removeDocumentMouseMoveListener","ownerDocument","addEventListener","handleMouseMove","removeDocumentMouseUpListener","handleMouseUp","removeEventListener","event","clientX","touches","trackClientRect","getClientRect","position","x","y","addDocumentMouseMoveListener","addDocumentMouseUpListener","preventDefault","handleMouseDown","activeTrackStyle","getActiveTrackStyle","track","handleTouchStart","activeTrack","Component"],"mappings":";;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;IAGqBA,K;;;;;;AACnB;;;;;;;;;;wBAUuB;AACrB,aAAO;AACLC,kBAAU,oBAAUC,IAAV,CAAeC,UADpB;AAELC,oBAAY,oBAAUC,QAAV,CAAmB,oBAAUC,MAA7B,EAAqCH,UAF5C;AAGLI,wBAAgB,oBAAUC,IAHrB;AAILC,qBAAa,oBAAUC,IAJlB;AAKLC,0BAAkB,oBAAUD,IAAV,CAAeP,UAL5B;AAMLS,qBAAa,oBAAUP,QAAV,CAAmB,oBAAUQ,MAA7B,EAAqCV;AAN7C,OAAP;AAQD;;AAED;;;;;;;;;;;AAQA,iBAAYW,KAAZ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AAsBa,KAAtB;AACD;;AAED;;;;;;;oCAKgB;AACd,UAAI,CAAC,KAAKd,KAAL,CAAWP,cAAhB,EAAgC;AAC9B;AACD;;AAED,WAAKc,+BAAL;AACA,WAAKI,6BAAL;AACA,WAAKV,cAAL,GAAsB,IAAtB;AACD;;AAED;;;;;;;oCAKgBa,K,EAAO;AACrB,UAAMC,UAAUD,MAAME,OAAN,GAAgBF,MAAME,OAAN,CAAc,CAAd,EAAiBD,OAAjC,GAA2CD,MAAMC,OAAjE;AACA,UAAME,kBAAkB,KAAKC,aAAL,EAAxB;AACA,UAAMC,WAAW;AACfC,WAAGL,UAAUE,gBAAgBX,IADd;AAEfe,WAAG;AAFY,OAAjB;;AAKA,WAAKrB,KAAL,CAAWH,gBAAX,CAA4BiB,KAA5B,EAAmCK,QAAnC;;AAEA,UAAI,KAAKnB,KAAL,CAAWP,cAAf,EAA+B;AAC7B,aAAK6B,4BAAL;AACA,aAAKC,0BAAL;AACD;AACF;;AAED;;;;;;;qCAKiBT,K,EAAO;AACtBA,YAAMU,cAAN;;AAEA,WAAKC,eAAL,CAAqBX,KAArB;AACD;;AAED;;;;;;;6BAIS;AAAA;;AACP,UAAMY,mBAAmB,KAAKC,mBAAL,EAAzB;;AAEA,aACE;AAAA;AAAA;AACE,qBAAW,KAAK3B,KAAL,CAAWV,UAAX,CAAsBsC,KADnC;AAEE,uBAAa,KAAKH,eAFpB;AAGE,wBAAc,KAAKI,gBAHrB;AAIE,eAAK,aAACzC,IAAD,EAAU;AAAE,mBAAKA,IAAL,GAAYA,IAAZ;AAAmB,WAJtC;AAKE;AACE,iBAAOsC,gBADT;AAEE,qBAAW,KAAK1B,KAAL,CAAWV,UAAX,CAAsBwC,WAFnC,GALF;AAQG,aAAK9B,KAAL,CAAWb;AARd,OADF;AAYD;;;;EApLgC,gBAAM4C,S;kBAApB7C,K","file":"track.js","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport autobind from 'autobind-decorator';\n\n/**\n * @ignore\n */\nexport default class Track extends React.Component {\n /**\n * @override\n * @return {Object}\n * @property {Function} children\n * @property {Function} classNames\n * @property {Boolean} draggableTrack\n * @property {Function} onTrackDrag\n * @property {Function} onTrackMouseDown\n * @property {Function} percentages\n */\n static get propTypes() {\n return {\n children: PropTypes.node.isRequired,\n classNames: PropTypes.objectOf(PropTypes.string).isRequired,\n draggableTrack: PropTypes.bool,\n onTrackDrag: PropTypes.func,\n onTrackMouseDown: PropTypes.func.isRequired,\n percentages: PropTypes.objectOf(PropTypes.number).isRequired,\n };\n }\n\n /**\n * @param {Object} props\n * @param {InputRangeClassNames} props.classNames\n * @param {Boolean} props.draggableTrack\n * @param {Function} props.onTrackDrag\n * @param {Function} props.onTrackMouseDown\n * @param {number} props.percentages\n */\n constructor(props) {\n super(props);\n\n /**\n * @private\n * @type {?Component}\n */\n this.node = null;\n this.trackDragEvent = null;\n }\n\n /**\n * @private\n * @return {ClientRect}\n */\n getClientRect() {\n return this.node.getBoundingClientRect();\n }\n\n /**\n * @private\n * @return {Object} CSS styles\n */\n getActiveTrackStyle() {\n const width = `${(this.props.percentages.max - this.props.percentages.min) * 100}%`;\n const left = `${this.props.percentages.min * 100}%`;\n\n return { left, width };\n }\n\n /**\n * Listen to mousemove event\n * @private\n * @return {void}\n */\n addDocumentMouseMoveListener() {\n this.removeDocumentMouseMoveListener();\n this.node.ownerDocument.addEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * Listen to mouseup event\n * @private\n * @return {void}\n */\n addDocumentMouseUpListener() {\n this.removeDocumentMouseUpListener();\n this.node.ownerDocument.addEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseMoveListener() {\n this.node.ownerDocument.removeEventListener('mousemove', this.handleMouseMove);\n }\n\n /**\n * @private\n * @return {void}\n */\n removeDocumentMouseUpListener() {\n this.node.ownerDocument.removeEventListener('mouseup', this.handleMouseUp);\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event\n * @return {void}\n */\n @autobind\n handleMouseMove(event) {\n if (!this.props.draggableTrack) {\n return;\n }\n\n if (this.trackDragEvent !== null) {\n this.props.onTrackDrag(event, this.trackDragEvent);\n }\n\n this.trackDragEvent = event;\n }\n\n /**\n * @private\n * @return {void}\n */\n @autobind\n handleMouseUp() {\n if (!this.props.draggableTrack) {\n return;\n }\n\n this.removeDocumentMouseMoveListener();\n this.removeDocumentMouseUpListener();\n this.trackDragEvent = null;\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n @autobind\n handleMouseDown(event) {\n const clientX = event.touches ? event.touches[0].clientX : event.clientX;\n const trackClientRect = this.getClientRect();\n const position = {\n x: clientX - trackClientRect.left,\n y: 0,\n };\n\n this.props.onTrackMouseDown(event, position);\n\n if (this.props.draggableTrack) {\n this.addDocumentMouseMoveListener();\n this.addDocumentMouseUpListener();\n }\n }\n\n /**\n * @private\n * @param {SyntheticEvent} event - User event\n */\n @autobind\n handleTouchStart(event) {\n event.preventDefault();\n\n this.handleMouseDown(event);\n }\n\n /**\n * @override\n * @return {JSX.Element}\n */\n render() {\n const activeTrackStyle = this.getActiveTrackStyle();\n\n return (\n { this.node = node; }}>\n \n {this.props.children}\n \n );\n }\n}\n"]} \ No newline at end of file diff --git a/lib/js/input-range/value-prop-type.js b/lib/js/input-range/value-prop-type.js new file mode 100644 index 0000000..420623c --- /dev/null +++ b/lib/js/input-range/value-prop-type.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = valuePropType; + +var _utils = require('../utils'); + +/** + * @ignore + * @param {Object} props + * @return {?Error} Return Error if validation fails + */ +function valuePropType(props, propName) { + var maxValue = props.maxValue, + minValue = props.minValue; + + var value = props[propName]; + + if (!(0, _utils.isNumber)(value) && (!(0, _utils.isObject)(value) || !(0, _utils.isNumber)(value.min) || !(0, _utils.isNumber)(value.max))) { + return new Error('"' + propName + '" must be a number or a range object'); + } + + if ((0, _utils.isNumber)(value) && (value < minValue || value > maxValue)) { + return new Error('"' + propName + '" must be in between "minValue" and "maxValue"'); + } + + if ((0, _utils.isObject)(value) && (value.min < minValue || value.min > maxValue || value.max < minValue || value.max > maxValue)) { + return new Error('"' + propName + '" must be in between "minValue" and "maxValue"'); + } +} +module.exports = exports['default']; +//# sourceMappingURL=value-prop-type.js.map \ No newline at end of file diff --git a/lib/js/input-range/value-prop-type.js.map b/lib/js/input-range/value-prop-type.js.map new file mode 100644 index 0000000..e0c9061 --- /dev/null +++ b/lib/js/input-range/value-prop-type.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/value-prop-type.js"],"names":["valuePropType","props","propName","maxValue","minValue","value","min","max","Error"],"mappings":";;;;;kBAOwBA,a;;AAPxB;;AAEA;;;;;AAKe,SAASA,aAAT,CAAuBC,KAAvB,EAA8BC,QAA9B,EAAwC;AAAA,MAC7CC,QAD6C,GACtBF,KADsB,CAC7CE,QAD6C;AAAA,MACnCC,QADmC,GACtBH,KADsB,CACnCG,QADmC;;AAErD,MAAMC,QAAQJ,MAAMC,QAAN,CAAd;;AAEA,MAAI,CAAC,qBAASG,KAAT,CAAD,KAAqB,CAAC,qBAASA,KAAT,CAAD,IAAoB,CAAC,qBAASA,MAAMC,GAAf,CAArB,IAA4C,CAAC,qBAASD,MAAME,GAAf,CAAlE,CAAJ,EAA4F;AAC1F,WAAO,IAAIC,KAAJ,OAAcN,QAAd,0CAAP;AACD;;AAED,MAAI,qBAASG,KAAT,MAAoBA,QAAQD,QAAR,IAAoBC,QAAQF,QAAhD,CAAJ,EAA+D;AAC7D,WAAO,IAAIK,KAAJ,OAAcN,QAAd,oDAAP;AACD;;AAED,MAAI,qBAASG,KAAT,MAAoBA,MAAMC,GAAN,GAAYF,QAAZ,IAAwBC,MAAMC,GAAN,GAAYH,QAApC,IAAgDE,MAAME,GAAN,GAAYH,QAA5D,IAAwEC,MAAME,GAAN,GAAYJ,QAAxG,CAAJ,EAAuH;AACrH,WAAO,IAAIK,KAAJ,OAAcN,QAAd,oDAAP;AACD;AACF","file":"value-prop-type.js","sourcesContent":["import { isNumber, isObject } from '../utils';\n\n/**\n * @ignore\n * @param {Object} props\n * @return {?Error} Return Error if validation fails\n */\nexport default function valuePropType(props, propName) {\n const { maxValue, minValue } = props;\n const value = props[propName];\n\n if (!isNumber(value) && (!isObject(value) || !isNumber(value.min) || !isNumber(value.max))) {\n return new Error(`\"${propName}\" must be a number or a range object`);\n }\n\n if (isNumber(value) && (value < minValue || value > maxValue)) {\n return new Error(`\"${propName}\" must be in between \"minValue\" and \"maxValue\"`);\n }\n\n if (isObject(value) && (value.min < minValue || value.min > maxValue || value.max < minValue || value.max > maxValue)) {\n return new Error(`\"${propName}\" must be in between \"minValue\" and \"maxValue\"`);\n }\n}\n"]} \ No newline at end of file diff --git a/lib/js/input-range/value-transformer.js b/lib/js/input-range/value-transformer.js new file mode 100644 index 0000000..cbfd766 --- /dev/null +++ b/lib/js/input-range/value-transformer.js @@ -0,0 +1,165 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +exports.getPercentageFromPosition = getPercentageFromPosition; +exports.getValueFromPosition = getValueFromPosition; +exports.getValueFromProps = getValueFromProps; +exports.getPercentageFromValue = getPercentageFromValue; +exports.getPercentagesFromValues = getPercentagesFromValues; +exports.getPositionFromValue = getPositionFromValue; +exports.getPositionsFromValues = getPositionsFromValues; +exports.getPositionFromEvent = getPositionFromEvent; +exports.getStepValueFromValue = getStepValueFromValue; + +var _utils = require('../utils'); + +/** + * Convert a point into a percentage value + * @ignore + * @param {Point} position + * @param {ClientRect} clientRect + * @return {number} Percentage value + */ +function getPercentageFromPosition(position, clientRect) { + var length = clientRect.width; + var sizePerc = position.x / length; + + return sizePerc || 0; +} + +/** + * Convert a point into a model value + * @ignore + * @param {Point} position + * @param {number} minValue + * @param {number} maxValue + * @param {ClientRect} clientRect + * @return {number} + */ +function getValueFromPosition(position, minValue, maxValue, clientRect) { + var sizePerc = getPercentageFromPosition(position, clientRect); + var valueDiff = maxValue - minValue; + + return minValue + valueDiff * sizePerc; +} + +/** + * Convert props into a range value + * @ignore + * @param {Object} props + * @param {boolean} isMultiValue + * @return {Range} + */ +function getValueFromProps(props, isMultiValue) { + if (isMultiValue) { + return _extends({}, props.value); + } + + return { + min: props.minValue, + max: props.value + }; +} + +/** + * Convert a model value into a percentage value + * @ignore + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @return {number} + */ +function getPercentageFromValue(value, minValue, maxValue) { + var validValue = (0, _utils.clamp)(value, minValue, maxValue); + var valueDiff = maxValue - minValue; + var valuePerc = (validValue - minValue) / valueDiff; + + return valuePerc || 0; +} + +/** + * Convert model values into percentage values + * @ignore + * @param {Range} values + * @param {number} minValue + * @param {number} maxValue + * @return {Range} + */ +function getPercentagesFromValues(values, minValue, maxValue) { + return { + min: getPercentageFromValue(values.min, minValue, maxValue), + max: getPercentageFromValue(values.max, minValue, maxValue) + }; +} + +/** + * Convert a value into a point + * @ignore + * @param {number} value + * @param {number} minValue + * @param {number} maxValue + * @param {ClientRect} clientRect + * @return {Point} Position + */ +function getPositionFromValue(value, minValue, maxValue, clientRect) { + var length = clientRect.width; + var valuePerc = getPercentageFromValue(value, minValue, maxValue); + var positionValue = valuePerc * length; + + return { + x: positionValue, + y: 0 + }; +} + +/** + * Convert a range of values into points + * @ignore + * @param {Range} values + * @param {number} minValue + * @param {number} maxValue + * @param {ClientRect} clientRect + * @return {Range} + */ +function getPositionsFromValues(values, minValue, maxValue, clientRect) { + return { + min: getPositionFromValue(values.min, minValue, maxValue, clientRect), + max: getPositionFromValue(values.max, minValue, maxValue, clientRect) + }; +} + +/** + * Convert an event into a point + * @ignore + * @param {Event} event + * @param {ClientRect} clientRect + * @return {Point} + */ +function getPositionFromEvent(event, clientRect) { + var length = clientRect.width; + + var _ref = event.touches ? event.touches[0] : event, + clientX = _ref.clientX; + + return { + x: (0, _utils.clamp)(clientX - clientRect.left, 0, length), + y: 0 + }; +} + +/** + * Convert a value into a step value + * @ignore + * @param {number} value + * @param {number} valuePerStep + * @return {number} + */ +function getStepValueFromValue(value, valuePerStep) { + return Math.round(value / valuePerStep) * valuePerStep; +} +//# sourceMappingURL=value-transformer.js.map \ No newline at end of file diff --git a/lib/js/input-range/value-transformer.js.map b/lib/js/input-range/value-transformer.js.map new file mode 100644 index 0000000..cbfe678 --- /dev/null +++ b/lib/js/input-range/value-transformer.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/input-range/value-transformer.js"],"names":["getPercentageFromPosition","getValueFromPosition","getValueFromProps","getPercentageFromValue","getPercentagesFromValues","getPositionFromValue","getPositionsFromValues","getPositionFromEvent","getStepValueFromValue","position","clientRect","length","width","sizePerc","x","minValue","maxValue","valueDiff","props","isMultiValue","value","min","max","validValue","valuePerc","values","positionValue","y","event","touches","clientX","left","valuePerStep","Math","round"],"mappings":";;;;;;;;QASgBA,yB,GAAAA,yB;QAgBAC,oB,GAAAA,oB;QAcAC,iB,GAAAA,iB;QAmBAC,sB,GAAAA,sB;QAgBAC,wB,GAAAA,wB;QAgBAC,oB,GAAAA,oB;QAoBAC,sB,GAAAA,sB;QAcAC,oB,GAAAA,oB;QAiBAC,qB,GAAAA,qB;;AA7IhB;;AAEA;;;;;;;AAOO,SAASR,yBAAT,CAAmCS,QAAnC,EAA6CC,UAA7C,EAAyD;AAC9D,MAAMC,SAASD,WAAWE,KAA1B;AACA,MAAMC,WAAWJ,SAASK,CAAT,GAAaH,MAA9B;;AAEA,SAAOE,YAAY,CAAnB;AACD;;AAED;;;;;;;;;AASO,SAASZ,oBAAT,CAA8BQ,QAA9B,EAAwCM,QAAxC,EAAkDC,QAAlD,EAA4DN,UAA5D,EAAwE;AAC7E,MAAMG,WAAWb,0BAA0BS,QAA1B,EAAoCC,UAApC,CAAjB;AACA,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AAwE;AAC7E,SAAO;AACLW,SAAKhB,qBAAqBoB,OAAOJ,GAA5B,EAAiCN,QAAjC,EAA2CC,QAA3C,EAAqDN,UAArD,CADA;AAELY,SAAKjB,qBAAqBoB,OAAOH,GAA5B,EAAiCP,QAAjC,EAA2CC,QAA3C,EAAqDN,UAArD;AAFA,GAAP;AAID;;AAED;;;;;;;AAOO,SAASH,oBAAT,CAA8BqB,KAA9B,EAAqClB,UAArC,EAAiD;AACtD,MAAMC,SAASD,WAAWE,KAA1B;;AADsD,aAElCgB,MAAMC,OAAN,GAAgBD,MAAMC,OAAN,CAAc,CAAd,CAAhB,GAAmCD,KAFD;AAAA,MAE9CE,OAF8C,QAE9CA,OAF8C;;AAItD,SAAO;AACLhB,OAAG,kBAAMgB,UAAUpB,WAAWqB,IAA3B,EAAiC,CAAjC,EAAoCpB,MAApC,CADE;AAELgB,OAAG;AAFE,GAAP;AAID;;AAED;;;;;;;AAOO,SAASnB,qBAAT,CAA+BY,KAA/B,EAAsCY,YAAtC,EAAoD;AACzD,SAAOC,KAAKC,KAAL,CAAWd,QAAQY,YAAnB,IAAmCA,YAA1C;AACD","file":"value-transformer.js","sourcesContent":["import { clamp } from '../utils';\n\n/**\n * Convert a point into a percentage value\n * @ignore\n * @param {Point} position\n * @param {ClientRect} clientRect\n * @return {number} Percentage value\n */\nexport function getPercentageFromPosition(position, clientRect) {\n const length = clientRect.width;\n const sizePerc = position.x / length;\n\n return sizePerc || 0;\n}\n\n/**\n * Convert a point into a model value\n * @ignore\n * @param {Point} position\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {number}\n */\nexport function getValueFromPosition(position, minValue, maxValue, clientRect) {\n const sizePerc = getPercentageFromPosition(position, clientRect);\n const valueDiff = maxValue - minValue;\n\n return minValue + (valueDiff * sizePerc);\n}\n\n/**\n * Convert props into a range value\n * @ignore\n * @param {Object} props\n * @param {boolean} isMultiValue\n * @return {Range}\n */\nexport function getValueFromProps(props, isMultiValue) {\n if (isMultiValue) {\n return { ...props.value };\n }\n\n return {\n min: props.minValue,\n max: props.value,\n };\n}\n\n/**\n * Convert a model value into a percentage value\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @return {number}\n */\nexport function getPercentageFromValue(value, minValue, maxValue) {\n const validValue = clamp(value, minValue, maxValue);\n const valueDiff = maxValue - minValue;\n const valuePerc = (validValue - minValue) / valueDiff;\n\n return valuePerc || 0;\n}\n\n/**\n * Convert model values into percentage values\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @return {Range}\n */\nexport function getPercentagesFromValues(values, minValue, maxValue) {\n return {\n min: getPercentageFromValue(values.min, minValue, maxValue),\n max: getPercentageFromValue(values.max, minValue, maxValue),\n };\n}\n\n/**\n * Convert a value into a point\n * @ignore\n * @param {number} value\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Point} Position\n */\nexport function getPositionFromValue(value, minValue, maxValue, clientRect) {\n const length = clientRect.width;\n const valuePerc = getPercentageFromValue(value, minValue, maxValue);\n const positionValue = valuePerc * length;\n\n return {\n x: positionValue,\n y: 0,\n };\n}\n\n/**\n * Convert a range of values into points\n * @ignore\n * @param {Range} values\n * @param {number} minValue\n * @param {number} maxValue\n * @param {ClientRect} clientRect\n * @return {Range}\n */\nexport function getPositionsFromValues(values, minValue, maxValue, clientRect) {\n return {\n min: getPositionFromValue(values.min, minValue, maxValue, clientRect),\n max: getPositionFromValue(values.max, minValue, maxValue, clientRect),\n };\n}\n\n/**\n * Convert an event into a point\n * @ignore\n * @param {Event} event\n * @param {ClientRect} clientRect\n * @return {Point}\n */\nexport function getPositionFromEvent(event, clientRect) {\n const length = clientRect.width;\n const { clientX } = event.touches ? event.touches[0] : event;\n\n return {\n x: clamp(clientX - clientRect.left, 0, length),\n y: 0,\n };\n}\n\n/**\n * Convert a value into a step value\n * @ignore\n * @param {number} value\n * @param {number} valuePerStep\n * @return {number}\n */\nexport function getStepValueFromValue(value, valuePerStep) {\n return Math.round(value / valuePerStep) * valuePerStep;\n}\n"]} \ No newline at end of file diff --git a/lib/js/utils/captialize.js b/lib/js/utils/captialize.js new file mode 100644 index 0000000..09f47aa --- /dev/null +++ b/lib/js/utils/captialize.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = captialize; +/** + * Captialize a string + * @ignore + * @param {string} string + * @return {string} + */ +function captialize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} +module.exports = exports["default"]; +//# sourceMappingURL=captialize.js.map \ No newline at end of file diff --git a/lib/js/utils/captialize.js.map b/lib/js/utils/captialize.js.map new file mode 100644 index 0000000..a5413e7 --- /dev/null +++ b/lib/js/utils/captialize.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/captialize.js"],"names":["captialize","string","charAt","toUpperCase","slice"],"mappings":";;;;;kBAMwBA,U;AANxB;;;;;;AAMe,SAASA,UAAT,CAAoBC,MAApB,EAA4B;AACzC,SAAOA,OAAOC,MAAP,CAAc,CAAd,EAAiBC,WAAjB,KAAiCF,OAAOG,KAAP,CAAa,CAAb,CAAxC;AACD","file":"captialize.js","sourcesContent":["/**\n * Captialize a string\n * @ignore\n * @param {string} string\n * @return {string}\n */\nexport default function captialize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n"]} \ No newline at end of file diff --git a/lib/js/utils/clamp.js b/lib/js/utils/clamp.js new file mode 100644 index 0000000..cd6c491 --- /dev/null +++ b/lib/js/utils/clamp.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = clamp; +/** + * Clamp a value between a min and max value + * @ignore + * @param {number} value + * @param {number} min + * @param {number} max + * @return {number} + */ +function clamp(value, min, max) { + return Math.min(Math.max(value, min), max); +} +module.exports = exports["default"]; +//# sourceMappingURL=clamp.js.map \ No newline at end of file diff --git a/lib/js/utils/clamp.js.map b/lib/js/utils/clamp.js.map new file mode 100644 index 0000000..a82326b --- /dev/null +++ b/lib/js/utils/clamp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/clamp.js"],"names":["clamp","value","min","max","Math"],"mappings":";;;;;kBAQwBA,K;AARxB;;;;;;;;AAQe,SAASA,KAAT,CAAeC,KAAf,EAAsBC,GAAtB,EAA2BC,GAA3B,EAAgC;AAC7C,SAAOC,KAAKF,GAAL,CAASE,KAAKD,GAAL,CAASF,KAAT,EAAgBC,GAAhB,CAAT,EAA+BC,GAA/B,CAAP;AACD","file":"clamp.js","sourcesContent":["/**\n * Clamp a value between a min and max value\n * @ignore\n * @param {number} value\n * @param {number} min\n * @param {number} max\n * @return {number}\n */\nexport default function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n"]} \ No newline at end of file diff --git a/lib/js/utils/distance-to.js b/lib/js/utils/distance-to.js new file mode 100644 index 0000000..22e3449 --- /dev/null +++ b/lib/js/utils/distance-to.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = distanceTo; +/** + * Calculate the distance between pointA and pointB + * @ignore + * @param {Point} pointA + * @param {Point} pointB + * @return {number} Distance + */ +function distanceTo(pointA, pointB) { + var xDiff = Math.pow(pointB.x - pointA.x, 2); + var yDiff = Math.pow(pointB.y - pointA.y, 2); + + return Math.sqrt(xDiff + yDiff); +} +module.exports = exports["default"]; +//# sourceMappingURL=distance-to.js.map \ No newline at end of file diff --git a/lib/js/utils/distance-to.js.map b/lib/js/utils/distance-to.js.map new file mode 100644 index 0000000..3242600 --- /dev/null +++ b/lib/js/utils/distance-to.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/distance-to.js"],"names":["distanceTo","pointA","pointB","xDiff","x","yDiff","y","Math","sqrt"],"mappings":";;;;;kBAOwBA,U;AAPxB;;;;;;;AAOe,SAASA,UAAT,CAAoBC,MAApB,EAA4BC,MAA5B,EAAoC;AACjD,MAAMC,iBAASD,OAAOE,CAAP,GAAWH,OAAOG,CAA3B,EAAiC,CAAjC,CAAN;AACA,MAAMC,iBAASH,OAAOI,CAAP,GAAWL,OAAOK,CAA3B,EAAiC,CAAjC,CAAN;;AAEA,SAAOC,KAAKC,IAAL,CAAUL,QAAQE,KAAlB,CAAP;AACD","file":"distance-to.js","sourcesContent":["/**\n * Calculate the distance between pointA and pointB\n * @ignore\n * @param {Point} pointA\n * @param {Point} pointB\n * @return {number} Distance\n */\nexport default function distanceTo(pointA, pointB) {\n const xDiff = (pointB.x - pointA.x) ** 2;\n const yDiff = (pointB.y - pointA.y) ** 2;\n\n return Math.sqrt(xDiff + yDiff);\n}\n"]} \ No newline at end of file diff --git a/lib/js/utils/index.js b/lib/js/utils/index.js new file mode 100644 index 0000000..14f7751 --- /dev/null +++ b/lib/js/utils/index.js @@ -0,0 +1,71 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _captialize = require('./captialize'); + +Object.defineProperty(exports, 'captialize', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_captialize).default; + } +}); + +var _clamp = require('./clamp'); + +Object.defineProperty(exports, 'clamp', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_clamp).default; + } +}); + +var _distanceTo = require('./distance-to'); + +Object.defineProperty(exports, 'distanceTo', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_distanceTo).default; + } +}); + +var _isDefined = require('./is-defined'); + +Object.defineProperty(exports, 'isDefined', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_isDefined).default; + } +}); + +var _isNumber = require('./is-number'); + +Object.defineProperty(exports, 'isNumber', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_isNumber).default; + } +}); + +var _isObject = require('./is-object'); + +Object.defineProperty(exports, 'isObject', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_isObject).default; + } +}); + +var _length = require('./length'); + +Object.defineProperty(exports, 'length', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_length).default; + } +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/js/utils/index.js.map b/lib/js/utils/index.js.map new file mode 100644 index 0000000..2e7b0e3 --- /dev/null +++ b/lib/js/utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/index.js"],"names":["default"],"mappings":";;;;;;;;;;;+CAASA,O;;;;;;;;;0CACAA,O;;;;;;;;;+CACAA,O;;;;;;;;;8CACAA,O;;;;;;;;;6CACAA,O;;;;;;;;;6CACAA,O;;;;;;;;;2CACAA,O","file":"index.js","sourcesContent":["export { default as captialize } from './captialize';\nexport { default as clamp } from './clamp';\nexport { default as distanceTo } from './distance-to';\nexport { default as isDefined } from './is-defined';\nexport { default as isNumber } from './is-number';\nexport { default as isObject } from './is-object';\nexport { default as length } from './length';\n"]} \ No newline at end of file diff --git a/lib/js/utils/is-defined.js b/lib/js/utils/is-defined.js new file mode 100644 index 0000000..e5e838a --- /dev/null +++ b/lib/js/utils/is-defined.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isDefined; +/** + * Check if a value is defined + * @ignore + * @param {*} value + * @return {boolean} + */ +function isDefined(value) { + return value !== undefined && value !== null; +} +module.exports = exports["default"]; +//# sourceMappingURL=is-defined.js.map \ No newline at end of file diff --git a/lib/js/utils/is-defined.js.map b/lib/js/utils/is-defined.js.map new file mode 100644 index 0000000..4911398 --- /dev/null +++ b/lib/js/utils/is-defined.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/is-defined.js"],"names":["isDefined","value","undefined"],"mappings":";;;;;kBAMwBA,S;AANxB;;;;;;AAMe,SAASA,SAAT,CAAmBC,KAAnB,EAA0B;AACvC,SAAOA,UAAUC,SAAV,IAAuBD,UAAU,IAAxC;AACD","file":"is-defined.js","sourcesContent":["/**\n * Check if a value is defined\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isDefined(value) {\n return value !== undefined && value !== null;\n}\n"]} \ No newline at end of file diff --git a/lib/js/utils/is-number.js b/lib/js/utils/is-number.js new file mode 100644 index 0000000..973064c --- /dev/null +++ b/lib/js/utils/is-number.js @@ -0,0 +1,17 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isNumber; +/** + * Check if a value is a number + * @ignore + * @param {*} value + * @return {boolean} + */ +function isNumber(value) { + return typeof value === 'number'; +} +module.exports = exports['default']; +//# sourceMappingURL=is-number.js.map \ No newline at end of file diff --git a/lib/js/utils/is-number.js.map b/lib/js/utils/is-number.js.map new file mode 100644 index 0000000..068422c --- /dev/null +++ b/lib/js/utils/is-number.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/is-number.js"],"names":["isNumber","value"],"mappings":";;;;;kBAMwBA,Q;AANxB;;;;;;AAMe,SAASA,QAAT,CAAkBC,KAAlB,EAAyB;AACtC,SAAO,OAAOA,KAAP,KAAiB,QAAxB;AACD","file":"is-number.js","sourcesContent":["/**\n * Check if a value is a number\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isNumber(value) {\n return typeof value === 'number';\n}\n"]} \ No newline at end of file diff --git a/lib/js/utils/is-object.js b/lib/js/utils/is-object.js new file mode 100644 index 0000000..12b53d8 --- /dev/null +++ b/lib/js/utils/is-object.js @@ -0,0 +1,20 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +exports.default = isObject; +/** + * Check if a value is an object + * @ignore + * @param {*} value + * @return {boolean} + */ +function isObject(value) { + return value !== null && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object'; +} +module.exports = exports['default']; +//# sourceMappingURL=is-object.js.map \ No newline at end of file diff --git a/lib/js/utils/is-object.js.map b/lib/js/utils/is-object.js.map new file mode 100644 index 0000000..9f8faf8 --- /dev/null +++ b/lib/js/utils/is-object.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/is-object.js"],"names":["isObject","value"],"mappings":";;;;;;;;kBAMwBA,Q;AANxB;;;;;;AAMe,SAASA,QAAT,CAAkBC,KAAlB,EAAyB;AACtC,SAAOA,UAAU,IAAV,IAAkB,QAAOA,KAAP,yCAAOA,KAAP,OAAiB,QAA1C;AACD","file":"is-object.js","sourcesContent":["/**\n * Check if a value is an object\n * @ignore\n * @param {*} value\n * @return {boolean}\n */\nexport default function isObject(value) {\n return value !== null && typeof value === 'object';\n}\n"]} \ No newline at end of file diff --git a/lib/js/utils/length.js b/lib/js/utils/length.js new file mode 100644 index 0000000..cb904b9 --- /dev/null +++ b/lib/js/utils/length.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = length; +/** + * Calculate the absolute difference between two numbers + * @ignore + * @param {number} numA + * @param {number} numB + * @return {number} + */ +function length(numA, numB) { + return Math.abs(numA - numB); +} +module.exports = exports["default"]; +//# sourceMappingURL=length.js.map \ No newline at end of file diff --git a/lib/js/utils/length.js.map b/lib/js/utils/length.js.map new file mode 100644 index 0000000..91b61ac --- /dev/null +++ b/lib/js/utils/length.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../src/js/utils/length.js"],"names":["length","numA","numB","Math","abs"],"mappings":";;;;;kBAOwBA,M;AAPxB;;;;;;;AAOe,SAASA,MAAT,CAAgBC,IAAhB,EAAsBC,IAAtB,EAA4B;AACzC,SAAOC,KAAKC,GAAL,CAASH,OAAOC,IAAhB,CAAP;AACD","file":"length.js","sourcesContent":["/**\n * Calculate the absolute difference between two numbers\n * @ignore\n * @param {number} numA\n * @param {number} numB\n * @return {number}\n */\nexport default function length(numA, numB) {\n return Math.abs(numA - numB);\n}\n"]} \ No newline at end of file diff --git a/react-input-range.d.ts b/react-input-range.d.ts index b2b13e5..a8fc059 100644 --- a/react-input-range.d.ts +++ b/react-input-range.d.ts @@ -34,6 +34,7 @@ export interface InputRangeProps { onChangeComplete?: (value: Range | number) => void; step?: number; value: Range | number; + renderSubLabels?: boolean; } export default class InputRange extends React.Component { diff --git a/src/js/input-range/default-class-names.js b/src/js/input-range/default-class-names.js index 7b5d688..988b2f7 100644 --- a/src/js/input-range/default-class-names.js +++ b/src/js/input-range/default-class-names.js @@ -10,6 +10,11 @@ const DEFAULT_CLASS_NAMES = { labelContainer: 'input-range__label-container', maxLabel: 'input-range__label input-range__label--max', minLabel: 'input-range__label input-range__label--min', + fstLabel: 'input-range__label input-range__label--fst', + sndLabel: 'input-range__label input-range__label--snd', + thdLabel: 'input-range__label input-range__label--thd', + sublabel: 'input-range__label--sublabel', + inactiveCircleLabel: 'input-range__label--inactive', slider: 'input-range__slider', sliderContainer: 'input-range__slider-container', track: 'input-range__track input-range__track--background', diff --git a/src/js/input-range/input-range.jsx b/src/js/input-range/input-range.jsx index a097d4f..734c59c 100644 --- a/src/js/input-range/input-range.jsx +++ b/src/js/input-range/input-range.jsx @@ -8,7 +8,7 @@ import rangePropType from './range-prop-type'; import valuePropType from './value-prop-type'; import Slider from './slider'; import Track from './track'; -import { captialize, distanceTo, isDefined, isObject, length } from '../utils'; +import { captialize, distanceTo, isDefined, isObject, length, isNumber } from '../utils'; import { DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, UP_ARROW } from './key-codes'; /** @@ -38,6 +38,7 @@ export default class InputRange extends React.Component { onChangeComplete: PropTypes.func, step: PropTypes.number, value: valuePropType, + renderSubLabels: PropTypes.bool, }; } @@ -54,6 +55,7 @@ export default class InputRange extends React.Component { maxValue: 10, minValue: 0, step: 1, + renderSubLabels: false, }; } @@ -73,6 +75,7 @@ export default class InputRange extends React.Component { * @param {Function} [props.onChangeStart] * @param {number} [props.step = 1] * @param {number|Range} props.value + * @param {boolean} props.renderSubLabels */ constructor(props) { super(props); @@ -175,6 +178,21 @@ export default class InputRange extends React.Component { return ['max']; } + /** + * @private + * @return {Object} + */ + getStyle(val) { + const { maxValue, minValue } = this.props; + const perc = ((val - minValue) / (maxValue - minValue)) * 100; + const style = { + position: 'absolute', + left: `${perc}%`, + }; + + return style; + } + /** * Return true if the difference between the new and the current value is * greater or equal to the step amount of the component @@ -656,6 +674,35 @@ export default class InputRange extends React.Component { const values = valueTransformer.getValueFromProps(this.props, this.isMultiValue()); const percentages = valueTransformer.getPercentagesFromValues(values, this.props.minValue, this.props.maxValue); + let fstLabelVal = 0; + let sndLabelVal = 0; + let thdLabelVal = 0; + let fstLabelStyle = {}; + let sndLabelStyle = {}; + let thdLabelStyle = {}; + + if (this.props.renderSubLabels) { + fstLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 1) + this.props.minValue; + sndLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 2) + this.props.minValue; + thdLabelVal = ((Math.round((this.props.maxValue - this.props.minValue) / 4)) * 3) + this.props.minValue; + + fstLabelStyle = this.getStyle(fstLabelVal); + sndLabelStyle = this.getStyle(sndLabelVal); + thdLabelStyle = this.getStyle(thdLabelVal); + } + + const inactiveSeqValues = []; + let inactiveSeq = null; + if (isNumber(this.props.value)) { + for (let i = this.props.value; i < this.props.maxValue; i++) { + inactiveSeqValues.push(i); + } + inactiveSeq = inactiveSeqValues.map((value) => { + const style = this.getStyle(value); + return
; + }); + } + return (
+ {this.props.renderSubLabels && +
+ + + + + + + + + + + +
+ } + + {isNumber(this.props.value) && +
+ {inactiveSeq} +
+ } +