90419e95bb90f16c3e5ea895f6867ccc.json 43.9 KB
{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _get from \"@babel/runtime/helpers/esm/get\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport classNames from 'classnames';\nimport warning from \"rc-util/es/warning\";\nimport Steps from './Steps';\nimport Marks from './Marks';\nimport Handle from '../Handle';\nimport * as utils from '../utils';\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nfunction noop() {}\n\nexport default function createSlider(Component) {\n  var _a; // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n  return _a = /*#__PURE__*/function (_Component) {\n    _inherits(ComponentEnhancer, _Component);\n\n    var _super = _createSuper(ComponentEnhancer);\n\n    function ComponentEnhancer(props) {\n      var _this;\n\n      _classCallCheck(this, ComponentEnhancer);\n\n      _this = _super.call(this, props);\n\n      _this.onMouseDown = function (e) {\n        if (e.button !== 0) {\n          return;\n        }\n\n        var isVertical = _this.props.vertical;\n        var position = utils.getMousePosition(isVertical, e);\n\n        if (!utils.isEventFromHandle(e, _this.handlesRefs)) {\n          _this.dragOffset = 0;\n        } else {\n          var handlePosition = utils.getHandleCenterPosition(isVertical, e.target);\n          _this.dragOffset = position - handlePosition;\n          position = handlePosition;\n        }\n\n        _this.removeDocumentEvents();\n\n        _this.onStart(position);\n\n        _this.addDocumentMouseEvents();\n      };\n\n      _this.onTouchStart = function (e) {\n        if (utils.isNotTouchEvent(e)) return;\n        var isVertical = _this.props.vertical;\n        var position = utils.getTouchPosition(isVertical, e);\n\n        if (!utils.isEventFromHandle(e, _this.handlesRefs)) {\n          _this.dragOffset = 0;\n        } else {\n          var handlePosition = utils.getHandleCenterPosition(isVertical, e.target);\n          _this.dragOffset = position - handlePosition;\n          position = handlePosition;\n        }\n\n        _this.onStart(position);\n\n        _this.addDocumentTouchEvents();\n\n        utils.pauseEvent(e);\n      };\n\n      _this.onFocus = function (e) {\n        var _this$props = _this.props,\n            onFocus = _this$props.onFocus,\n            vertical = _this$props.vertical;\n\n        if (utils.isEventFromHandle(e, _this.handlesRefs)) {\n          var handlePosition = utils.getHandleCenterPosition(vertical, e.target);\n          _this.dragOffset = 0;\n\n          _this.onStart(handlePosition);\n\n          utils.pauseEvent(e);\n\n          if (onFocus) {\n            onFocus(e);\n          }\n        }\n      };\n\n      _this.onBlur = function (e) {\n        var onBlur = _this.props.onBlur;\n\n        _this.onEnd();\n\n        if (onBlur) {\n          onBlur(e);\n        }\n      };\n\n      _this.onMouseUp = function () {\n        if (_this.handlesRefs[_this.prevMovedHandleIndex]) {\n          _this.handlesRefs[_this.prevMovedHandleIndex].clickFocus();\n        }\n      };\n\n      _this.onMouseMove = function (e) {\n        if (!_this.sliderRef) {\n          _this.onEnd();\n\n          return;\n        }\n\n        var position = utils.getMousePosition(_this.props.vertical, e);\n\n        _this.onMove(e, position - _this.dragOffset);\n      };\n\n      _this.onTouchMove = function (e) {\n        if (utils.isNotTouchEvent(e) || !_this.sliderRef) {\n          _this.onEnd();\n\n          return;\n        }\n\n        var position = utils.getTouchPosition(_this.props.vertical, e);\n\n        _this.onMove(e, position - _this.dragOffset);\n      };\n\n      _this.onKeyDown = function (e) {\n        if (_this.sliderRef && utils.isEventFromHandle(e, _this.handlesRefs)) {\n          _this.onKeyboard(e);\n        }\n      };\n\n      _this.onClickMarkLabel = function (e, value) {\n        e.stopPropagation();\n\n        _this.onChange({\n          value: value\n        }); // eslint-disable-next-line react/no-unused-state\n\n\n        _this.setState({\n          value: value\n        }, function () {\n          return _this.onEnd(true);\n        });\n      };\n\n      _this.saveSlider = function (slider) {\n        _this.sliderRef = slider;\n      };\n\n      var step = props.step,\n          max = props.max,\n          min = props.min;\n      var isPointDiffEven = isFinite(max - min) ? (max - min) % step === 0 : true; // eslint-disable-line\n\n      warning(step && Math.floor(step) === step ? isPointDiffEven : true, \"Slider[max] - Slider[min] (\".concat(max - min, \") should be a multiple of Slider[step] (\").concat(step, \")\"));\n      _this.handlesRefs = {};\n      return _this;\n    }\n\n    _createClass(ComponentEnhancer, [{\n      key: \"componentDidMount\",\n      value: function componentDidMount() {\n        // Snapshot testing cannot handle refs, so be sure to null-check this.\n        this.document = this.sliderRef && this.sliderRef.ownerDocument;\n        var _this$props2 = this.props,\n            autoFocus = _this$props2.autoFocus,\n            disabled = _this$props2.disabled;\n\n        if (autoFocus && !disabled) {\n          this.focus();\n        }\n      }\n    }, {\n      key: \"componentWillUnmount\",\n      value: function componentWillUnmount() {\n        if (_get(_getPrototypeOf(ComponentEnhancer.prototype), \"componentWillUnmount\", this)) _get(_getPrototypeOf(ComponentEnhancer.prototype), \"componentWillUnmount\", this).call(this);\n        this.removeDocumentEvents();\n      }\n    }, {\n      key: \"getSliderStart\",\n      value: function getSliderStart() {\n        var slider = this.sliderRef;\n        var _this$props3 = this.props,\n            vertical = _this$props3.vertical,\n            reverse = _this$props3.reverse;\n        var rect = slider.getBoundingClientRect();\n\n        if (vertical) {\n          return reverse ? rect.bottom : rect.top;\n        }\n\n        return window.pageXOffset + (reverse ? rect.right : rect.left);\n      }\n    }, {\n      key: \"getSliderLength\",\n      value: function getSliderLength() {\n        var slider = this.sliderRef;\n\n        if (!slider) {\n          return 0;\n        }\n\n        var coords = slider.getBoundingClientRect();\n        return this.props.vertical ? coords.height : coords.width;\n      }\n    }, {\n      key: \"addDocumentTouchEvents\",\n      value: function addDocumentTouchEvents() {\n        // just work for Chrome iOS Safari and Android Browser\n        this.onTouchMoveListener = addEventListener(this.document, 'touchmove', this.onTouchMove);\n        this.onTouchUpListener = addEventListener(this.document, 'touchend', this.onEnd);\n      }\n    }, {\n      key: \"addDocumentMouseEvents\",\n      value: function addDocumentMouseEvents() {\n        this.onMouseMoveListener = addEventListener(this.document, 'mousemove', this.onMouseMove);\n        this.onMouseUpListener = addEventListener(this.document, 'mouseup', this.onEnd);\n      }\n    }, {\n      key: \"removeDocumentEvents\",\n      value: function removeDocumentEvents() {\n        /* eslint-disable @typescript-eslint/no-unused-expressions */\n        this.onTouchMoveListener && this.onTouchMoveListener.remove();\n        this.onTouchUpListener && this.onTouchUpListener.remove();\n        this.onMouseMoveListener && this.onMouseMoveListener.remove();\n        this.onMouseUpListener && this.onMouseUpListener.remove();\n        /* eslint-enable no-unused-expressions */\n      }\n    }, {\n      key: \"focus\",\n      value: function focus() {\n        var _this$handlesRefs$;\n\n        if (this.props.disabled) {\n          return;\n        }\n\n        (_this$handlesRefs$ = this.handlesRefs[0]) === null || _this$handlesRefs$ === void 0 ? void 0 : _this$handlesRefs$.focus();\n      }\n    }, {\n      key: \"blur\",\n      value: function blur() {\n        var _this2 = this;\n\n        if (this.props.disabled) {\n          return;\n        }\n\n        Object.keys(this.handlesRefs).forEach(function (key) {\n          var _this2$handlesRefs$ke, _this2$handlesRefs$ke2;\n\n          (_this2$handlesRefs$ke = _this2.handlesRefs[key]) === null || _this2$handlesRefs$ke === void 0 ? void 0 : (_this2$handlesRefs$ke2 = _this2$handlesRefs$ke.blur) === null || _this2$handlesRefs$ke2 === void 0 ? void 0 : _this2$handlesRefs$ke2.call(_this2$handlesRefs$ke);\n        });\n      }\n    }, {\n      key: \"calcValue\",\n      value: function calcValue(offset) {\n        var _this$props4 = this.props,\n            vertical = _this$props4.vertical,\n            min = _this$props4.min,\n            max = _this$props4.max;\n        var ratio = Math.abs(Math.max(offset, 0) / this.getSliderLength());\n        var value = vertical ? (1 - ratio) * (max - min) + min : ratio * (max - min) + min;\n        return value;\n      }\n    }, {\n      key: \"calcValueByPos\",\n      value: function calcValueByPos(position) {\n        var sign = this.props.reverse ? -1 : +1;\n        var pixelOffset = sign * (position - this.getSliderStart());\n        var nextValue = this.trimAlignValue(this.calcValue(pixelOffset));\n        return nextValue;\n      }\n    }, {\n      key: \"calcOffset\",\n      value: function calcOffset(value) {\n        var _this$props5 = this.props,\n            min = _this$props5.min,\n            max = _this$props5.max;\n        var ratio = (value - min) / (max - min);\n        return Math.max(0, ratio * 100);\n      }\n    }, {\n      key: \"saveHandle\",\n      value: function saveHandle(index, handle) {\n        this.handlesRefs[index] = handle;\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _classNames;\n\n        var _this$props6 = this.props,\n            prefixCls = _this$props6.prefixCls,\n            className = _this$props6.className,\n            marks = _this$props6.marks,\n            dots = _this$props6.dots,\n            step = _this$props6.step,\n            included = _this$props6.included,\n            disabled = _this$props6.disabled,\n            vertical = _this$props6.vertical,\n            reverse = _this$props6.reverse,\n            min = _this$props6.min,\n            max = _this$props6.max,\n            children = _this$props6.children,\n            maximumTrackStyle = _this$props6.maximumTrackStyle,\n            style = _this$props6.style,\n            railStyle = _this$props6.railStyle,\n            dotStyle = _this$props6.dotStyle,\n            activeDotStyle = _this$props6.activeDotStyle;\n\n        var _get$call = _get(_getPrototypeOf(ComponentEnhancer.prototype), \"render\", this).call(this),\n            tracks = _get$call.tracks,\n            handles = _get$call.handles;\n\n        var sliderClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-with-marks\"), Object.keys(marks).length), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-vertical\"), vertical), _defineProperty(_classNames, className, className), _classNames));\n        return React.createElement(\"div\", {\n          ref: this.saveSlider,\n          className: sliderClassName,\n          onTouchStart: disabled ? noop : this.onTouchStart,\n          onMouseDown: disabled ? noop : this.onMouseDown,\n          onMouseUp: disabled ? noop : this.onMouseUp,\n          onKeyDown: disabled ? noop : this.onKeyDown,\n          onFocus: disabled ? noop : this.onFocus,\n          onBlur: disabled ? noop : this.onBlur,\n          style: style\n        }, React.createElement(\"div\", {\n          className: \"\".concat(prefixCls, \"-rail\"),\n          style: _objectSpread(_objectSpread({}, maximumTrackStyle), railStyle)\n        }), tracks, React.createElement(Steps, {\n          prefixCls: prefixCls,\n          vertical: vertical,\n          reverse: reverse,\n          marks: marks,\n          dots: dots,\n          step: step,\n          included: included,\n          lowerBound: this.getLowerBound(),\n          upperBound: this.getUpperBound(),\n          max: max,\n          min: min,\n          dotStyle: dotStyle,\n          activeDotStyle: activeDotStyle\n        }), handles, React.createElement(Marks, {\n          className: \"\".concat(prefixCls, \"-mark\"),\n          onClickLabel: disabled ? noop : this.onClickMarkLabel,\n          vertical: vertical,\n          marks: marks,\n          included: included,\n          lowerBound: this.getLowerBound(),\n          upperBound: this.getUpperBound(),\n          max: max,\n          min: min,\n          reverse: reverse\n        }), children);\n      }\n    }]);\n\n    return ComponentEnhancer;\n  }(Component), _a.displayName = \"ComponentEnhancer(\".concat(Component.displayName, \")\"), _a.defaultProps = _objectSpread(_objectSpread({}, Component.defaultProps), {}, {\n    prefixCls: 'rc-slider',\n    className: '',\n    min: 0,\n    max: 100,\n    step: 1,\n    marks: {},\n    handle: function handle(props) {\n      var index = props.index,\n          restProps = _objectWithoutProperties(props, [\"index\"]);\n\n      delete restProps.dragging;\n\n      if (restProps.value === null) {\n        return null;\n      }\n\n      return React.createElement(Handle, Object.assign({}, restProps, {\n        key: index\n      }));\n    },\n    onBeforeChange: noop,\n    onChange: noop,\n    onAfterChange: noop,\n    included: true,\n    disabled: false,\n    dots: false,\n    vertical: false,\n    reverse: false,\n    trackStyle: [{}],\n    handleStyle: [{}],\n    railStyle: {},\n    dotStyle: {},\n    activeDotStyle: {}\n  }), _a;\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/common/createSlider.js"],"names":["_objectWithoutProperties","_objectSpread","_defineProperty","_classCallCheck","_createClass","_get","_getPrototypeOf","_inherits","_createSuper","React","addEventListener","classNames","warning","Steps","Marks","Handle","utils","noop","createSlider","Component","_a","_Component","ComponentEnhancer","_super","props","_this","call","onMouseDown","e","button","isVertical","vertical","position","getMousePosition","isEventFromHandle","handlesRefs","dragOffset","handlePosition","getHandleCenterPosition","target","removeDocumentEvents","onStart","addDocumentMouseEvents","onTouchStart","isNotTouchEvent","getTouchPosition","addDocumentTouchEvents","pauseEvent","onFocus","_this$props","onBlur","onEnd","onMouseUp","prevMovedHandleIndex","clickFocus","onMouseMove","sliderRef","onMove","onTouchMove","onKeyDown","onKeyboard","onClickMarkLabel","value","stopPropagation","onChange","setState","saveSlider","slider","step","max","min","isPointDiffEven","isFinite","Math","floor","concat","key","componentDidMount","document","ownerDocument","_this$props2","autoFocus","disabled","focus","componentWillUnmount","prototype","getSliderStart","_this$props3","reverse","rect","getBoundingClientRect","bottom","top","window","pageXOffset","right","left","getSliderLength","coords","height","width","onTouchMoveListener","onTouchUpListener","onMouseMoveListener","onMouseUpListener","remove","_this$handlesRefs$","blur","_this2","Object","keys","forEach","_this2$handlesRefs$ke","_this2$handlesRefs$ke2","calcValue","offset","_this$props4","ratio","abs","calcValueByPos","sign","pixelOffset","nextValue","trimAlignValue","calcOffset","_this$props5","saveHandle","index","handle","render","_classNames","_this$props6","prefixCls","className","marks","dots","included","children","maximumTrackStyle","style","railStyle","dotStyle","activeDotStyle","_get$call","tracks","handles","sliderClassName","length","createElement","ref","lowerBound","getLowerBound","upperBound","getUpperBound","onClickLabel","displayName","defaultProps","restProps","dragging","assign","onBeforeChange","onAfterChange","trackStyle","handleStyle"],"mappings":"AAAA,OAAOA,wBAAP,MAAqC,oDAArC;AACA,OAAOC,aAAP,MAA0B,0CAA1B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,IAAP,MAAiB,gC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uH,IAAAA,QAAQ,EAAE,IAxB2J;AAyBrKtD,IAAAA,QAAQ,EAAE,KAzB2J;AA0BrKqD,IAAAA,IAAI,EAAE,KA1B+J;AA2BrKxG,IAAAA,QAAQ,EAAE,KA3B2J;AA4BrKyD,IAAAA,OAAO,EAAE,KA5B4J;AA6BrK0E,IAAAA,UAAU,EAAE,CAAC,EAAD,CA7ByJ;AA8BrKC,IAAAA,WAAW,EAAE,CAAC,EAAD,CA9BwJ;AA+BrKvB,IAAAA,SAAS,EAAE,EA/B0J;AAgCrKC,IAAAA,QAAQ,EAAE,EAhC2J;AAiCrKC,IAAAA,cAAc,EAAE;AAjCqJ,GAAhD,CA7VhH,EA+XH1H,EA/XJ;AAgYD","sourcesContent":["import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _get from \"@babel/runtime/helpers/esm/get\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport React from 'react';\nimport addEventListener from \"rc-util/es/Dom/addEventListener\";\nimport classNames from 'classnames';\nimport warning from \"rc-util/es/warning\";\nimport Steps from './Steps';\nimport Marks from './Marks';\nimport Handle from '../Handle';\nimport * as utils from '../utils';\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nfunction noop() {}\n\nexport default function createSlider(Component) {\n  var _a; // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n  return _a = /*#__PURE__*/function (_Component) {\n    _inherits(ComponentEnhancer, _Component);\n\n    var _super = _createSuper(ComponentEnhancer);\n\n    function ComponentEnhancer(props) {\n      var _this;\n\n      _classCallCheck(this, ComponentEnhancer);\n\n      _this = _super.call(this, props);\n\n      _this.onMouseDown = function (e) {\n        if (e.button !== 0) {\n          return;\n        }\n\n        var isVertical = _this.props.vertical;\n        var position = utils.getMousePosition(isVertical, e);\n\n        if (!utils.isEventFromHandle(e, _this.handlesRefs)) {\n          _this.dragOffset = 0;\n        } else {\n          var handlePosition = utils.getHandleCenterPosition(isVertical, e.target);\n          _this.dragOffset = position - handlePosition;\n          position = handlePosition;\n        }\n\n        _this.removeDocumentEvents();\n\n        _this.onStart(position);\n\n        _this.addDocumentMouseEvents();\n      };\n\n      _this.onTouchStart = function (e) {\n        if (utils.isNotTouchEvent(e)) return;\n        var isVertical = _this.props.vertical;\n        var position = utils.getTouchPosition(isVertical, e);\n\n        if (!utils.isEventFromHandle(e, _this.handlesRefs)) {\n          _this.dragOffset = 0;\n        } else {\n          var handlePosition = utils.getHandleCenterPosition(isVertical, e.target);\n          _this.dragOffset = position - handlePosition;\n          position = handlePosition;\n        }\n\n        _this.onStart(position);\n\n        _this.addDocumentTouchEvents();\n\n        utils.pauseEvent(e);\n      };\n\n      _this.onFocus = function (e) {\n        var _this$props = _this.props,\n            onFocus = _this$props.onFocus,\n            vertical = _this$props.vertical;\n\n        if (utils.isEventFromHandle(e, _this.handlesRefs)) {\n          var handlePosition = utils.getHandleCenterPosition(vertical, e.target);\n          _this.dragOffset = 0;\n\n          _this.onStart(handlePosition);\n\n          utils.pauseEvent(e);\n\n          if (onFocus) {\n            onFocus(e);\n          }\n        }\n      };\n\n      _this.onBlur = function (e) {\n        var onBlur = _this.props.onBlur;\n\n        _this.onEnd();\n\n        if (onBlur) {\n          onBlur(e);\n        }\n      };\n\n      _this.onMouseUp = function () {\n        if (_this.handlesRefs[_this.prevMovedHandleIndex]) {\n          _this.handlesRefs[_this.prevMovedHandleIndex].clickFocus();\n        }\n      };\n\n      _this.onMouseMove = function (e) {\n        if (!_this.sliderRef) {\n          _this.onEnd();\n\n          return;\n        }\n\n        var position = utils.getMousePosition(_this.props.vertical, e);\n\n        _this.onMove(e, position - _this.dragOffset);\n      };\n\n      _this.onTouchMove = function (e) {\n        if (utils.isNotTouchEvent(e) || !_this.sliderRef) {\n          _this.onEnd();\n\n          return;\n        }\n\n        var position = utils.getTouchPosition(_this.props.vertical, e);\n\n        _this.onMove(e, position - _this.dragOffset);\n      };\n\n      _this.onKeyDown = function (e) {\n        if (_this.sliderRef && utils.isEventFromHandle(e, _this.handlesRefs)) {\n          _this.onKeyboard(e);\n        }\n      };\n\n      _this.onClickMarkLabel = function (e, value) {\n        e.stopPropagation();\n\n        _this.onChange({\n          value: value\n        }); // eslint-disable-next-line react/no-unused-state\n\n\n        _this.setState({\n          value: value\n        }, function () {\n          return _this.onEnd(true);\n        });\n      };\n\n      _this.saveSlider = function (slider) {\n        _this.sliderRef = slider;\n      };\n\n      var step = props.step,\n          max = props.max,\n          min = props.min;\n      var isPointDiffEven = isFinite(max - min) ? (max - min) % step === 0 : true; // eslint-disable-line\n\n      warning(step && Math.floor(step) === step ? isPointDiffEven : true, \"Slider[max] - Slider[min] (\".concat(max - min, \") should be a multiple of Slider[step] (\").concat(step, \")\"));\n      _this.handlesRefs = {};\n      return _this;\n    }\n\n    _createClass(ComponentEnhancer, [{\n      key: \"componentDidMount\",\n      value: function componentDidMount() {\n        // Snapshot testing cannot handle refs, so be sure to null-check this.\n        this.document = this.sliderRef && this.sliderRef.ownerDocument;\n        var _this$props2 = this.props,\n            autoFocus = _this$props2.autoFocus,\n            disabled = _this$props2.disabled;\n\n        if (autoFocus && !disabled) {\n          this.focus();\n        }\n      }\n    }, {\n      key: \"componentWillUnmount\",\n      value: function componentWillUnmount() {\n        if (_get(_getPrototypeOf(ComponentEnhancer.prototype), \"componentWillUnmount\", this)) _get(_getPrototypeOf(ComponentEnhancer.prototype), \"componentWillUnmount\", this).call(this);\n        this.removeDocumentEvents();\n      }\n    }, {\n      key: \"getSliderStart\",\n      value: function getSliderStart() {\n        var slider = this.sliderRef;\n        var _this$props3 = this.props,\n            vertical = _this$props3.vertical,\n            reverse = _this$props3.reverse;\n        var rect = slider.getBoundingClientRect();\n\n        if (vertical) {\n          return reverse ? rect.bottom : rect.top;\n        }\n\n        return window.pageXOffset + (reverse ? rect.right : rect.left);\n      }\n    }, {\n      key: \"getSliderLength\",\n      value: function getSliderLength() {\n        var slider = this.sliderRef;\n\n        if (!slider) {\n          return 0;\n        }\n\n        var coords = slider.getBoundingClientRect();\n        return this.props.vertical ? coords.height : coords.width;\n      }\n    }, {\n      key: \"addDocumentTouchEvents\",\n      value: function addDocumentTouchEvents() {\n        // just work for Chrome iOS Safari and Android Browser\n        this.onTouchMoveListener = addEventListener(this.document, 'touchmove', this.onTouchMove);\n        this.onTouchUpListener = addEventListener(this.document, 'touchend', this.onEnd);\n      }\n    }, {\n      key: \"addDocumentMouseEvents\",\n      value: function addDocumentMouseEvents() {\n        this.onMouseMoveListener = addEventListener(this.document, 'mousemove', this.onMouseMove);\n        this.onMouseUpListener = addEventListener(this.document, 'mouseup', this.onEnd);\n      }\n    }, {\n      key: \"removeDocumentEvents\",\n      value: function removeDocumentEvents() {\n        /* eslint-disable @typescript-eslint/no-unused-expressions */\n        this.onTouchMoveListener && this.onTouchMoveListener.remove();\n        this.onTouchUpListener && this.onTouchUpListener.remove();\n        this.onMouseMoveListener && this.onMouseMoveListener.remove();\n        this.onMouseUpListener && this.onMouseUpListener.remove();\n        /* eslint-enable no-unused-expressions */\n      }\n    }, {\n      key: \"focus\",\n      value: function focus() {\n        var _this$handlesRefs$;\n\n        if (this.props.disabled) {\n          return;\n        }\n\n        (_this$handlesRefs$ = this.handlesRefs[0]) === null || _this$handlesRefs$ === void 0 ? void 0 : _this$handlesRefs$.focus();\n      }\n    }, {\n      key: \"blur\",\n      value: function blur() {\n        var _this2 = this;\n\n        if (this.props.disabled) {\n          return;\n        }\n\n        Object.keys(this.handlesRefs).forEach(function (key) {\n          var _this2$handlesRefs$ke, _this2$handlesRefs$ke2;\n\n          (_this2$handlesRefs$ke = _this2.handlesRefs[key]) === null || _this2$handlesRefs$ke === void 0 ? void 0 : (_this2$handlesRefs$ke2 = _this2$handlesRefs$ke.blur) === null || _this2$handlesRefs$ke2 === void 0 ? void 0 : _this2$handlesRefs$ke2.call(_this2$handlesRefs$ke);\n        });\n      }\n    }, {\n      key: \"calcValue\",\n      value: function calcValue(offset) {\n        var _this$props4 = this.props,\n            vertical = _this$props4.vertical,\n            min = _this$props4.min,\n            max = _this$props4.max;\n        var ratio = Math.abs(Math.max(offset, 0) / this.getSliderLength());\n        var value = vertical ? (1 - ratio) * (max - min) + min : ratio * (max - min) + min;\n        return value;\n      }\n    }, {\n      key: \"calcValueByPos\",\n      value: function calcValueByPos(position) {\n        var sign = this.props.reverse ? -1 : +1;\n        var pixelOffset = sign * (position - this.getSliderStart());\n        var nextValue = this.trimAlignValue(this.calcValue(pixelOffset));\n        return nextValue;\n      }\n    }, {\n      key: \"calcOffset\",\n      value: function calcOffset(value) {\n        var _this$props5 = this.props,\n            min = _this$props5.min,\n            max = _this$props5.max;\n        var ratio = (value - min) / (max - min);\n        return Math.max(0, ratio * 100);\n      }\n    }, {\n      key: \"saveHandle\",\n      value: function saveHandle(index, handle) {\n        this.handlesRefs[index] = handle;\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _classNames;\n\n        var _this$props6 = this.props,\n            prefixCls = _this$props6.prefixCls,\n            className = _this$props6.className,\n            marks = _this$props6.marks,\n            dots = _this$props6.dots,\n            step = _this$props6.step,\n            included = _this$props6.included,\n            disabled = _this$props6.disabled,\n            vertical = _this$props6.vertical,\n            reverse = _this$props6.reverse,\n            min = _this$props6.min,\n            max = _this$props6.max,\n            children = _this$props6.children,\n            maximumTrackStyle = _this$props6.maximumTrackStyle,\n            style = _this$props6.style,\n            railStyle = _this$props6.railStyle,\n            dotStyle = _this$props6.dotStyle,\n            activeDotStyle = _this$props6.activeDotStyle;\n\n        var _get$call = _get(_getPrototypeOf(ComponentEnhancer.prototype), \"render\", this).call(this),\n            tracks = _get$call.tracks,\n            handles = _get$call.handles;\n\n        var sliderClassName = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-with-marks\"), Object.keys(marks).length), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-vertical\"), vertical), _defineProperty(_classNames, className, className), _classNames));\n        return React.createElement(\"div\", {\n          ref: this.saveSlider,\n          className: sliderClassName,\n          onTouchStart: disabled ? noop : this.onTouchStart,\n          onMouseDown: disabled ? noop : this.onMouseDown,\n          onMouseUp: disabled ? noop : this.onMouseUp,\n          onKeyDown: disabled ? noop : this.onKeyDown,\n          onFocus: disabled ? noop : this.onFocus,\n          onBlur: disabled ? noop : this.onBlur,\n          style: style\n        }, React.createElement(\"div\", {\n          className: \"\".concat(prefixCls, \"-rail\"),\n          style: _objectSpread(_objectSpread({}, maximumTrackStyle), railStyle)\n        }), tracks, React.createElement(Steps, {\n          prefixCls: prefixCls,\n          vertical: vertical,\n          reverse: reverse,\n          marks: marks,\n          dots: dots,\n          step: step,\n          included: included,\n          lowerBound: this.getLowerBound(),\n          upperBound: this.getUpperBound(),\n          max: max,\n          min: min,\n          dotStyle: dotStyle,\n          activeDotStyle: activeDotStyle\n        }), handles, React.createElement(Marks, {\n          className: \"\".concat(prefixCls, \"-mark\"),\n          onClickLabel: disabled ? noop : this.onClickMarkLabel,\n          vertical: vertical,\n          marks: marks,\n          included: included,\n          lowerBound: this.getLowerBound(),\n          upperBound: this.getUpperBound(),\n          max: max,\n          min: min,\n          reverse: reverse\n        }), children);\n      }\n    }]);\n\n    return ComponentEnhancer;\n  }(Component), _a.displayName = \"ComponentEnhancer(\".concat(Component.displayName, \")\"), _a.defaultProps = _objectSpread(_objectSpread({}, Component.defaultProps), {}, {\n    prefixCls: 'rc-slider',\n    className: '',\n    min: 0,\n    max: 100,\n    step: 1,\n    marks: {},\n    handle: function handle(props) {\n      var index = props.index,\n          restProps = _objectWithoutProperties(props, [\"index\"]);\n\n      delete restProps.dragging;\n\n      if (restProps.value === null) {\n        return null;\n      }\n\n      return React.createElement(Handle, Object.assign({}, restProps, {\n        key: index\n      }));\n    },\n    onBeforeChange: noop,\n    onChange: noop,\n    onAfterChange: noop,\n    included: true,\n    disabled: false,\n    dots: false,\n    vertical: false,\n    reverse: false,\n    trackStyle: [{}],\n    handleStyle: [{}],\n    railStyle: {},\n    dotStyle: {},\n    activeDotStyle: {}\n  }), _a;\n}"]},"metadata":{},"sourceType":"module"}