mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25: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 = function getDerivedStateFromProps(props, state) {\n if (props.isOpen && !state.isOpen) {\n return {\n isOpen: props.isOpen\n };\n } else return null;\n };\n\n _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {\n if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n if (this.state.isOpen && !this.props.isOpen) {\n this.toggle();\n }\n }\n };\n\n _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {\n if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {\n if (this._showTimeout) {\n this.clearShowTimeout();\n }\n\n e.persist();\n this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));\n }\n };\n\n _proto.onEscKeyDown = function onEscKeyDown(e) {\n if (e.key === 'Escape') {\n this.hide(e);\n }\n };\n\n _proto.getRef = function getRef(ref) {\n var innerRef = this.props.innerRef;\n\n if (innerRef) {\n if (typeof innerRef === 'function') {\n innerRef(ref);\n } else if (typeof innerRef === 'object') {\n innerRef.current = ref;\n }\n }\n\n this._popover = ref;\n };\n\n _proto.getDelay = function getDelay(key) {\n var delay = this.props.delay;\n\n if (typeof delay === 'object') {\n return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];\n }\n\n return delay;\n };\n\n _proto.getCurrentTarget = function getCurrentTarget(target) {\n if (!target) return null;\n\n var index = this._targets.indexOf(target);\n\n if (index >= 0) return this._targets[index];\n return this.getCurrentTarget(target.parentElement);\n };\n\n _proto.show = function show(e) {\n if (!this.props.isOpen) {\n this.clearShowTimeout();\n this.currentTargetElement = e ? e.currentTarget || this.getCurrentTarget(e.target) : null;\n\n if (e && e.composedPath && typeof e.composedPath === 'function') {\n var path = e.composedPath();\n this.currentTargetElement = path && path[0] || this.currentTargetElement;\n }\n\n this.toggle(e);\n }\n };\n\n _proto.showWithDelay = function showWithDelay(e) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));\n };\n\n _proto.hide = function hide(e) {\n if (this.props.isOpen) {\n this.clearHideTimeout();\n this.currentTargetElement = null;\n this.toggle(e);\n }\n };\n\n _proto.hideWithDelay = function hideWithDelay(e) {\n if (this._showTimeout) {\n this.clearShowTimeout();\n }\n\n this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));\n };\n\n _proto.clearShowTimeout = function clearShowTimeout() {\n clearTimeout(this._showTimeout);\n this._showTimeout = undefined;\n };\n\n _proto.clearHideTimeout = function clearHideTimeout() {\n clearTimeout(this._hideTimeout);\n this._hideTimeout = undefined;\n };\n\n _proto.handleDocumentClick = function handleDocumentClick(e) {\n var triggers = this.props.trigger.split(' ');\n\n if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtrees(e.target, this._targets))) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {\n this.hideWithDelay(e);\n } else if (!this.props.isOpen) {\n this.showWithDelay(e);\n }\n } else if (triggers.indexOf('click') > -1 && isInDOMSubtrees(e.target, this._targets)) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n if (!this.props.isOpen) {\n this.showWithDelay(e);\n } else {\n this.hideWithDelay(e);\n }\n }\n };\n\n _proto.addEventOnTargets = function addEventOnTargets(type, handler, isBubble) {\n this._targets.forEach(function (target) {\n target.addEventListener(type, handler, isBubble);\n });\n };\n\n _proto.removeEventOnTargets = function removeEventOnTargets(type, handler, isBubble) {\n this._targets.forEach(function (target) {\n target.removeEventListener(type, handler, isBubble);\n });\n };\n\n _proto.addTargetEvents = function addTargetEvents() {\n if (this.props.trigger) {\n var triggers = this.props.trigger.split(' ');\n\n if (triggers.indexOf('manual') === -1) {\n if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {\n document.addEventListener('click', this.handleDocumentClick, true);\n }\n\n if (this._targets && this._targets.length) {\n if (triggers.indexOf('hover') > -1) {\n this.addEventOnTargets('mouseover', this.showWithDelay, true);\n this.addEventOnTargets('mouseout', this.hideWithDelay, true);\n }\n\n if (triggers.indexOf('focus') > -1) {\n this.addEventOnTargets('focusin', this.show, true);\n this.addEventOnTargets('focusout', this.hide, true);\n }\n\n this.addEventOnTargets('keydown', this.onEscKeyDown, true);\n }\n }\n }\n };\n\n _proto.removeTargetEvents = function removeTargetEvents() {\n if (this._targets) {\n this.removeEventOnTargets('mouseover', this.showWithDelay, true);\n this.removeEventOnTargets('mouseout', this.hideWithDelay, true);\n this.removeEventOnTargets('keydown', this.onEscKeyDown, true);\n this.removeEventOnTargets('focusin', this.show, true);\n this.removeEventOnTargets('focusout', this.hide, true);\n }\n\n document.removeEventListener('click', this.handleDocumentClick, true);\n };\n\n _proto.updateTarget = function updateTarget() {\n var newTarget = getTarget(this.props.target, true);\n\n if (newTarget !== this._targets) {\n this.removeTargetEvents();\n this._targets = newTarget ? Array.from(newTarget) : [];\n this.currentTargetElement = this.currentTargetElement || this._targets[0];\n this.addTargetEvents();\n }\n };\n\n _proto.toggle = function toggle(e) {\n if (this.props.disabled || !this._isMounted) {\n return e && e.preventDefault();\n }\n\n return this.props.toggle(e);\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n if (this.props.isOpen) {\n this.updateTarget();\n }\n\n var target = this.currentTargetElement || this._targets[0];\n\n if (!target) {\n return null;\n }\n\n var _this$props = this.props,\n className = _this$props.className,\n cssModule = _this$props.cssModule,\n innerClassName = _this$props.innerClassName,\n isOpen = _this$props.isOpen,\n hideArrow = _this$props.hideArrow,\n boundariesElement = _this$props.boundariesElement,\n placement = _this$props.placement,\n placementPrefix = _this$props.placementPrefix,\n arrowClassName = _this$props.arrowClassName,\n popperClassName = _this$props.popperClassName,\n container = _this$props.container,\n modifiers = _this$props.modifiers,\n positionFixed = _this$props.positionFixed,\n offset = _this$props.offset,\n fade = _this$props.fade,\n flip = _this$props.flip,\n children = _this$props.children;\n var attributes = omit(this.props, Object.keys(propTypes));\n var popperClasses = mapToCssModules(popperClassName, cssModule);\n var classes = mapToCssModules(innerClassName, cssModule);\n return /*#__PURE__*/React.createElement(PopperContent, {\n className: className,\n target: target,\n isOpen: isOpen,\n hideArrow: hideArrow,\n boundariesElement: boundariesElement,\n placement: placement,\n placementPrefix: placementPrefix,\n arrowClassName: arrowClassName,\n popperClassName: popperClasses,\n container: container,\n modifiers: modifiers,\n positionFixed: positionFixed,\n offset: offset,\n cssModule: cssModule,\n fade: fade,\n flip: flip\n }, function (_ref) {\n var scheduleUpdate = _ref.scheduleUpdate;\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, attributes, {\n ref: _this2.getRef,\n className: classes,\n role: \"tooltip\",\n onMouseOver: _this2.onMouseOverTooltipContent,\n onMouseLeave: _this2.onMouseLeaveTooltipContent,\n onKeyDown: _this2.onEscKeyDown\n }), typeof children === 'function' ? children({\n scheduleUpdate: scheduleUpdate\n }) : children);\n });\n };\n\n return TooltipPopoverWrapper;\n}(React.Component);\n\nTooltipPopoverWrapper.propTypes = propTypes;\nTooltipPopoverWrapper.defaultProps = defaultProps;\nexport default TooltipPopoverWrapper;","map":{"version":3,"sources":["/app/node_modules/reactstrap/es/TooltipPopoverWrapper.js"],"names":["_extends","_assertThisInitialized","_inheritsLoose","React","PropTypes","PopperContent","getTarget","targetPropType","omit","PopperPlacements","mapToCssModules","DOMElement","propTypes","children","oneOfType","node","func","placement","oneOf","target","isRequired","container","isOpen","bool","disabled","hideArrow","boundariesElement","string","className","innerClassName","arrowClassName","popperClassName","cssModule","object","toggle","autohide","placementPrefix","delay","shape","show","number","hide","modifiers","positionFixed","offset","innerRef","trigger","fade","flip","DEFAULT_DELAYS","defaultProps","isInDOMSubtree","element","subtreeRoot","contains","isInDOMSubtrees","subtreeRoots","length","filter","subTreeRoot","TooltipPopoverWrapper","_React$Component","props","_this","call","_targets","currentTargetElement","addTargetEvents","bind","handleDocumentClick","removeTargetEvents","showWithDelay","hideWithDelay","onMouseOverTooltipContent","onMouseLeaveTooltipContent","onEscKeyDown","getRef","state","_isMounted","_proto","prototype","componentDidMount","updateTarget","componentWillUnmount","clearShowTimeout","clearHideTimeout","getDerivedStateFromProps","indexOf","_hideTimeout","e","_showTimeout","persist","setTimeout","getDelay","key","ref","current","_popover","isNaN","getCurrentTarget","index","parentElement","currentTarget","composedPath","path","clearTimeout","undefined","triggers","split","addEventOnTargets","type","handler","isBubble","forEach","addEventListener","removeEventOnTargets","removeEventListener","document","newTarget","Array","from","preventDefault","render","_this2","_this$props","attributes","Object","keys","popperClasses","classes","createElement","_ref","scheduleUpdate","role","onMouseOver","onMouseLeave","onKeyDown","Component"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,SAASC,SAAT,EAAoBC,cAApB,EAAoCC,IAApC,EAA0CC,gBAA1C,EAA4DC,eAA5D,EAA6EC,UAA7E,QAA+F,SAA/F;AACA,OAAO,IAAIC,SAAS,GAAG;AACrBC,EAAAA,QAAQ,EAAET,SAAS,CAACU,SAAV,CAAoB,CAACV,SAAS,CAACW,IAAX,EAAiBX,SAAS,CAACY,IAA3B,CAApB,CADW;AAErBC,EAAAA,SAAS,EAAEb,SAAS,CAACc,KAAV,CAAgBT,gBAAhB,CAFU;AAGrBU,EAAAA,MAAM,EAAEZ,cAAc,CAACa,UAHF;AAIrBC,EAAAA,SAAS,EAAEd,cAJU;AAKrBe,EAAAA,MAAM,EAAElB,SAAS,CAACmB,IALG;AAMrBC,EAAAA,QAAQ,EAAEpB,SAAS,CAACmB,IANC;AAOrBE,EAAAA,SAAS,EAAErB,SAAS,CAACmB,IAPA;AAQrBG,EAAAA,iBAAiB,EAAEtB,SAAS,CAACU,SAAV,CAAoB,CAACV,SAAS,CAACuB,MAAX,EAAmBhB,UAAnB,CAApB,CARE;AASrBiB,EAAAA,SAAS,EAAExB,SAAS,CAACuB,MATA;AAUrBE,EA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KAAK,CAAC+H,aAAN,CAAoB,KAApB,EAA2BlI,QAAQ,CAAC,EAAD,EAAK6H,UAAL,EAAiB;AACtE9B,QAAAA,GAAG,EAAE4B,MAAM,CAAC/C,MAD0D;AAEtEhD,QAAAA,SAAS,EAAEqG,OAF2D;AAGtEI,QAAAA,IAAI,EAAE,SAHgE;AAItEC,QAAAA,WAAW,EAAEX,MAAM,CAAClD,yBAJkD;AAKtE8D,QAAAA,YAAY,EAAEZ,MAAM,CAACjD,0BALiD;AAMtE8D,QAAAA,SAAS,EAAEb,MAAM,CAAChD;AANoD,OAAjB,CAAnC,EAOhB,OAAO9D,QAAP,KAAoB,UAApB,GAAiCA,QAAQ,CAAC;AAC5CuH,QAAAA,cAAc,EAAEA;AAD4B,OAAD,CAAzC,GAECvH,QATe,CAApB;AAUD,KA7BmB,CAApB;AA8BD,GAhED;;AAkEA,SAAO+C,qBAAP;AACD,CAnUwC,CAmUvCzD,KAAK,CAACsI,SAnUiC,CAAzC;;AAqUA7E,qBAAqB,CAAChD,SAAtB,GAAkCA,SAAlC;AACAgD,qBAAqB,CAACV,YAAtB,GAAqCA,YAArC;AACA,eAAeU,qBAAf","sourcesContent":["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 = function getDerivedStateFromProps(props, state) {\n if (props.isOpen && !state.isOpen) {\n return {\n isOpen: props.isOpen\n };\n } else return null;\n };\n\n _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {\n if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n if (this.state.isOpen && !this.props.isOpen) {\n this.toggle();\n }\n }\n };\n\n _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {\n if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {\n if (this._showTimeout) {\n this.clearShowTimeout();\n }\n\n e.persist();\n this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));\n }\n };\n\n _proto.onEscKeyDown = function onEscKeyDown(e) {\n if (e.key === 'Escape') {\n this.hide(e);\n }\n };\n\n _proto.getRef = function getRef(ref) {\n var innerRef = this.props.innerRef;\n\n if (innerRef) {\n if (typeof innerRef === 'function') {\n innerRef(ref);\n } else if (typeof innerRef === 'object') {\n innerRef.current = ref;\n }\n }\n\n this._popover = ref;\n };\n\n _proto.getDelay = function getDelay(key) {\n var delay = this.props.delay;\n\n if (typeof delay === 'object') {\n return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];\n }\n\n return delay;\n };\n\n _proto.getCurrentTarget = function getCurrentTarget(target) {\n if (!target) return null;\n\n var index = this._targets.indexOf(target);\n\n if (index >= 0) return this._targets[index];\n return this.getCurrentTarget(target.parentElement);\n };\n\n _proto.show = function show(e) {\n if (!this.props.isOpen) {\n this.clearShowTimeout();\n this.currentTargetElement = e ? e.currentTarget || this.getCurrentTarget(e.target) : null;\n\n if (e && e.composedPath && typeof e.composedPath === 'function') {\n var path = e.composedPath();\n this.currentTargetElement = path && path[0] || this.currentTargetElement;\n }\n\n this.toggle(e);\n }\n };\n\n _proto.showWithDelay = function showWithDelay(e) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));\n };\n\n _proto.hide = function hide(e) {\n if (this.props.isOpen) {\n this.clearHideTimeout();\n this.currentTargetElement = null;\n this.toggle(e);\n }\n };\n\n _proto.hideWithDelay = function hideWithDelay(e) {\n if (this._showTimeout) {\n this.clearShowTimeout();\n }\n\n this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));\n };\n\n _proto.clearShowTimeout = function clearShowTimeout() {\n clearTimeout(this._showTimeout);\n this._showTimeout = undefined;\n };\n\n _proto.clearHideTimeout = function clearHideTimeout() {\n clearTimeout(this._hideTimeout);\n this._hideTimeout = undefined;\n };\n\n _proto.handleDocumentClick = function handleDocumentClick(e) {\n var triggers = this.props.trigger.split(' ');\n\n if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtrees(e.target, this._targets))) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {\n this.hideWithDelay(e);\n } else if (!this.props.isOpen) {\n this.showWithDelay(e);\n }\n } else if (triggers.indexOf('click') > -1 && isInDOMSubtrees(e.target, this._targets)) {\n if (this._hideTimeout) {\n this.clearHideTimeout();\n }\n\n if (!this.props.isOpen) {\n this.showWithDelay(e);\n } else {\n this.hideWithDelay(e);\n }\n }\n };\n\n _proto.addEventOnTargets = function addEventOnTargets(type, handler, isBubble) {\n this._targets.forEach(function (target) {\n target.addEventListener(type, handler, isBubble);\n });\n };\n\n _proto.removeEventOnTargets = function removeEventOnTargets(type, handler, isBubble) {\n this._targets.forEach(function (target) {\n target.removeEventListener(type, handler, isBubble);\n });\n };\n\n _proto.addTargetEvents = function addTargetEvents() {\n if (this.props.trigger) {\n var triggers = this.props.trigger.split(' ');\n\n if (triggers.indexOf('manual') === -1) {\n if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {\n document.addEventListener('click', this.handleDocumentClick, true);\n }\n\n if (this._targets && this._targets.length) {\n if (triggers.indexOf('hover') > -1) {\n this.addEventOnTargets('mouseover', this.showWithDelay, true);\n this.addEventOnTargets('mouseout', this.hideWithDelay, true);\n }\n\n if (triggers.indexOf('focus') > -1) {\n this.addEventOnTargets('focusin', this.show, true);\n this.addEventOnTargets('focusout', this.hide, true);\n }\n\n this.addEventOnTargets('keydown', this.onEscKeyDown, true);\n }\n }\n }\n };\n\n _proto.removeTargetEvents = function removeTargetEvents() {\n if (this._targets) {\n this.removeEventOnTargets('mouseover', this.showWithDelay, true);\n this.removeEventOnTargets('mouseout', this.hideWithDelay, true);\n this.removeEventOnTargets('keydown', this.onEscKeyDown, true);\n this.removeEventOnTargets('focusin', this.show, true);\n this.removeEventOnTargets('focusout', this.hide, true);\n }\n\n document.removeEventListener('click', this.handleDocumentClick, true);\n };\n\n _proto.updateTarget = function updateTarget() {\n var newTarget = getTarget(this.props.target, true);\n\n if (newTarget !== this._targets) {\n this.removeTargetEvents();\n this._targets = newTarget ? Array.from(newTarget) : [];\n this.currentTargetElement = this.currentTargetElement || this._targets[0];\n this.addTargetEvents();\n }\n };\n\n _proto.toggle = function toggle(e) {\n if (this.props.disabled || !this._isMounted) {\n return e && e.preventDefault();\n }\n\n return this.props.toggle(e);\n };\n\n _proto.render = function render() {\n var _this2 = this;\n\n if (this.props.isOpen) {\n this.updateTarget();\n }\n\n var target = this.currentTargetElement || this._targets[0];\n\n if (!target) {\n return null;\n }\n\n var _this$props = this.props,\n className = _this$props.className,\n cssModule = _this$props.cssModule,\n innerClassName = _this$props.innerClassName,\n isOpen = _this$props.isOpen,\n hideArrow = _this$props.hideArrow,\n boundariesElement = _this$props.boundariesElement,\n placement = _this$props.placement,\n placementPrefix = _this$props.placementPrefix,\n arrowClassName = _this$props.arrowClassName,\n popperClassName = _this$props.popperClassName,\n container = _this$props.container,\n modifiers = _this$props.modifiers,\n positionFixed = _this$props.positionFixed,\n offset = _this$props.offset,\n fade = _this$props.fade,\n flip = _this$props.flip,\n children = _this$props.children;\n var attributes = omit(this.props, Object.keys(propTypes));\n var popperClasses = mapToCssModules(popperClassName, cssModule);\n var classes = mapToCssModules(innerClassName, cssModule);\n return /*#__PURE__*/React.createElement(PopperContent, {\n className: className,\n target: target,\n isOpen: isOpen,\n hideArrow: hideArrow,\n boundariesElement: boundariesElement,\n placement: placement,\n placementPrefix: placementPrefix,\n arrowClassName: arrowClassName,\n popperClassName: popperClasses,\n container: container,\n modifiers: modifiers,\n positionFixed: positionFixed,\n offset: offset,\n cssModule: cssModule,\n fade: fade,\n flip: flip\n }, function (_ref) {\n var scheduleUpdate = _ref.scheduleUpdate;\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, attributes, {\n ref: _this2.getRef,\n className: classes,\n role: \"tooltip\",\n onMouseOver: _this2.onMouseOverTooltipContent,\n onMouseLeave: _this2.onMouseLeaveTooltipContent,\n onKeyDown: _this2.onEscKeyDown\n }), typeof children === 'function' ? children({\n scheduleUpdate: scheduleUpdate\n }) : children);\n });\n };\n\n return TooltipPopoverWrapper;\n}(React.Component);\n\nTooltipPopoverWrapper.propTypes = propTypes;\nTooltipPopoverWrapper.defaultProps = defaultProps;\nexport default TooltipPopoverWrapper;"]},"metadata":{},"sourceType":"module"} |