393712d44eacb93be451b1b3a284ef23.json
13.2 KB
{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\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 Tooltip from './common/SliderTooltip';\nimport Handle from './Handle';\nexport default function createSliderWithTooltip(Component) {\n var _a; // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n return _a = /*#__PURE__*/function (_React$Component) {\n _inherits(ComponentWrapper, _React$Component);\n\n var _super = _createSuper(ComponentWrapper);\n\n function ComponentWrapper() {\n var _this;\n\n _classCallCheck(this, ComponentWrapper);\n\n _this = _super.apply(this, arguments);\n _this.state = {\n visibles: {}\n };\n\n _this.handleTooltipVisibleChange = function (index, visible) {\n _this.setState(function (prevState) {\n return {\n visibles: _objectSpread(_objectSpread({}, prevState.visibles), {}, _defineProperty({}, index, visible))\n };\n });\n };\n\n _this.handleWithTooltip = function (_ref) {\n var value = _ref.value,\n dragging = _ref.dragging,\n index = _ref.index,\n disabled = _ref.disabled,\n restProps = _objectWithoutProperties(_ref, [\"value\", \"dragging\", \"index\", \"disabled\"]);\n\n var _this$props = _this.props,\n tipFormatter = _this$props.tipFormatter,\n tipProps = _this$props.tipProps,\n handleStyle = _this$props.handleStyle,\n getTooltipContainer = _this$props.getTooltipContainer;\n\n var _tipProps$prefixCls = tipProps.prefixCls,\n prefixCls = _tipProps$prefixCls === void 0 ? 'rc-slider-tooltip' : _tipProps$prefixCls,\n _tipProps$overlay = tipProps.overlay,\n overlay = _tipProps$overlay === void 0 ? tipFormatter(value) : _tipProps$overlay,\n _tipProps$placement = tipProps.placement,\n placement = _tipProps$placement === void 0 ? 'top' : _tipProps$placement,\n _tipProps$visible = tipProps.visible,\n visible = _tipProps$visible === void 0 ? false : _tipProps$visible,\n restTooltipProps = _objectWithoutProperties(tipProps, [\"prefixCls\", \"overlay\", \"placement\", \"visible\"]);\n\n var handleStyleWithIndex;\n\n if (Array.isArray(handleStyle)) {\n handleStyleWithIndex = handleStyle[index] || handleStyle[0];\n } else {\n handleStyleWithIndex = handleStyle;\n }\n\n return React.createElement(Tooltip, Object.assign({}, restTooltipProps, {\n getTooltipContainer: getTooltipContainer,\n prefixCls: prefixCls,\n overlay: overlay,\n placement: placement,\n visible: !disabled && (_this.state.visibles[index] || dragging) || visible,\n key: index\n }), React.createElement(Handle, Object.assign({}, restProps, {\n style: _objectSpread({}, handleStyleWithIndex),\n value: value,\n onMouseEnter: function onMouseEnter() {\n return _this.handleTooltipVisibleChange(index, true);\n },\n onMouseLeave: function onMouseLeave() {\n return _this.handleTooltipVisibleChange(index, false);\n }\n })));\n };\n\n return _this;\n }\n\n _createClass(ComponentWrapper, [{\n key: \"render\",\n value: function render() {\n return React.createElement(Component, Object.assign({}, this.props, {\n handle: this.handleWithTooltip\n }));\n }\n }]);\n\n return ComponentWrapper;\n }(React.Component), _a.defaultProps = {\n tipFormatter: function tipFormatter(value) {\n return value;\n },\n handleStyle: [{}],\n tipProps: {},\n getTooltipContainer: function getTooltipContainer(node) {\n return node.parentNode;\n }\n }, _a;\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/createSliderWithTooltip.js"],"names":["_objectWithoutProperties","_defineProperty","_objectSpread","_classCallCheck","_createClass","_inherits","_createSuper","React","Tooltip","Handle","createSliderWithTooltip","Component","_a","_React$Component","ComponentWrapper","_super","_this","apply","arguments","state","visibles","handleTooltipVisibleChange","index","visible","setState","prevState","handleWithTooltip","_ref","value","dragging","disabled","restProps","_this$props","props","tipFormatter","tipProps","handleStyle","getTooltipContainer","_tipProps$prefixCls","prefixCls","_tipProps$overlay","overlay","_tipProps$placement","placement","_tipProps$visible","restTooltipProps","handleStyleWithIndex","Array","isArray","createElement","Object","assign","key","style","onMouseEnter","onMouseLeave","render","handle","defaultProps","node","parentNode"],"mappings":"AAAA,OAAOA,wBAAP,MAAqC,oDAArC;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,aAAP,MAA0B,0CAA1B;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,OAAP,MAAoB,wBAApB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,eAAe,SAASC,uBAAT,CAAiCC,SAAjC,EAA4C;AACzD,MAAIC,EAAJ,CADyD,CACjD;;;AAGR,SAAOA,EAAE,GAAG,aAAa,UAAUC,gBAAV,EAA4B;AACnDR,IAAAA,SAAS,CAACS,gBAAD,EAAmBD,gBAAnB,CAAT;;AAEA,QAAIE,MAAM,GAAGT,YAAY,CAACQ,gBAAD,CAAzB;;AAEA,aAASA,gBAAT,GAA4B;AAC1B,UAAIE,KAAJ;;AAEAb,MAAAA,eAAe,CAAC,IAAD,EAAOW,gBAAP,CAAf;;AAEAE,MAAAA,KAAK,GAAGD,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAR;AACAF,MAAAA,KAAK,CAACG,KAAN,GAAc;AACZC,QAAAA,QAAQ,EAAE;AADE,OAAd;;AAIAJ,MAAAA,KAAK,CAACK,0BAAN,GAAmC,UAAUC,KAAV,EAAiBC,OAAjB,EAA0B;AAC3DP,QAAAA,KAAK,CAACQ,QAAN,CAAe,UAAUC,SAAV,EAAqB;AAClC,iBAAO;AACLL,YAAAA,QAAQ,EAAElB,aAAa,CAACA,aAAa,CAAC,EAAD,EAAKuB,SAAS,CAACL,QAAf,CAAd,EAAw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BAAOvC,KAAK,CAACK,0BAAN,CAAiCC,KAAjC,EAAwC,KAAxC,CAAP;AACD;AAR0D,SAA7B,CAA5B,CAPG,CAAP;AAiBD,OAhDD;;AAkDA,aAAON,KAAP;AACD;;AAEDZ,IAAAA,YAAY,CAACU,gBAAD,EAAmB,CAAC;AAC9BsC,MAAAA,GAAG,EAAE,QADyB;AAE9BxB,MAAAA,KAAK,EAAE,SAAS4B,MAAT,GAAkB;AACvB,eAAOjD,KAAK,CAAC0C,aAAN,CAAoBtC,SAApB,EAA+BuC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkB,KAAKlB,KAAvB,EAA8B;AAClEwB,UAAAA,MAAM,EAAE,KAAK/B;AADqD,SAA9B,CAA/B,CAAP;AAGD;AAN6B,KAAD,CAAnB,CAAZ;;AASA,WAAOZ,gBAAP;AACD,GAtFwB,CAsFvBP,KAAK,CAACI,SAtFiB,CAAlB,EAsFaC,EAAE,CAAC8C,YAAH,GAAkB;AACpCxB,IAAAA,YAAY,EAAE,SAASA,YAAT,CAAsBN,KAAtB,EAA6B;AACzC,aAAOA,KAAP;AACD,KAHmC;AAIpCQ,IAAAA,WAAW,EAAE,CAAC,EAAD,CAJuB;AAKpCD,IAAAA,QAAQ,EAAE,EAL0B;AAMpCE,IAAAA,mBAAmB,EAAE,SAASA,mBAAT,CAA6BsB,IAA7B,EAAmC;AACtD,aAAOA,IAAI,CAACC,UAAZ;AACD;AARmC,GAtF/B,EA+FJhD,EA/FH;AAgGD","sourcesContent":["import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\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 Tooltip from './common/SliderTooltip';\nimport Handle from './Handle';\nexport default function createSliderWithTooltip(Component) {\n var _a; // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n return _a = /*#__PURE__*/function (_React$Component) {\n _inherits(ComponentWrapper, _React$Component);\n\n var _super = _createSuper(ComponentWrapper);\n\n function ComponentWrapper() {\n var _this;\n\n _classCallCheck(this, ComponentWrapper);\n\n _this = _super.apply(this, arguments);\n _this.state = {\n visibles: {}\n };\n\n _this.handleTooltipVisibleChange = function (index, visible) {\n _this.setState(function (prevState) {\n return {\n visibles: _objectSpread(_objectSpread({}, prevState.visibles), {}, _defineProperty({}, index, visible))\n };\n });\n };\n\n _this.handleWithTooltip = function (_ref) {\n var value = _ref.value,\n dragging = _ref.dragging,\n index = _ref.index,\n disabled = _ref.disabled,\n restProps = _objectWithoutProperties(_ref, [\"value\", \"dragging\", \"index\", \"disabled\"]);\n\n var _this$props = _this.props,\n tipFormatter = _this$props.tipFormatter,\n tipProps = _this$props.tipProps,\n handleStyle = _this$props.handleStyle,\n getTooltipContainer = _this$props.getTooltipContainer;\n\n var _tipProps$prefixCls = tipProps.prefixCls,\n prefixCls = _tipProps$prefixCls === void 0 ? 'rc-slider-tooltip' : _tipProps$prefixCls,\n _tipProps$overlay = tipProps.overlay,\n overlay = _tipProps$overlay === void 0 ? tipFormatter(value) : _tipProps$overlay,\n _tipProps$placement = tipProps.placement,\n placement = _tipProps$placement === void 0 ? 'top' : _tipProps$placement,\n _tipProps$visible = tipProps.visible,\n visible = _tipProps$visible === void 0 ? false : _tipProps$visible,\n restTooltipProps = _objectWithoutProperties(tipProps, [\"prefixCls\", \"overlay\", \"placement\", \"visible\"]);\n\n var handleStyleWithIndex;\n\n if (Array.isArray(handleStyle)) {\n handleStyleWithIndex = handleStyle[index] || handleStyle[0];\n } else {\n handleStyleWithIndex = handleStyle;\n }\n\n return React.createElement(Tooltip, Object.assign({}, restTooltipProps, {\n getTooltipContainer: getTooltipContainer,\n prefixCls: prefixCls,\n overlay: overlay,\n placement: placement,\n visible: !disabled && (_this.state.visibles[index] || dragging) || visible,\n key: index\n }), React.createElement(Handle, Object.assign({}, restProps, {\n style: _objectSpread({}, handleStyleWithIndex),\n value: value,\n onMouseEnter: function onMouseEnter() {\n return _this.handleTooltipVisibleChange(index, true);\n },\n onMouseLeave: function onMouseLeave() {\n return _this.handleTooltipVisibleChange(index, false);\n }\n })));\n };\n\n return _this;\n }\n\n _createClass(ComponentWrapper, [{\n key: \"render\",\n value: function render() {\n return React.createElement(Component, Object.assign({}, this.props, {\n handle: this.handleWithTooltip\n }));\n }\n }]);\n\n return ComponentWrapper;\n }(React.Component), _a.defaultProps = {\n tipFormatter: function tipFormatter(value) {\n return value;\n },\n handleStyle: [{}],\n tipProps: {},\n getTooltipContainer: function getTooltipContainer(node) {\n return node.parentNode;\n }\n }, _a;\n}"]},"metadata":{},"sourceType":"module"}