f5f22e3b2ca5ea86550d0c03f14ae524.json
16.2 KB
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\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 addEventListener from \"rc-util/es/Dom/addEventListener\";\n\nvar Handle = /*#__PURE__*/function (_React$Component) {\n _inherits(Handle, _React$Component);\n\n var _super = _createSuper(Handle);\n\n function Handle() {\n var _this;\n\n _classCallCheck(this, Handle);\n\n _this = _super.apply(this, arguments);\n _this.state = {\n clickFocused: false\n };\n\n _this.setHandleRef = function (node) {\n _this.handle = node;\n };\n\n _this.handleMouseUp = function () {\n if (document.activeElement === _this.handle) {\n _this.setClickFocus(true);\n }\n };\n\n _this.handleMouseDown = function (e) {\n // avoid selecting text during drag\n // https://github.com/ant-design/ant-design/issues/25010\n e.preventDefault(); // fix https://github.com/ant-design/ant-design/issues/15324\n\n _this.focus();\n };\n\n _this.handleBlur = function () {\n _this.setClickFocus(false);\n };\n\n _this.handleKeyDown = function () {\n _this.setClickFocus(false);\n };\n\n return _this;\n }\n\n _createClass(Handle, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n // mouseup won't trigger if mouse moved out of handle,\n // so we listen on document here.\n this.onMouseUpListener = addEventListener(document, 'mouseup', this.handleMouseUp);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.onMouseUpListener) {\n this.onMouseUpListener.remove();\n }\n }\n }, {\n key: \"setClickFocus\",\n value: function setClickFocus(focused) {\n this.setState({\n clickFocused: focused\n });\n }\n }, {\n key: \"clickFocus\",\n value: function clickFocus() {\n this.setClickFocus(true);\n this.focus();\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.handle.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.handle.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _ref, _ref2;\n\n var _this$props = this.props,\n prefixCls = _this$props.prefixCls,\n vertical = _this$props.vertical,\n reverse = _this$props.reverse,\n offset = _this$props.offset,\n style = _this$props.style,\n disabled = _this$props.disabled,\n min = _this$props.min,\n max = _this$props.max,\n value = _this$props.value,\n tabIndex = _this$props.tabIndex,\n ariaLabel = _this$props.ariaLabel,\n ariaLabelledBy = _this$props.ariaLabelledBy,\n ariaValueTextFormatter = _this$props.ariaValueTextFormatter,\n restProps = _objectWithoutProperties(_this$props, [\"prefixCls\", \"vertical\", \"reverse\", \"offset\", \"style\", \"disabled\", \"min\", \"max\", \"value\", \"tabIndex\", \"ariaLabel\", \"ariaLabelledBy\", \"ariaValueTextFormatter\"]);\n\n var className = classNames(this.props.className, _defineProperty({}, \"\".concat(prefixCls, \"-handle-click-focused\"), this.state.clickFocused));\n var positionStyle = vertical ? (_ref = {}, _defineProperty(_ref, reverse ? 'top' : 'bottom', \"\".concat(offset, \"%\")), _defineProperty(_ref, reverse ? 'bottom' : 'top', 'auto'), _defineProperty(_ref, \"transform\", reverse ? null : \"translateY(+50%)\"), _ref) : (_ref2 = {}, _defineProperty(_ref2, reverse ? 'right' : 'left', \"\".concat(offset, \"%\")), _defineProperty(_ref2, reverse ? 'left' : 'right', 'auto'), _defineProperty(_ref2, \"transform\", \"translateX(\".concat(reverse ? '+' : '-', \"50%)\")), _ref2);\n\n var elStyle = _objectSpread(_objectSpread({}, style), positionStyle);\n\n var mergedTabIndex = tabIndex || 0;\n\n if (disabled || tabIndex === null) {\n mergedTabIndex = null;\n }\n\n var ariaValueText;\n\n if (ariaValueTextFormatter) {\n ariaValueText = ariaValueTextFormatter(value);\n }\n\n return React.createElement(\"div\", Object.assign({\n ref: this.setHandleRef,\n tabIndex: mergedTabIndex\n }, restProps, {\n className: className,\n style: elStyle,\n onBlur: this.handleBlur,\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleMouseDown,\n // aria attribute\n role: \"slider\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": value,\n \"aria-disabled\": !!disabled,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText\n }));\n }\n }]);\n\n return Handle;\n}(React.Component);\n\nexport { Handle as default };","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/Handle.js"],"names":["_objectSpread","_defineProperty","_objectWithoutProperties","_classCallCheck","_createClass","_inherits","_createSuper","React","classNames","addEventListener","Handle","_React$Component","_super","_this","apply","arguments","state","clickFocused","setHandleRef","node","handle","handleMouseUp","document","activeElement","setClickFocus","handleMouseDown","e","preventDefault","focus","handleBlur","handleKeyDown","key","value","componentDidMount","onMouseUpListener","componentWillUnmount","remove","focused","setState","clickFocus","blur","render","_ref","_ref2","_this$props","props","prefixCls","vertical","reverse","offset","style","disabled","min","max","tabIndex","ariaLabel","ariaLabelledBy","ariaValueTextFormatter","restProps","className","concat","positionStyle","elStyle","mergedTabIndex","ariaValueText","createElement","Object","assign","ref","onBlur","onKeyDown","onMouseDown","role","Component","default"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,0CAA1B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,wBAAP,MAAqC,oDAArC;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,gBAAP,MAA6B,iCAA7B;;AAEA,IAAIC,MAAM,GAAG,aAAa,UAAUC,g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UZ,yBAAiBrB,KAVL;AAWZ,yBAAiB,CAAC,CAACmB,QAXP;AAYZ,sBAAcI,SAZF;AAaZ,2BAAmBC,cAbP;AAcZ,0BAAkBQ;AAdN,OAHoB,CAA3B,CAAP;AAmBD;AAzDA,GArCkB,CAAT,CAAZ;;AAiGA,SAAOtD,MAAP;AACD,CA9IyB,CA8IxBH,KAAK,CAACkE,SA9IkB,CAA1B;;AAgJA,SAAS/D,MAAM,IAAIgE,OAAnB","sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\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 addEventListener from \"rc-util/es/Dom/addEventListener\";\n\nvar Handle = /*#__PURE__*/function (_React$Component) {\n _inherits(Handle, _React$Component);\n\n var _super = _createSuper(Handle);\n\n function Handle() {\n var _this;\n\n _classCallCheck(this, Handle);\n\n _this = _super.apply(this, arguments);\n _this.state = {\n clickFocused: false\n };\n\n _this.setHandleRef = function (node) {\n _this.handle = node;\n };\n\n _this.handleMouseUp = function () {\n if (document.activeElement === _this.handle) {\n _this.setClickFocus(true);\n }\n };\n\n _this.handleMouseDown = function (e) {\n // avoid selecting text during drag\n // https://github.com/ant-design/ant-design/issues/25010\n e.preventDefault(); // fix https://github.com/ant-design/ant-design/issues/15324\n\n _this.focus();\n };\n\n _this.handleBlur = function () {\n _this.setClickFocus(false);\n };\n\n _this.handleKeyDown = function () {\n _this.setClickFocus(false);\n };\n\n return _this;\n }\n\n _createClass(Handle, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n // mouseup won't trigger if mouse moved out of handle,\n // so we listen on document here.\n this.onMouseUpListener = addEventListener(document, 'mouseup', this.handleMouseUp);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.onMouseUpListener) {\n this.onMouseUpListener.remove();\n }\n }\n }, {\n key: \"setClickFocus\",\n value: function setClickFocus(focused) {\n this.setState({\n clickFocused: focused\n });\n }\n }, {\n key: \"clickFocus\",\n value: function clickFocus() {\n this.setClickFocus(true);\n this.focus();\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.handle.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.handle.blur();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _ref, _ref2;\n\n var _this$props = this.props,\n prefixCls = _this$props.prefixCls,\n vertical = _this$props.vertical,\n reverse = _this$props.reverse,\n offset = _this$props.offset,\n style = _this$props.style,\n disabled = _this$props.disabled,\n min = _this$props.min,\n max = _this$props.max,\n value = _this$props.value,\n tabIndex = _this$props.tabIndex,\n ariaLabel = _this$props.ariaLabel,\n ariaLabelledBy = _this$props.ariaLabelledBy,\n ariaValueTextFormatter = _this$props.ariaValueTextFormatter,\n restProps = _objectWithoutProperties(_this$props, [\"prefixCls\", \"vertical\", \"reverse\", \"offset\", \"style\", \"disabled\", \"min\", \"max\", \"value\", \"tabIndex\", \"ariaLabel\", \"ariaLabelledBy\", \"ariaValueTextFormatter\"]);\n\n var className = classNames(this.props.className, _defineProperty({}, \"\".concat(prefixCls, \"-handle-click-focused\"), this.state.clickFocused));\n var positionStyle = vertical ? (_ref = {}, _defineProperty(_ref, reverse ? 'top' : 'bottom', \"\".concat(offset, \"%\")), _defineProperty(_ref, reverse ? 'bottom' : 'top', 'auto'), _defineProperty(_ref, \"transform\", reverse ? null : \"translateY(+50%)\"), _ref) : (_ref2 = {}, _defineProperty(_ref2, reverse ? 'right' : 'left', \"\".concat(offset, \"%\")), _defineProperty(_ref2, reverse ? 'left' : 'right', 'auto'), _defineProperty(_ref2, \"transform\", \"translateX(\".concat(reverse ? '+' : '-', \"50%)\")), _ref2);\n\n var elStyle = _objectSpread(_objectSpread({}, style), positionStyle);\n\n var mergedTabIndex = tabIndex || 0;\n\n if (disabled || tabIndex === null) {\n mergedTabIndex = null;\n }\n\n var ariaValueText;\n\n if (ariaValueTextFormatter) {\n ariaValueText = ariaValueTextFormatter(value);\n }\n\n return React.createElement(\"div\", Object.assign({\n ref: this.setHandleRef,\n tabIndex: mergedTabIndex\n }, restProps, {\n className: className,\n style: elStyle,\n onBlur: this.handleBlur,\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleMouseDown,\n // aria attribute\n role: \"slider\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": value,\n \"aria-disabled\": !!disabled,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText\n }));\n }\n }]);\n\n return Handle;\n}(React.Component);\n\nexport { Handle as default };"]},"metadata":{},"sourceType":"module"}