b204e840aae74ad59a87f9617dde035a.json 25 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport RcTooltip from 'rc-tooltip';\nimport classNames from 'classnames';\nimport getPlacements from './placements';\nimport { cloneElement, isValidElement } from '../_util/reactNode';\nimport { ConfigContext } from '../config-provider';\nimport { PresetColorTypes } from '../_util/colors';\n\nvar splitObject = function splitObject(obj, keys) {\n  var picked = {};\n\n  var omitted = _extends({}, obj);\n\n  keys.forEach(function (key) {\n    if (obj && key in obj) {\n      picked[key] = obj[key];\n      delete omitted[key];\n    }\n  });\n  return {\n    picked: picked,\n    omitted: omitted\n  };\n};\n\nvar PresetColorRegex = new RegExp(\"^(\".concat(PresetColorTypes.join('|'), \")(-inverse)?$\")); // Fix Tooltip won't hide at disabled button\n// mouse events don't trigger at disabled button in Chrome\n// https://github.com/react-component/tooltip/issues/18\n\nfunction getDisabledCompatibleChildren(element, prefixCls) {\n  var elementType = element.type;\n\n  if ((elementType.__ANT_BUTTON === true || elementType.__ANT_SWITCH === true || elementType.__ANT_CHECKBOX === true || element.type === 'button') && element.props.disabled) {\n    // Pick some layout related style properties up to span\n    // Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254\n    var _splitObject = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']),\n        picked = _splitObject.picked,\n        omitted = _splitObject.omitted;\n\n    var spanStyle = _extends(_extends({\n      display: 'inline-block'\n    }, picked), {\n      cursor: 'not-allowed',\n      width: element.props.block ? '100%' : null\n    });\n\n    var buttonStyle = _extends(_extends({}, omitted), {\n      pointerEvents: 'none'\n    });\n\n    var child = cloneElement(element, {\n      style: buttonStyle,\n      className: null\n    });\n    return /*#__PURE__*/React.createElement(\"span\", {\n      style: spanStyle,\n      className: classNames(element.props.className, \"\".concat(prefixCls, \"-disabled-compatible-wrapper\"))\n    }, child);\n  }\n\n  return element;\n}\n\nvar Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _classNames2;\n\n  var _React$useContext = React.useContext(ConfigContext),\n      getContextPopupContainer = _React$useContext.getPopupContainer,\n      getPrefixCls = _React$useContext.getPrefixCls,\n      direction = _React$useContext.direction;\n\n  var _React$useState = React.useState(!!props.visible || !!props.defaultVisible),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      visible = _React$useState2[0],\n      setVisible = _React$useState2[1];\n\n  React.useEffect(function () {\n    if ('visible' in props) {\n      setVisible(props.visible);\n    }\n  }, [props.visible]);\n\n  var isNoTitle = function isNoTitle() {\n    var title = props.title,\n        overlay = props.overlay;\n    return !title && !overlay && title !== 0; // overlay for old version compatibility\n  };\n\n  var onVisibleChange = function onVisibleChange(vis) {\n    if (!('visible' in props)) {\n      setVisible(isNoTitle() ? false : vis);\n    }\n\n    if (props.onVisibleChange && !isNoTitle()) {\n      props.onVisibleChange(vis);\n    }\n  };\n\n  var getTooltipPlacements = function getTooltipPlacements() {\n    var builtinPlacements = props.builtinPlacements,\n        arrowPointAtCenter = props.arrowPointAtCenter,\n        autoAdjustOverflow = props.autoAdjustOverflow;\n    return builtinPlacements || getPlacements({\n      arrowPointAtCenter: arrowPointAtCenter,\n      autoAdjustOverflow: autoAdjustOverflow\n    });\n  }; // 动态设置动画点\n\n\n  var onPopupAlign = function onPopupAlign(domNode, align) {\n    var placements = getTooltipPlacements(); // 当前返回的位置\n\n    var placement = Object.keys(placements).filter(function (key) {\n      return placements[key].points[0] === align.points[0] && placements[key].points[1] === align.points[1];\n    })[0];\n\n    if (!placement) {\n      return;\n    } // 根据当前坐标设置动画点\n\n\n    var rect = domNode.getBoundingClientRect();\n    var transformOrigin = {\n      top: '50%',\n      left: '50%'\n    };\n\n    if (placement.indexOf('top') >= 0 || placement.indexOf('Bottom') >= 0) {\n      transformOrigin.top = \"\".concat(rect.height - align.offset[1], \"px\");\n    } else if (placement.indexOf('Top') >= 0 || placement.indexOf('bottom') >= 0) {\n      transformOrigin.top = \"\".concat(-align.offset[1], \"px\");\n    }\n\n    if (placement.indexOf('left') >= 0 || placement.indexOf('Right') >= 0) {\n      transformOrigin.left = \"\".concat(rect.width - align.offset[0], \"px\");\n    } else if (placement.indexOf('right') >= 0 || placement.indexOf('Left') >= 0) {\n      transformOrigin.left = \"\".concat(-align.offset[0], \"px\");\n    }\n\n    domNode.style.transformOrigin = \"\".concat(transformOrigin.left, \" \").concat(transformOrigin.top);\n  };\n\n  var getOverlay = function getOverlay() {\n    var title = props.title,\n        overlay = props.overlay;\n\n    if (title === 0) {\n      return title;\n    }\n\n    return overlay || title || '';\n  };\n\n  var customizePrefixCls = props.prefixCls,\n      openClassName = props.openClassName,\n      getPopupContainer = props.getPopupContainer,\n      getTooltipContainer = props.getTooltipContainer,\n      overlayClassName = props.overlayClassName,\n      color = props.color,\n      overlayInnerStyle = props.overlayInnerStyle,\n      children = props.children;\n  var prefixCls = getPrefixCls('tooltip', customizePrefixCls);\n  var tempVisible = visible; // Hide tooltip when there is no title\n\n  if (!('visible' in props) && isNoTitle()) {\n    tempVisible = false;\n  }\n\n  var child = getDisabledCompatibleChildren(isValidElement(children) ? children : /*#__PURE__*/React.createElement(\"span\", null, children), prefixCls);\n  var childProps = child.props;\n  var childCls = classNames(childProps.className, _defineProperty({}, openClassName || \"\".concat(prefixCls, \"-open\"), true));\n  var customOverlayClassName = classNames(overlayClassName, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-\").concat(color), color && PresetColorRegex.test(color)), _classNames2));\n  var formattedOverlayInnerStyle = overlayInnerStyle;\n  var arrowContentStyle;\n\n  if (color && !PresetColorRegex.test(color)) {\n    formattedOverlayInnerStyle = _extends(_extends({}, overlayInnerStyle), {\n      background: color\n    });\n    arrowContentStyle = {\n      background: color\n    };\n  }\n\n  return /*#__PURE__*/React.createElement(RcTooltip, _extends({}, props, {\n    prefixCls: prefixCls,\n    overlayClassName: customOverlayClassName,\n    getTooltipContainer: getPopupContainer || getTooltipContainer || getContextPopupContainer,\n    ref: ref,\n    builtinPlacements: getTooltipPlacements(),\n    overlay: getOverlay(),\n    visible: tempVisible,\n    onVisibleChange: onVisibleChange,\n    onPopupAlign: onPopupAlign,\n    overlayInnerStyle: formattedOverlayInnerStyle,\n    arrowContent: /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-arrow-content\"),\n      style: arrowContentStyle\n    })\n  }), tempVisible ? cloneElement(child, {\n    className: childCls\n  }) : child);\n});\nTooltip.displayName = 'Tooltip';\nTooltip.defaultProps = {\n  placement: 'top',\n  transitionName: 'zoom-big-fast',\n  mouseEnterDelay: 0.1,\n  mouseLeaveDelay: 0.1,\n  arrowPointAtCenter: false,\n  autoAdjustOverflow: true\n};\nexport default Tooltip;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/tooltip/index.js"],"names":["_defineProperty","_slicedToArray","_extends","React","RcTooltip","classNames","getPlacements","cloneElement","isValidElement","ConfigContext","PresetColorTypes","splitObject","obj","keys","picked","omitted","forEach","key","PresetColorRegex","RegExp","concat","join","getDisabledCompatibleChildren","element","prefixCls","elementType","type","__ANT_BUTTON","__ANT_SWITCH","__ANT_CHECKBOX","props","disabled","_splitObject","style","spanStyle","display","cursor","width","block","buttonStyle","pointerEvents","child","className","createElement","Tooltip","forwardRef","ref","_classNames2","_React$useContext","useContext","getContextPopupContainer","getPopupContainer","getPrefixCls","direction","_React$useState","useState","visible","defaultVisible","_React$useState2","setVisible","useEffect","isNoTitle","title","overlay","onVisibleChange","vis","getTooltipPlacements","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","onPopupAlign","domNode","align","placements","placement","Object","filter","points","rect","getBoundingClientRect","transformOrigin","top","left","indexOf","height","offset","getOverlay","customizePrefixCls","openClassName","getTooltipContainer","overlayClassName","color","overlayInnerStyle","children","tempVisible","childProps","childCls","customOverlayClassName","test","formattedOverlayInnerStyle","arrowContentStyle","background","arrowContent","displayName","defaultProps","transitionName","mouseEnterDelay","mouseLeaveDelay"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,cAAP,MAA2B,sCAA3B;AACA,OAAOC,QAAP,MAAqB,gCAArB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,aAAP,MAA0B,cAA1B;AACA,SAASC,YAAT,EAAuBC,cAAvB,QAA6C,oBAA7C;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,gBAAT,QAAiC,iBAAjC;;AAEA,IAAIC,WAAW,GAAG,SAASA,WAAT,CAAqBC,GAArB,EAA0BC,IAA1B,EAAgC;AAChD,MAAIC,MAAM,GAAG,EAAb;;AAEA,MAAIC,OAAO,GAAGb,QAAQ,CAAC,EAAD,EAAKU,GAAL,CAAtB;;AAEAC,EAAAA,IAAI,CAACG,OAAL,CAAa,UAAUC,GAAV,EAAe;AAC1B,QAAIL,GAAG,IAAIK,GAAG,IAAIL,GAAlB,EAAuB;AACrBE,MAAAA,MAAM,CAACG,GAAD,CAAN,GAAcL,GAAG,CAACK,GAAD,CAAjB;AACA,aAAOF,OAAO,CAACE,GAAD,CAAd;AACD;AACF,GALD;AAMA,SAAO;AACLH,IAAAA,MAAM,EAAEA,MADH;AAELC,IAAAA,OAAO,EAAEA;AAFJ,GAAP;AAID,CAfD;;AAiBA,IAAIG,gBAAgB,GAAG,IAAIC,MAAJ,CAAW,KAAKC,MAAL,CAAYV,gBAAgB,CAACW,IAAjB,CAAsB,GAAtB,CAAZ,EAAwC,eAAxC,CAAX,CAAvB,C,CAA6F;AAC7F;AACA;;AAEA,SAASC,6BAAT,CAAuCC,OAAvC,EAAgDC,SAAhD,EAA2D;AACzD,M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IAAAA,mBAAmB,EAAEtC,iBAAiB,IAAIsC,mBAArB,IAA4CvC,wBAHI;AAIrEJ,IAAAA,GAAG,EAAEA,GAJgE;AAKrEqB,IAAAA,iBAAiB,EAAED,oBAAoB,EAL8B;AAMrEH,IAAAA,OAAO,EAAEuB,UAAU,EANkD;AAOrE9B,IAAAA,OAAO,EAAEsC,WAP4D;AAQrE9B,IAAAA,eAAe,EAAEA,eARoD;AASrEM,IAAAA,YAAY,EAAEA,YATuD;AAUrEsB,IAAAA,iBAAiB,EAAEO,0BAVkD;AAWrEG,IAAAA,YAAY,EAAE,aAAanG,KAAK,CAACwC,aAAN,CAAoB,MAApB,EAA4B;AACrDD,MAAAA,SAAS,EAAE,GAAGtB,MAAH,CAAUI,SAAV,EAAqB,gBAArB,CAD0C;AAErDS,MAAAA,KAAK,EAAEmE;AAF8C,KAA5B;AAX0C,GAAZ,CAAvC,EAehBN,WAAW,GAAGvF,YAAY,CAACkC,KAAD,EAAQ;AACpCC,IAAAA,SAAS,EAAEsD;AADyB,GAAR,CAAf,GAEVvD,KAjBe,CAApB;AAkBD,CA3I0B,CAA3B;AA4IAG,OAAO,CAAC2D,WAAR,GAAsB,SAAtB;AACA3D,OAAO,CAAC4D,YAAR,GAAuB;AACrB9B,EAAAA,SAAS,EAAE,KADU;AAErB+B,EAAAA,cAAc,EAAE,eAFK;AAGrBC,EAAAA,eAAe,EAAE,GAHI;AAIrBC,EAAAA,eAAe,EAAE,GAJI;AAKrBvC,EAAAA,kBAAkB,EAAE,KALC;AAMrBC,EAAAA,kBAAkB,EAAE;AANC,CAAvB;AAQA,eAAezB,OAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport RcTooltip from 'rc-tooltip';\nimport classNames from 'classnames';\nimport getPlacements from './placements';\nimport { cloneElement, isValidElement } from '../_util/reactNode';\nimport { ConfigContext } from '../config-provider';\nimport { PresetColorTypes } from '../_util/colors';\n\nvar splitObject = function splitObject(obj, keys) {\n  var picked = {};\n\n  var omitted = _extends({}, obj);\n\n  keys.forEach(function (key) {\n    if (obj && key in obj) {\n      picked[key] = obj[key];\n      delete omitted[key];\n    }\n  });\n  return {\n    picked: picked,\n    omitted: omitted\n  };\n};\n\nvar PresetColorRegex = new RegExp(\"^(\".concat(PresetColorTypes.join('|'), \")(-inverse)?$\")); // Fix Tooltip won't hide at disabled button\n// mouse events don't trigger at disabled button in Chrome\n// https://github.com/react-component/tooltip/issues/18\n\nfunction getDisabledCompatibleChildren(element, prefixCls) {\n  var elementType = element.type;\n\n  if ((elementType.__ANT_BUTTON === true || elementType.__ANT_SWITCH === true || elementType.__ANT_CHECKBOX === true || element.type === 'button') && element.props.disabled) {\n    // Pick some layout related style properties up to span\n    // Prevent layout bugs like https://github.com/ant-design/ant-design/issues/5254\n    var _splitObject = splitObject(element.props.style, ['position', 'left', 'right', 'top', 'bottom', 'float', 'display', 'zIndex']),\n        picked = _splitObject.picked,\n        omitted = _splitObject.omitted;\n\n    var spanStyle = _extends(_extends({\n      display: 'inline-block'\n    }, picked), {\n      cursor: 'not-allowed',\n      width: element.props.block ? '100%' : null\n    });\n\n    var buttonStyle = _extends(_extends({}, omitted), {\n      pointerEvents: 'none'\n    });\n\n    var child = cloneElement(element, {\n      style: buttonStyle,\n      className: null\n    });\n    return /*#__PURE__*/React.createElement(\"span\", {\n      style: spanStyle,\n      className: classNames(element.props.className, \"\".concat(prefixCls, \"-disabled-compatible-wrapper\"))\n    }, child);\n  }\n\n  return element;\n}\n\nvar Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _classNames2;\n\n  var _React$useContext = React.useContext(ConfigContext),\n      getContextPopupContainer = _React$useContext.getPopupContainer,\n      getPrefixCls = _React$useContext.getPrefixCls,\n      direction = _React$useContext.direction;\n\n  var _React$useState = React.useState(!!props.visible || !!props.defaultVisible),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      visible = _React$useState2[0],\n      setVisible = _React$useState2[1];\n\n  React.useEffect(function () {\n    if ('visible' in props) {\n      setVisible(props.visible);\n    }\n  }, [props.visible]);\n\n  var isNoTitle = function isNoTitle() {\n    var title = props.title,\n        overlay = props.overlay;\n    return !title && !overlay && title !== 0; // overlay for old version compatibility\n  };\n\n  var onVisibleChange = function onVisibleChange(vis) {\n    if (!('visible' in props)) {\n      setVisible(isNoTitle() ? false : vis);\n    }\n\n    if (props.onVisibleChange && !isNoTitle()) {\n      props.onVisibleChange(vis);\n    }\n  };\n\n  var getTooltipPlacements = function getTooltipPlacements() {\n    var builtinPlacements = props.builtinPlacements,\n        arrowPointAtCenter = props.arrowPointAtCenter,\n        autoAdjustOverflow = props.autoAdjustOverflow;\n    return builtinPlacements || getPlacements({\n      arrowPointAtCenter: arrowPointAtCenter,\n      autoAdjustOverflow: autoAdjustOverflow\n    });\n  }; // 动态设置动画点\n\n\n  var onPopupAlign = function onPopupAlign(domNode, align) {\n    var placements = getTooltipPlacements(); // 当前返回的位置\n\n    var placement = Object.keys(placements).filter(function (key) {\n      return placements[key].points[0] === align.points[0] && placements[key].points[1] === align.points[1];\n    })[0];\n\n    if (!placement) {\n      return;\n    } // 根据当前坐标设置动画点\n\n\n    var rect = domNode.getBoundingClientRect();\n    var transformOrigin = {\n      top: '50%',\n      left: '50%'\n    };\n\n    if (placement.indexOf('top') >= 0 || placement.indexOf('Bottom') >= 0) {\n      transformOrigin.top = \"\".concat(rect.height - align.offset[1], \"px\");\n    } else if (placement.indexOf('Top') >= 0 || placement.indexOf('bottom') >= 0) {\n      transformOrigin.top = \"\".concat(-align.offset[1], \"px\");\n    }\n\n    if (placement.indexOf('left') >= 0 || placement.indexOf('Right') >= 0) {\n      transformOrigin.left = \"\".concat(rect.width - align.offset[0], \"px\");\n    } else if (placement.indexOf('right') >= 0 || placement.indexOf('Left') >= 0) {\n      transformOrigin.left = \"\".concat(-align.offset[0], \"px\");\n    }\n\n    domNode.style.transformOrigin = \"\".concat(transformOrigin.left, \" \").concat(transformOrigin.top);\n  };\n\n  var getOverlay = function getOverlay() {\n    var title = props.title,\n        overlay = props.overlay;\n\n    if (title === 0) {\n      return title;\n    }\n\n    return overlay || title || '';\n  };\n\n  var customizePrefixCls = props.prefixCls,\n      openClassName = props.openClassName,\n      getPopupContainer = props.getPopupContainer,\n      getTooltipContainer = props.getTooltipContainer,\n      overlayClassName = props.overlayClassName,\n      color = props.color,\n      overlayInnerStyle = props.overlayInnerStyle,\n      children = props.children;\n  var prefixCls = getPrefixCls('tooltip', customizePrefixCls);\n  var tempVisible = visible; // Hide tooltip when there is no title\n\n  if (!('visible' in props) && isNoTitle()) {\n    tempVisible = false;\n  }\n\n  var child = getDisabledCompatibleChildren(isValidElement(children) ? children : /*#__PURE__*/React.createElement(\"span\", null, children), prefixCls);\n  var childProps = child.props;\n  var childCls = classNames(childProps.className, _defineProperty({}, openClassName || \"\".concat(prefixCls, \"-open\"), true));\n  var customOverlayClassName = classNames(overlayClassName, (_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-\").concat(color), color && PresetColorRegex.test(color)), _classNames2));\n  var formattedOverlayInnerStyle = overlayInnerStyle;\n  var arrowContentStyle;\n\n  if (color && !PresetColorRegex.test(color)) {\n    formattedOverlayInnerStyle = _extends(_extends({}, overlayInnerStyle), {\n      background: color\n    });\n    arrowContentStyle = {\n      background: color\n    };\n  }\n\n  return /*#__PURE__*/React.createElement(RcTooltip, _extends({}, props, {\n    prefixCls: prefixCls,\n    overlayClassName: customOverlayClassName,\n    getTooltipContainer: getPopupContainer || getTooltipContainer || getContextPopupContainer,\n    ref: ref,\n    builtinPlacements: getTooltipPlacements(),\n    overlay: getOverlay(),\n    visible: tempVisible,\n    onVisibleChange: onVisibleChange,\n    onPopupAlign: onPopupAlign,\n    overlayInnerStyle: formattedOverlayInnerStyle,\n    arrowContent: /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-arrow-content\"),\n      style: arrowContentStyle\n    })\n  }), tempVisible ? cloneElement(child, {\n    className: childCls\n  }) : child);\n});\nTooltip.displayName = 'Tooltip';\nTooltip.defaultProps = {\n  placement: 'top',\n  transitionName: 'zoom-big-fast',\n  mouseEnterDelay: 0.1,\n  mouseLeaveDelay: 0.1,\n  arrowPointAtCenter: false,\n  autoAdjustOverflow: true\n};\nexport default Tooltip;"]},"metadata":{},"sourceType":"module"}