8d77b50386265bc6f5fc04da202d2bdc.json
56.8 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport classNames from 'classnames';\nimport Track from './common/Track';\nimport createSlider from './common/createSlider';\nimport * as utils from './utils';\n\nvar _trimAlignValue = function trimAlignValue(_ref) {\n var value = _ref.value,\n handle = _ref.handle,\n bounds = _ref.bounds,\n props = _ref.props;\n var allowCross = props.allowCross,\n pushable = props.pushable;\n var thershold = Number(pushable);\n var valInRange = utils.ensureValueInRange(value, props);\n var valNotConflict = valInRange;\n\n if (!allowCross && handle != null && bounds !== undefined) {\n if (handle > 0 && valInRange <= bounds[handle - 1] + thershold) {\n valNotConflict = bounds[handle - 1] + thershold;\n }\n\n if (handle < bounds.length - 1 && valInRange >= bounds[handle + 1] - thershold) {\n valNotConflict = bounds[handle + 1] - thershold;\n }\n }\n\n return utils.ensureValuePrecision(valNotConflict, props);\n};\n\nvar Range = /*#__PURE__*/function (_React$Component) {\n _inherits(Range, _React$Component);\n\n var _super = _createSuper(Range);\n\n function Range(props) {\n var _this;\n\n _classCallCheck(this, Range);\n\n _this = _super.call(this, props);\n\n _this.onEnd = function (force) {\n var handle = _this.state.handle;\n\n _this.removeDocumentEvents();\n\n if (handle !== null || force) {\n _this.props.onAfterChange(_this.getValue());\n }\n\n _this.setState({\n handle: null\n });\n };\n\n var count = props.count,\n min = props.min,\n max = props.max;\n var initialValue = Array.apply(void 0, _toConsumableArray(Array(count + 1))).map(function () {\n return min;\n });\n var defaultValue = 'defaultValue' in props ? props.defaultValue : initialValue;\n var value = props.value !== undefined ? props.value : defaultValue;\n var bounds = value.map(function (v, i) {\n return _trimAlignValue({\n value: v,\n handle: i,\n props: props\n });\n });\n var recent = bounds[0] === max ? 0 : bounds.length - 1;\n _this.state = {\n handle: null,\n recent: recent,\n bounds: bounds\n };\n return _this;\n }\n /**\n * [Legacy] Used for inherit other component.\n * It's a bad code style which should be refactor.\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars, class-methods-use-this */\n\n\n _createClass(Range, [{\n key: \"calcValueByPos\",\n value: function calcValueByPos(value) {\n return 0;\n }\n }, {\n key: \"calcOffset\",\n value: function calcOffset(value) {\n return 0;\n }\n }, {\n key: \"saveHandle\",\n value: function saveHandle(index, h) {}\n }, {\n key: \"removeDocumentEvents\",\n value: function removeDocumentEvents() {}\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var _this2 = this;\n\n var _this$props = this.props,\n onChange = _this$props.onChange,\n value = _this$props.value,\n min = _this$props.min,\n max = _this$props.max;\n\n if (!('min' in this.props || 'max' in this.props)) {\n return;\n }\n\n if (min === prevProps.min && max === prevProps.max) {\n return;\n }\n\n var currentValue = value || prevState.bounds;\n\n if (currentValue.some(function (v) {\n return utils.isValueOutOfRange(v, _this2.props);\n })) {\n var newValues = currentValue.map(function (v) {\n return utils.ensureValueInRange(v, _this2.props);\n });\n onChange(newValues);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(state) {\n var props = this.props;\n var isNotControlled = !('value' in props);\n\n if (isNotControlled) {\n this.setState(state);\n } else {\n var controlledState = {};\n ['handle', 'recent'].forEach(function (item) {\n if (state[item] !== undefined) {\n controlledState[item] = state[item];\n }\n });\n\n if (Object.keys(controlledState).length) {\n this.setState(controlledState);\n }\n }\n\n var data = _objectSpread(_objectSpread({}, this.state), state);\n\n var changedValue = data.bounds;\n props.onChange(changedValue);\n }\n }, {\n key: \"onStart\",\n value: function onStart(position) {\n var props = this.props,\n state = this.state;\n var bounds = this.getValue();\n props.onBeforeChange(bounds);\n var value = this.calcValueByPos(position);\n this.startValue = value;\n this.startPosition = position;\n var closestBound = this.getClosestBound(value);\n this.prevMovedHandleIndex = this.getBoundNeedMoving(value, closestBound);\n this.setState({\n handle: this.prevMovedHandleIndex,\n recent: this.prevMovedHandleIndex\n });\n var prevValue = bounds[this.prevMovedHandleIndex];\n if (value === prevValue) return;\n\n var nextBounds = _toConsumableArray(state.bounds);\n\n nextBounds[this.prevMovedHandleIndex] = value;\n this.onChange({\n bounds: nextBounds\n });\n }\n }, {\n key: \"onMove\",\n value: function onMove(e, position) {\n utils.pauseEvent(e);\n var state = this.state;\n var value = this.calcValueByPos(position);\n var oldValue = state.bounds[state.handle];\n if (value === oldValue) return;\n this.moveTo(value);\n }\n }, {\n key: \"onKeyboard\",\n value: function onKeyboard(e) {\n var _this$props2 = this.props,\n reverse = _this$props2.reverse,\n vertical = _this$props2.vertical;\n var valueMutator = utils.getKeyboardValueMutator(e, vertical, reverse);\n\n if (valueMutator) {\n utils.pauseEvent(e);\n var state = this.state,\n props = this.props;\n var bounds = state.bounds,\n handle = state.handle;\n var oldValue = bounds[handle === null ? state.recent : handle];\n var mutatedValue = valueMutator(oldValue, props);\n\n var value = _trimAlignValue({\n value: mutatedValue,\n handle: handle,\n bounds: state.bounds,\n props: props\n });\n\n if (value === oldValue) return;\n var isFromKeyboardEvent = true;\n this.moveTo(value, isFromKeyboardEvent);\n }\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.state.bounds;\n }\n }, {\n key: \"getClosestBound\",\n value: function getClosestBound(value) {\n var bounds = this.state.bounds;\n var closestBound = 0;\n\n for (var i = 1; i < bounds.length - 1; i += 1) {\n if (value >= bounds[i]) {\n closestBound = i;\n }\n }\n\n if (Math.abs(bounds[closestBound + 1] - value) < Math.abs(bounds[closestBound] - value)) {\n closestBound += 1;\n }\n\n return closestBound;\n }\n }, {\n key: \"getBoundNeedMoving\",\n value: function getBoundNeedMoving(value, closestBound) {\n var _this$state = this.state,\n bounds = _this$state.bounds,\n recent = _this$state.recent;\n var boundNeedMoving = closestBound;\n var isAtTheSamePoint = bounds[closestBound + 1] === bounds[closestBound];\n\n if (isAtTheSamePoint && bounds[recent] === bounds[closestBound]) {\n boundNeedMoving = recent;\n }\n\n if (isAtTheSamePoint && value !== bounds[closestBound + 1]) {\n boundNeedMoving = value < bounds[closestBound + 1] ? closestBound : closestBound + 1;\n }\n\n return boundNeedMoving;\n }\n }, {\n key: \"getLowerBound\",\n value: function getLowerBound() {\n return this.state.bounds[0];\n }\n }, {\n key: \"getUpperBound\",\n value: function getUpperBound() {\n var bounds = this.state.bounds;\n return bounds[bounds.length - 1];\n }\n /**\n * Returns an array of possible slider points, taking into account both\n * `marks` and `step`. The result is cached.\n */\n\n }, {\n key: \"getPoints\",\n value: function getPoints() {\n var _this$props3 = this.props,\n marks = _this$props3.marks,\n step = _this$props3.step,\n min = _this$props3.min,\n max = _this$props3.max;\n var cache = this.internalPointsCache;\n\n if (!cache || cache.marks !== marks || cache.step !== step) {\n var pointsObject = _objectSpread({}, marks);\n\n if (step !== null) {\n for (var point = min; point <= max; point += step) {\n pointsObject[point] = point;\n }\n }\n\n var points = Object.keys(pointsObject).map(parseFloat);\n points.sort(function (a, b) {\n return a - b;\n });\n this.internalPointsCache = {\n marks: marks,\n step: step,\n points: points\n };\n }\n\n return this.internalPointsCache.points;\n }\n }, {\n key: \"moveTo\",\n value: function moveTo(value, isFromKeyboardEvent) {\n var _this3 = this;\n\n var state = this.state,\n props = this.props;\n\n var nextBounds = _toConsumableArray(state.bounds);\n\n var handle = state.handle === null ? state.recent : state.handle;\n nextBounds[handle] = value;\n var nextHandle = handle;\n\n if (props.pushable !== false) {\n this.pushSurroundingHandles(nextBounds, nextHandle);\n } else if (props.allowCross) {\n nextBounds.sort(function (a, b) {\n return a - b;\n });\n nextHandle = nextBounds.indexOf(value);\n }\n\n this.onChange({\n recent: nextHandle,\n handle: nextHandle,\n bounds: nextBounds\n });\n\n if (isFromKeyboardEvent) {\n // known problem: because setState is async,\n // so trigger focus will invoke handler's onEnd and another handler's onStart too early,\n // cause onBeforeChange and onAfterChange receive wrong value.\n // here use setState callback to hack,but not elegant\n this.props.onAfterChange(nextBounds);\n this.setState({}, function () {\n _this3.handlesRefs[nextHandle].focus();\n });\n this.onEnd();\n }\n }\n }, {\n key: \"pushSurroundingHandles\",\n value: function pushSurroundingHandles(bounds, handle) {\n var value = bounds[handle];\n var pushable = this.props.pushable;\n var threshold = Number(pushable);\n var direction = 0;\n\n if (bounds[handle + 1] - value < threshold) {\n direction = +1; // push to right\n }\n\n if (value - bounds[handle - 1] < threshold) {\n direction = -1; // push to left\n }\n\n if (direction === 0) {\n return;\n }\n\n var nextHandle = handle + direction;\n var diffToNext = direction * (bounds[nextHandle] - value);\n\n if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) {\n // revert to original value if pushing is impossible\n // eslint-disable-next-line no-param-reassign\n bounds[handle] = bounds[nextHandle] - direction * threshold;\n }\n }\n }, {\n key: \"pushHandle\",\n value: function pushHandle(bounds, handle, direction, amount) {\n var originalValue = bounds[handle];\n var currentValue = bounds[handle];\n\n while (direction * (currentValue - originalValue) < amount) {\n if (!this.pushHandleOnePoint(bounds, handle, direction)) {\n // can't push handle enough to create the needed `amount` gap, so we\n // revert its position to the original value\n // eslint-disable-next-line no-param-reassign\n bounds[handle] = originalValue;\n return false;\n }\n\n currentValue = bounds[handle];\n } // the handle was pushed enough to create the needed `amount` gap\n\n\n return true;\n }\n }, {\n key: \"pushHandleOnePoint\",\n value: function pushHandleOnePoint(bounds, handle, direction) {\n var points = this.getPoints();\n var pointIndex = points.indexOf(bounds[handle]);\n var nextPointIndex = pointIndex + direction;\n\n if (nextPointIndex >= points.length || nextPointIndex < 0) {\n // reached the minimum or maximum available point, can't push anymore\n return false;\n }\n\n var nextHandle = handle + direction;\n var nextValue = points[nextPointIndex];\n var pushable = this.props.pushable;\n var threshold = Number(pushable);\n var diffToNext = direction * (bounds[nextHandle] - nextValue);\n\n if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) {\n // couldn't push next handle, so we won't push this one either\n return false;\n } // push the handle\n // eslint-disable-next-line no-param-reassign\n\n\n bounds[handle] = nextValue;\n return true;\n }\n }, {\n key: \"trimAlignValue\",\n value: function trimAlignValue(value) {\n var _this$state2 = this.state,\n handle = _this$state2.handle,\n bounds = _this$state2.bounds;\n return _trimAlignValue({\n value: value,\n handle: handle,\n bounds: bounds,\n props: this.props\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var _this$state3 = this.state,\n handle = _this$state3.handle,\n bounds = _this$state3.bounds;\n var _this$props4 = this.props,\n prefixCls = _this$props4.prefixCls,\n vertical = _this$props4.vertical,\n included = _this$props4.included,\n disabled = _this$props4.disabled,\n min = _this$props4.min,\n max = _this$props4.max,\n reverse = _this$props4.reverse,\n handleGenerator = _this$props4.handle,\n trackStyle = _this$props4.trackStyle,\n handleStyle = _this$props4.handleStyle,\n tabIndex = _this$props4.tabIndex,\n ariaLabelGroupForHandles = _this$props4.ariaLabelGroupForHandles,\n ariaLabelledByGroupForHandles = _this$props4.ariaLabelledByGroupForHandles,\n ariaValueTextFormatterGroupForHandles = _this$props4.ariaValueTextFormatterGroupForHandles;\n var offsets = bounds.map(function (v) {\n return _this4.calcOffset(v);\n });\n var handleClassName = \"\".concat(prefixCls, \"-handle\");\n var handles = bounds.map(function (v, i) {\n var _classNames;\n\n var mergedTabIndex = tabIndex[i] || 0;\n\n if (disabled || tabIndex[i] === null) {\n mergedTabIndex = null;\n }\n\n var dragging = handle === i;\n return handleGenerator({\n className: classNames((_classNames = {}, _defineProperty(_classNames, handleClassName, true), _defineProperty(_classNames, \"\".concat(handleClassName, \"-\").concat(i + 1), true), _defineProperty(_classNames, \"\".concat(handleClassName, \"-dragging\"), dragging), _classNames)),\n prefixCls: prefixCls,\n vertical: vertical,\n dragging: dragging,\n offset: offsets[i],\n value: v,\n index: i,\n tabIndex: mergedTabIndex,\n min: min,\n max: max,\n reverse: reverse,\n disabled: disabled,\n style: handleStyle[i],\n ref: function ref(h) {\n return _this4.saveHandle(i, h);\n },\n ariaLabel: ariaLabelGroupForHandles[i],\n ariaLabelledBy: ariaLabelledByGroupForHandles[i],\n ariaValueTextFormatter: ariaValueTextFormatterGroupForHandles[i]\n });\n });\n var tracks = bounds.slice(0, -1).map(function (_, index) {\n var _classNames2;\n\n var i = index + 1;\n var trackClassName = classNames((_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-track\"), true), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-track-\").concat(i), true), _classNames2));\n return React.createElement(Track, {\n className: trackClassName,\n vertical: vertical,\n reverse: reverse,\n included: included,\n offset: offsets[i - 1],\n length: offsets[i] - offsets[i - 1],\n style: trackStyle[index],\n key: i\n });\n });\n return {\n tracks: tracks,\n handles: handles\n };\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n if (!('value' in props || 'min' in props || 'max' in props)) {\n return null;\n }\n\n var value = props.value || state.bounds;\n var nextBounds = value.map(function (v, i) {\n return _trimAlignValue({\n value: v,\n handle: i,\n bounds: state.bounds,\n props: props\n });\n });\n\n if (state.bounds.length === nextBounds.length) {\n if (nextBounds.every(function (v, i) {\n return v === state.bounds[i];\n })) {\n return null;\n }\n } else {\n nextBounds = value.map(function (v, i) {\n return _trimAlignValue({\n value: v,\n handle: i,\n props: props\n });\n });\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n bounds: nextBounds\n });\n }\n }]);\n\n return Range;\n}(React.Component);\n/* eslint-enable */\n\n\nRange.displayName = 'Range';\nRange.defaultProps = {\n count: 1,\n allowCross: true,\n pushable: false,\n tabIndex: [],\n ariaLabelGroupForHandles: [],\n ariaLabelledByGroupForHandles: [],\n ariaValueTextFormatterGroupForHandles: []\n};\nexport default createSlider(Range);","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/Range.js"],"names":["_defineProperty","_objectSpread","_toConsumableArray","_classCallCheck","_createClass","_inherits","_createSuper","React","classNames","Track","createSlider","utils","_trimAlignValue","trimAlignValue","_ref","value","handle","bounds","props","allowCross","pushable","thershold","Number","valInRange","ensureValueInRange","valNotConflict","undefined","length","ensureValuePrecision","Range","_React$Component","_super","_this","call","onEnd","force","state","removeDocumentEvents","onAfterChange","getValue","setState","count","min","max","initialValue","Array","apply","map","defaultValue","v","i","recent","key","calcValueByPos","calcOffset","saveHandle","index","h","componentDidUpdate","prevProps","prevState","_this2","_this$props","onChange","currentValue","some","isValueOutOfRange","newValues","isNotControlled","controlledState","forEach","item","Object","keys","data","changedValue","onStart","position","onBeforeChange","startValue","startPosition","closestBound","getClosestBound","prevMovedHandleIndex","getBoundNeedMoving","prevValue","nextBounds","onMove","e","pauseEvent","oldValue","moveTo","onKeyboard","_this$props2","reverse","vertical","valueMutator","getKeyboardValueMutator","mutatedValue","isFromKeyboardEvent","Math","abs","_this$state","boundNeedMoving","isAtTheSamePoint","getLowerBound","getUpperBound","getPoints","_this$props3","marks","step","cache","internalPointsCache","pointsObject","point","points","parseFloat","sort","a","b","_this3","nextHandle","pushSurroundingHandles","indexOf","handlesRefs","focus","threshold","direction","diffToNext","pushHandle","amount","originalValue","pushHandleOnePoint","pointIndex","nextPointIndex","nextValue","_this$state2","render","_this4","_this$state3","_this$props4","prefixCls","included","disabled","handleGenerator","trackStyle","handleStyle","tabIndex","ariaLabelGroupForHandles","ariaLabelledByGroupForHandles","ariaValueTextFormatterGroupForHandles","offsets","handleClassName","concat","handles","_classNames","mergedTabIndex","dragging","className","offset","style","ref","ariaLabel","ariaLabelledBy","ariaValueTextFormatter","tracks","slice","_","_classNames2","trackClassName","createElement","getDerivedStateFromProps","every","Component","displayName","defaultProps"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,aAAP,MAA0B,0CAA1B;AACA,OAAOC,kBAAP,MAA+B,8CAA/B;AACA,O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AGvE,KAAK,CAACgC,GAAN,CAAU,UAAUE,CAAV,EAAaC,CAAb,EAAgB;AACrC,iBAAOtC,eAAe,CAAC;AACrBG,YAAAA,KAAK,EAAEkC,CADc;AAErBjC,YAAAA,MAAM,EAAEkC,CAFa;AAGrBhC,YAAAA,KAAK,EAAEA;AAHc,WAAD,CAAtB;AAKD,SANY,CAAb;AAOD;;AAED,aAAOjB,aAAa,CAACA,aAAa,CAAC,EAAD,EAAKmC,KAAL,CAAd,EAA2B,EAA3B,EAA+B;AACjDnB,QAAAA,MAAM,EAAEqE;AADyC,OAA/B,CAApB;AAGD;AApCE,GAAD,CAvbQ,CAAZ;;AA8dA,SAAOzD,KAAP;AACD,CAxhBwB,CAwhBvBtB,KAAK,CAACsK,SAxhBiB,CAAzB;AAyhBA;;;AAGAhJ,KAAK,CAACiJ,WAAN,GAAoB,OAApB;AACAjJ,KAAK,CAACkJ,YAAN,GAAqB;AACnBtI,EAAAA,KAAK,EAAE,CADY;AAEnBtB,EAAAA,UAAU,EAAE,IAFO;AAGnBC,EAAAA,QAAQ,EAAE,KAHS;AAInB+H,EAAAA,QAAQ,EAAE,EAJS;AAKnBC,EAAAA,wBAAwB,EAAE,EALP;AAMnBC,EAAAA,6BAA6B,EAAE,EANZ;AAOnBC,EAAAA,qCAAqC,EAAE;AAPpB,CAArB;AASA,eAAe5I,YAAY,CAACmB,KAAD,CAA3B","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport classNames from 'classnames';\nimport Track from './common/Track';\nimport createSlider from './common/createSlider';\nimport * as utils from './utils';\n\nvar _trimAlignValue = function trimAlignValue(_ref) {\n var value = _ref.value,\n handle = _ref.handle,\n bounds = _ref.bounds,\n props = _ref.props;\n var allowCross = props.allowCross,\n pushable = props.pushable;\n var thershold = Number(pushable);\n var valInRange = utils.ensureValueInRange(value, props);\n var valNotConflict = valInRange;\n\n if (!allowCross && handle != null && bounds !== undefined) {\n if (handle > 0 && valInRange <= bounds[handle - 1] + thershold) {\n valNotConflict = bounds[handle - 1] + thershold;\n }\n\n if (handle < bounds.length - 1 && valInRange >= bounds[handle + 1] - thershold) {\n valNotConflict = bounds[handle + 1] - thershold;\n }\n }\n\n return utils.ensureValuePrecision(valNotConflict, props);\n};\n\nvar Range = /*#__PURE__*/function (_React$Component) {\n _inherits(Range, _React$Component);\n\n var _super = _createSuper(Range);\n\n function Range(props) {\n var _this;\n\n _classCallCheck(this, Range);\n\n _this = _super.call(this, props);\n\n _this.onEnd = function (force) {\n var handle = _this.state.handle;\n\n _this.removeDocumentEvents();\n\n if (handle !== null || force) {\n _this.props.onAfterChange(_this.getValue());\n }\n\n _this.setState({\n handle: null\n });\n };\n\n var count = props.count,\n min = props.min,\n max = props.max;\n var initialValue = Array.apply(void 0, _toConsumableArray(Array(count + 1))).map(function () {\n return min;\n });\n var defaultValue = 'defaultValue' in props ? props.defaultValue : initialValue;\n var value = props.value !== undefined ? props.value : defaultValue;\n var bounds = value.map(function (v, i) {\n return _trimAlignValue({\n value: v,\n handle: i,\n props: props\n });\n });\n var recent = bounds[0] === max ? 0 : bounds.length - 1;\n _this.state = {\n handle: null,\n recent: recent,\n bounds: bounds\n };\n return _this;\n }\n /**\n * [Legacy] Used for inherit other component.\n * It's a bad code style which should be refactor.\n */\n\n /* eslint-disable @typescript-eslint/no-unused-vars, class-methods-use-this */\n\n\n _createClass(Range, [{\n key: \"calcValueByPos\",\n value: function calcValueByPos(value) {\n return 0;\n }\n }, {\n key: \"calcOffset\",\n value: function calcOffset(value) {\n return 0;\n }\n }, {\n key: \"saveHandle\",\n value: function saveHandle(index, h) {}\n }, {\n key: \"removeDocumentEvents\",\n value: function removeDocumentEvents() {}\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var _this2 = this;\n\n var _this$props = this.props,\n onChange = _this$props.onChange,\n value = _this$props.value,\n min = _this$props.min,\n max = _this$props.max;\n\n if (!('min' in this.props || 'max' in this.props)) {\n return;\n }\n\n if (min === prevProps.min && max === prevProps.max) {\n return;\n }\n\n var currentValue = value || prevState.bounds;\n\n if (currentValue.some(function (v) {\n return utils.isValueOutOfRange(v, _this2.props);\n })) {\n var newValues = currentValue.map(function (v) {\n return utils.ensureValueInRange(v, _this2.props);\n });\n onChange(newValues);\n }\n }\n }, {\n key: \"onChange\",\n value: function onChange(state) {\n var props = this.props;\n var isNotControlled = !('value' in props);\n\n if (isNotControlled) {\n this.setState(state);\n } else {\n var controlledState = {};\n ['handle', 'recent'].forEach(function (item) {\n if (state[item] !== undefined) {\n controlledState[item] = state[item];\n }\n });\n\n if (Object.keys(controlledState).length) {\n this.setState(controlledState);\n }\n }\n\n var data = _objectSpread(_objectSpread({}, this.state), state);\n\n var changedValue = data.bounds;\n props.onChange(changedValue);\n }\n }, {\n key: \"onStart\",\n value: function onStart(position) {\n var props = this.props,\n state = this.state;\n var bounds = this.getValue();\n props.onBeforeChange(bounds);\n var value = this.calcValueByPos(position);\n this.startValue = value;\n this.startPosition = position;\n var closestBound = this.getClosestBound(value);\n this.prevMovedHandleIndex = this.getBoundNeedMoving(value, closestBound);\n this.setState({\n handle: this.prevMovedHandleIndex,\n recent: this.prevMovedHandleIndex\n });\n var prevValue = bounds[this.prevMovedHandleIndex];\n if (value === prevValue) return;\n\n var nextBounds = _toConsumableArray(state.bounds);\n\n nextBounds[this.prevMovedHandleIndex] = value;\n this.onChange({\n bounds: nextBounds\n });\n }\n }, {\n key: \"onMove\",\n value: function onMove(e, position) {\n utils.pauseEvent(e);\n var state = this.state;\n var value = this.calcValueByPos(position);\n var oldValue = state.bounds[state.handle];\n if (value === oldValue) return;\n this.moveTo(value);\n }\n }, {\n key: \"onKeyboard\",\n value: function onKeyboard(e) {\n var _this$props2 = this.props,\n reverse = _this$props2.reverse,\n vertical = _this$props2.vertical;\n var valueMutator = utils.getKeyboardValueMutator(e, vertical, reverse);\n\n if (valueMutator) {\n utils.pauseEvent(e);\n var state = this.state,\n props = this.props;\n var bounds = state.bounds,\n handle = state.handle;\n var oldValue = bounds[handle === null ? state.recent : handle];\n var mutatedValue = valueMutator(oldValue, props);\n\n var value = _trimAlignValue({\n value: mutatedValue,\n handle: handle,\n bounds: state.bounds,\n props: props\n });\n\n if (value === oldValue) return;\n var isFromKeyboardEvent = true;\n this.moveTo(value, isFromKeyboardEvent);\n }\n }\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.state.bounds;\n }\n }, {\n key: \"getClosestBound\",\n value: function getClosestBound(value) {\n var bounds = this.state.bounds;\n var closestBound = 0;\n\n for (var i = 1; i < bounds.length - 1; i += 1) {\n if (value >= bounds[i]) {\n closestBound = i;\n }\n }\n\n if (Math.abs(bounds[closestBound + 1] - value) < Math.abs(bounds[closestBound] - value)) {\n closestBound += 1;\n }\n\n return closestBound;\n }\n }, {\n key: \"getBoundNeedMoving\",\n value: function getBoundNeedMoving(value, closestBound) {\n var _this$state = this.state,\n bounds = _this$state.bounds,\n recent = _this$state.recent;\n var boundNeedMoving = closestBound;\n var isAtTheSamePoint = bounds[closestBound + 1] === bounds[closestBound];\n\n if (isAtTheSamePoint && bounds[recent] === bounds[closestBound]) {\n boundNeedMoving = recent;\n }\n\n if (isAtTheSamePoint && value !== bounds[closestBound + 1]) {\n boundNeedMoving = value < bounds[closestBound + 1] ? closestBound : closestBound + 1;\n }\n\n return boundNeedMoving;\n }\n }, {\n key: \"getLowerBound\",\n value: function getLowerBound() {\n return this.state.bounds[0];\n }\n }, {\n key: \"getUpperBound\",\n value: function getUpperBound() {\n var bounds = this.state.bounds;\n return bounds[bounds.length - 1];\n }\n /**\n * Returns an array of possible slider points, taking into account both\n * `marks` and `step`. The result is cached.\n */\n\n }, {\n key: \"getPoints\",\n value: function getPoints() {\n var _this$props3 = this.props,\n marks = _this$props3.marks,\n step = _this$props3.step,\n min = _this$props3.min,\n max = _this$props3.max;\n var cache = this.internalPointsCache;\n\n if (!cache || cache.marks !== marks || cache.step !== step) {\n var pointsObject = _objectSpread({}, marks);\n\n if (step !== null) {\n for (var point = min; point <= max; point += step) {\n pointsObject[point] = point;\n }\n }\n\n var points = Object.keys(pointsObject).map(parseFloat);\n points.sort(function (a, b) {\n return a - b;\n });\n this.internalPointsCache = {\n marks: marks,\n step: step,\n points: points\n };\n }\n\n return this.internalPointsCache.points;\n }\n }, {\n key: \"moveTo\",\n value: function moveTo(value, isFromKeyboardEvent) {\n var _this3 = this;\n\n var state = this.state,\n props = this.props;\n\n var nextBounds = _toConsumableArray(state.bounds);\n\n var handle = state.handle === null ? state.recent : state.handle;\n nextBounds[handle] = value;\n var nextHandle = handle;\n\n if (props.pushable !== false) {\n this.pushSurroundingHandles(nextBounds, nextHandle);\n } else if (props.allowCross) {\n nextBounds.sort(function (a, b) {\n return a - b;\n });\n nextHandle = nextBounds.indexOf(value);\n }\n\n this.onChange({\n recent: nextHandle,\n handle: nextHandle,\n bounds: nextBounds\n });\n\n if (isFromKeyboardEvent) {\n // known problem: because setState is async,\n // so trigger focus will invoke handler's onEnd and another handler's onStart too early,\n // cause onBeforeChange and onAfterChange receive wrong value.\n // here use setState callback to hack,but not elegant\n this.props.onAfterChange(nextBounds);\n this.setState({}, function () {\n _this3.handlesRefs[nextHandle].focus();\n });\n this.onEnd();\n }\n }\n }, {\n key: \"pushSurroundingHandles\",\n value: function pushSurroundingHandles(bounds, handle) {\n var value = bounds[handle];\n var pushable = this.props.pushable;\n var threshold = Number(pushable);\n var direction = 0;\n\n if (bounds[handle + 1] - value < threshold) {\n direction = +1; // push to right\n }\n\n if (value - bounds[handle - 1] < threshold) {\n direction = -1; // push to left\n }\n\n if (direction === 0) {\n return;\n }\n\n var nextHandle = handle + direction;\n var diffToNext = direction * (bounds[nextHandle] - value);\n\n if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) {\n // revert to original value if pushing is impossible\n // eslint-disable-next-line no-param-reassign\n bounds[handle] = bounds[nextHandle] - direction * threshold;\n }\n }\n }, {\n key: \"pushHandle\",\n value: function pushHandle(bounds, handle, direction, amount) {\n var originalValue = bounds[handle];\n var currentValue = bounds[handle];\n\n while (direction * (currentValue - originalValue) < amount) {\n if (!this.pushHandleOnePoint(bounds, handle, direction)) {\n // can't push handle enough to create the needed `amount` gap, so we\n // revert its position to the original value\n // eslint-disable-next-line no-param-reassign\n bounds[handle] = originalValue;\n return false;\n }\n\n currentValue = bounds[handle];\n } // the handle was pushed enough to create the needed `amount` gap\n\n\n return true;\n }\n }, {\n key: \"pushHandleOnePoint\",\n value: function pushHandleOnePoint(bounds, handle, direction) {\n var points = this.getPoints();\n var pointIndex = points.indexOf(bounds[handle]);\n var nextPointIndex = pointIndex + direction;\n\n if (nextPointIndex >= points.length || nextPointIndex < 0) {\n // reached the minimum or maximum available point, can't push anymore\n return false;\n }\n\n var nextHandle = handle + direction;\n var nextValue = points[nextPointIndex];\n var pushable = this.props.pushable;\n var threshold = Number(pushable);\n var diffToNext = direction * (bounds[nextHandle] - nextValue);\n\n if (!this.pushHandle(bounds, nextHandle, direction, threshold - diffToNext)) {\n // couldn't push next handle, so we won't push this one either\n return false;\n } // push the handle\n // eslint-disable-next-line no-param-reassign\n\n\n bounds[handle] = nextValue;\n return true;\n }\n }, {\n key: \"trimAlignValue\",\n value: function trimAlignValue(value) {\n var _this$state2 = this.state,\n handle = _this$state2.handle,\n bounds = _this$state2.bounds;\n return _trimAlignValue({\n value: value,\n handle: handle,\n bounds: bounds,\n props: this.props\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var _this$state3 = this.state,\n handle = _this$state3.handle,\n bounds = _this$state3.bounds;\n var _this$props4 = this.props,\n prefixCls = _this$props4.prefixCls,\n vertical = _this$props4.vertical,\n included = _this$props4.included,\n disabled = _this$props4.disabled,\n min = _this$props4.min,\n max = _this$props4.max,\n reverse = _this$props4.reverse,\n handleGenerator = _this$props4.handle,\n trackStyle = _this$props4.trackStyle,\n handleStyle = _this$props4.handleStyle,\n tabIndex = _this$props4.tabIndex,\n ariaLabelGroupForHandles = _this$props4.ariaLabelGroupForHandles,\n ariaLabelledByGroupForHandles = _this$props4.ariaLabelledByGroupForHandles,\n ariaValueTextFormatterGroupForHandles = _this$props4.ariaValueTextFormatterGroupForHandles;\n var offsets = bounds.map(function (v) {\n return _this4.calcOffset(v);\n });\n var handleClassName = \"\".concat(prefixCls, \"-handle\");\n var handles = bounds.map(function (v, i) {\n var _classNames;\n\n var mergedTabIndex = tabIndex[i] || 0;\n\n if (disabled || tabIndex[i] === null) {\n mergedTabIndex = null;\n }\n\n var dragging = handle === i;\n return handleGenerator({\n className: classNames((_classNames = {}, _defineProperty(_classNames, handleClassName, true), _defineProperty(_classNames, \"\".concat(handleClassName, \"-\").concat(i + 1), true), _defineProperty(_classNames, \"\".concat(handleClassName, \"-dragging\"), dragging), _classNames)),\n prefixCls: prefixCls,\n vertical: vertical,\n dragging: dragging,\n offset: offsets[i],\n value: v,\n index: i,\n tabIndex: mergedTabIndex,\n min: min,\n max: max,\n reverse: reverse,\n disabled: disabled,\n style: handleStyle[i],\n ref: function ref(h) {\n return _this4.saveHandle(i, h);\n },\n ariaLabel: ariaLabelGroupForHandles[i],\n ariaLabelledBy: ariaLabelledByGroupForHandles[i],\n ariaValueTextFormatter: ariaValueTextFormatterGroupForHandles[i]\n });\n });\n var tracks = bounds.slice(0, -1).map(function (_, index) {\n var _classNames2;\n\n var i = index + 1;\n var trackClassName = classNames((_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-track\"), true), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-track-\").concat(i), true), _classNames2));\n return React.createElement(Track, {\n className: trackClassName,\n vertical: vertical,\n reverse: reverse,\n included: included,\n offset: offsets[i - 1],\n length: offsets[i] - offsets[i - 1],\n style: trackStyle[index],\n key: i\n });\n });\n return {\n tracks: tracks,\n handles: handles\n };\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props, state) {\n if (!('value' in props || 'min' in props || 'max' in props)) {\n return null;\n }\n\n var value = props.value || state.bounds;\n var nextBounds = value.map(function (v, i) {\n return _trimAlignValue({\n value: v,\n handle: i,\n bounds: state.bounds,\n props: props\n });\n });\n\n if (state.bounds.length === nextBounds.length) {\n if (nextBounds.every(function (v, i) {\n return v === state.bounds[i];\n })) {\n return null;\n }\n } else {\n nextBounds = value.map(function (v, i) {\n return _trimAlignValue({\n value: v,\n handle: i,\n props: props\n });\n });\n }\n\n return _objectSpread(_objectSpread({}, state), {}, {\n bounds: nextBounds\n });\n }\n }]);\n\n return Range;\n}(React.Component);\n/* eslint-enable */\n\n\nRange.displayName = 'Range';\nRange.defaultProps = {\n count: 1,\n allowCross: true,\n pushable: false,\n tabIndex: [],\n ariaLabelGroupForHandles: [],\n ariaLabelledByGroupForHandles: [],\n ariaValueTextFormatterGroupForHandles: []\n};\nexport default createSlider(Range);"]},"metadata":{},"sourceType":"module"}