mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
41 KiB
JSON
1 line
41 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport PopperContent from './PopperContent';\nimport { getTarget, targetPropType, omit, PopperPlacements, mapToCssModules, DOMElement } from './utils';\nexport var propTypes = {\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n placement: PropTypes.oneOf(PopperPlacements),\n target: targetPropType.isRequired,\n container: targetPropType,\n isOpen: PropTypes.bool,\n disabled: PropTypes.bool,\n hideArrow: PropTypes.bool,\n boundariesElement: PropTypes.oneOfType([PropTypes.string, DOMElement]),\n className: PropTypes.string,\n innerClassName: PropTypes.string,\n arrowClassName: PropTypes.string,\n popperClassName: PropTypes.string,\n cssModule: PropTypes.object,\n toggle: PropTypes.func,\n autohide: PropTypes.bool,\n placementPrefix: PropTypes.string,\n delay: PropTypes.oneOfType([PropTypes.shape({\n show: PropTypes.number,\n hide: PropTypes.number\n }), PropTypes.number]),\n modifiers: PropTypes.object,\n positionFixed: PropTypes.bool,\n offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.object]),\n trigger: PropTypes.string,\n fade: PropTypes.bool,\n flip: PropTypes.bool\n};\nvar DEFAULT_DELAYS = {\n show: 0,\n hide: 50\n};\nvar defaultProps = {\n isOpen: false,\n hideArrow: false,\n autohide: false,\n delay: DEFAULT_DELAYS,\n toggle: function toggle() {},\n trigger: 'click',\n fade: true\n};\n\nfunction isInDOMSubtree(element, subtreeRoot) {\n return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));\n}\n\nfunction isInDOMSubtrees(element, subtreeRoots) {\n if (subtreeRoots === void 0) {\n subtreeRoots = [];\n }\n\n return subtreeRoots && subtreeRoots.length && subtreeRoots.filter(function (subTreeRoot) {\n return isInDOMSubtree(element, subTreeRoot);\n })[0];\n}\n\nvar TooltipPopoverWrapper = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TooltipPopoverWrapper, _React$Component);\n\n function TooltipPopoverWrapper(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this._targets = [];\n _this.currentTargetElement = null;\n _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_this));\n _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));\n _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_this));\n _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));\n _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_this));\n _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_this));\n _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_this));\n _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_this));\n _this.show = _this.show.bind(_assertThisInitialized(_this));\n _this.hide = _this.hide.bind(_assertThisInitialized(_this));\n _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_this));\n _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));\n _this.state = {\n isOpen: props.isOpen\n };\n _this._isMounted = false;\n return _this;\n }\n\n var _proto = TooltipPopoverWrapper.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n this.updateTarget();\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this._isMounted = false;\n this.removeTargetEvents();\n this._targets = null;\n this.clearShowTimeout();\n this.clearHideTimeout();\n };\n\n TooltipPopoverWrapper.getDerivedStateFromProps = fu
|