{"version":3,"file":"tooltip.js","sources":["../../popper/src/utils/isFunction.js","../src/index.js"],"sourcesContent":["/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nexport default function isFunction(functionToCheck) {\n const getType = {};\n return (\n functionToCheck &&\n getType.toString.call(functionToCheck) === '[object Function]'\n );\n}\n","import Popper from 'popper.js';\nimport isFunction from '../../popper/src/utils/isFunction';\n\nconst DEFAULT_OPTIONS = {\n container: false,\n delay: 0,\n html: false,\n placement: 'top',\n title: '',\n template:\n '
',\n trigger: 'hover focus',\n offset: 0,\n arrowSelector: '.tooltip-arrow, .tooltip__arrow',\n innerSelector: '.tooltip-inner, .tooltip__inner',\n};\n\nexport default class Tooltip {\n /**\n * Create a new Tooltip.js instance\n * @class Tooltip\n * @param {HTMLElement} reference - The DOM node used as reference of the tooltip (it can be a jQuery element).\n * @param {Object} options\n * @param {String} options.placement='top'\n * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -end),\n * left(-start, -end)`\n * @param {String} options.arrowSelector='.tooltip-arrow, .tooltip__arrow' - className used to locate the DOM arrow element in the tooltip.\n * @param {String} options.innerSelector='.tooltip-inner, .tooltip__inner' - className used to locate the DOM inner element in the tooltip.\n * @param {HTMLElement|String|false} options.container=false - Append the tooltip to a specific element.\n * @param {Number|Object} options.delay=0\n * Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type.\n * If a number is supplied, delay is applied to both hide/show.\n * Object structure is: `{ show: 500, hide: 100 }`\n * @param {Boolean} options.html=false - Insert HTML into the tooltip. If false, the content will inserted with `textContent`.\n * @param {String} [options.template='
']\n * Base HTML to used when creating the tooltip.\n * The tooltip's `title` will be injected into the `.tooltip-inner` or `.tooltip__inner`.\n * `.tooltip-arrow` or `.tooltip__arrow` will become the tooltip's arrow.\n * The outermost wrapper element should have the `.tooltip` class.\n * @param {String|HTMLElement|TitleFunction} options.title='' - Default title value if `title` attribute isn't present.\n * @param {String} [options.trigger='hover focus']\n * How tooltip is triggered - click, hover, focus, manual.\n * You may pass multiple triggers; separate them with a space. `manual` cannot be combined with any other trigger.\n * @param {Boolean} options.closeOnClickOutside=false - Close a popper on click outside of the popper and reference element. This has effect only when options.trigger is 'click'.\n * @param {String|HTMLElement} options.boundariesElement\n * The element used as boundaries for the tooltip. For more information refer to Popper.js'\n * [boundariesElement docs](https://popper.js.org/popper-documentation.html)\n * @param {Number|String} options.offset=0 - Offset of the tooltip relative to its reference. For more information refer to Popper.js'\n * [offset docs](https://popper.js.org/popper-documentation.html)\n * @param {Object} options.popperOptions={} - Popper options, will be passed directly to popper instance. For more information refer to Popper.js'\n * [options docs](https://popper.js.org/popper-documentation.html)\n * @return {Object} instance - The generated tooltip instance\n */\n constructor(reference, options) {\n // apply user options over default ones\n options = { ...DEFAULT_OPTIONS, ...options };\n\n reference.jquery && (reference = reference[0]);\n\n // cache reference and options\n this.reference = reference;\n this.options = options;\n\n // get events list\n const events =\n typeof options.trigger === 'string'\n ? options.trigger\n .split(' ')\n .filter(\n trigger => ['click', 'hover', 'focus'].indexOf(trigger) !== -1\n )\n : [];\n\n // set initial state\n this._isOpen = false;\n this._popperOptions = {};\n\n // set event listeners\n this._setEventListeners(reference, events, options);\n }\n\n //\n // Public methods\n //\n\n /**\n * Reveals an element's tooltip. This is considered a \"manual\" triggering of the tooltip.\n * Tooltips with zero-length titles are never displayed.\n * @method Tooltip#show\n * @memberof Tooltip\n */\n show = () => this._show(this.reference, this.options);\n\n /**\n * Hides an element’s tooltip. This is considered a “manual” triggering of the tooltip.\n * @method Tooltip#hide\n * @memberof Tooltip\n */\n hide = () => this._hide();\n\n /**\n * Hides and destroys an element’s tooltip.\n * @method Tooltip#dispose\n * @memberof Tooltip\n */\n dispose = () => this._dispose();\n\n /**\n * Toggles an element’s tooltip. This is considered a “manual” triggering of the tooltip.\n * @method Tooltip#toggle\n * @memberof Tooltip\n */\n toggle = () => {\n if (this._isOpen) {\n return this.hide();\n } else {\n return this.show();\n }\n };\n\n /**\n * Updates the tooltip's title content\n * @method Tooltip#updateTitleContent\n * @memberof Tooltip\n * @param {String|HTMLElement} title - The new content to use for the title\n */\n updateTitleContent = (title) => this._updateTitleContent(title);\n\n //\n // Private methods\n //\n\n _events = [];\n\n /**\n * Creates a new tooltip node\n * @memberof Tooltip\n * @private\n * @param {HTMLElement} reference\n * @param {String} template\n * @param {String|HTMLElement|TitleFunction} title\n * @param {Boolean} allowHtml\n * @return {HTMLElement} tooltipNode\n */\n _create(reference, template, title, allowHtml) {\n // create tooltip element\n const tooltipGenerator = window.document.createElement('div');\n tooltipGenerator.innerHTML = template.trim();\n const tooltipNode = tooltipGenerator.childNodes[0];\n\n // add unique ID to our tooltip (needed for accessibility reasons)\n tooltipNode.id = `tooltip_${Math.random()\n .toString(36)\n .substr(2, 10)}`;\n\n // set initial `aria-hidden` state to `false` (it's visible!)\n tooltipNode.setAttribute('aria-hidden', 'false');\n\n // add title to tooltip\n const titleNode = tooltipGenerator.querySelector(this.options.innerSelector);\n this._addTitleContent(reference, title, allowHtml, titleNode);\n\n // return the generated tooltip node\n return tooltipNode;\n }\n\n _addTitleContent(reference, title, allowHtml, titleNode) {\n if (title.nodeType === 1 || title.nodeType === 11) {\n // if title is a element node or document fragment, append it only if allowHtml is true\n allowHtml && titleNode.appendChild(title);\n } else if (isFunction(title)) {\n // if title is a function, call it and set textContent or innerHtml depending by `allowHtml` value\n const titleText = title.call(reference);\n allowHtml\n ? (titleNode.innerHTML = titleText)\n : (titleNode.textContent = titleText);\n } else {\n // if it's just a simple text, set textContent or innerHtml depending by `allowHtml` value\n allowHtml ? (titleNode.innerHTML = title) : (titleNode.textContent = title);\n }\n }\n\n _show(reference, options) {\n // don't show if it's already visible\n // or if it's not being showed\n if (this._isOpen && !this._isOpening) {\n return this;\n }\n this._isOpen = true;\n\n // if the tooltipNode already exists, just show it\n if (this._tooltipNode) {\n this._tooltipNode.style.visibility = 'visible';\n this._tooltipNode.setAttribute('aria-hidden', 'false');\n this.popperInstance.update();\n return this;\n }\n\n // get title\n const title = reference.getAttribute('title') || options.title;\n\n // don't show tooltip if no title is defined\n if (!title) {\n return this;\n }\n\n // create tooltip node\n const tooltipNode = this._create(\n reference,\n options.template,\n title,\n options.html\n );\n\n // Add `aria-describedby` to our reference element for accessibility reasons\n reference.setAttribute('aria-describedby', tooltipNode.id);\n\n // append tooltip to container\n const container = this._findContainer(options.container, reference);\n\n this._append(tooltipNode, container);\n\n this._popperOptions = {\n ...options.popperOptions,\n placement: options.placement,\n };\n\n this._popperOptions.modifiers = {\n ...this._popperOptions.modifiers,\n arrow: {\n element: this.options.arrowSelector,\n },\n offset: {\n offset: options.offset,\n },\n };\n\n if (options.boundariesElement) {\n this._popperOptions.modifiers.preventOverflow = {\n boundariesElement: options.boundariesElement,\n };\n }\n\n this.popperInstance = new Popper(\n reference,\n tooltipNode,\n this._popperOptions\n );\n\n this._tooltipNode = tooltipNode;\n\n return this;\n }\n\n _hide(/*reference, options*/) {\n // don't hide if it's already hidden\n if (!this._isOpen) {\n return this;\n }\n\n this._isOpen = false;\n\n // hide tooltipNode\n this._tooltipNode.style.visibility = 'hidden';\n this._tooltipNode.setAttribute('aria-hidden', 'true');\n\n return this;\n }\n\n _dispose() {\n // remove event listeners first to prevent any unexpected behaviour\n this._events.forEach(({ func, event }) => {\n this.reference.removeEventListener(event, func);\n });\n this._events = [];\n\n if (this._tooltipNode) {\n this._hide();\n\n // destroy instance\n this.popperInstance.destroy();\n\n // destroy tooltipNode if removeOnDestroy is not set, as popperInstance.destroy() already removes the element\n if (!this.popperInstance.options.removeOnDestroy) {\n this._tooltipNode.parentNode.removeChild(this._tooltipNode);\n this._tooltipNode = null;\n }\n }\n return this;\n }\n\n _findContainer(container, reference) {\n // if container is a query, get the relative element\n if (typeof container === 'string') {\n container = window.document.querySelector(container);\n } else if (container === false) {\n // if container is `false`, set it to reference parent\n container = reference.parentNode;\n }\n return container;\n }\n\n /**\n * Append tooltip to container\n * @memberof Tooltip\n * @private\n * @param {HTMLElement} tooltipNode\n * @param {HTMLElement|String|false} container\n */\n _append(tooltipNode, container) {\n container.appendChild(tooltipNode);\n }\n\n _setEventListeners(reference, events, options) {\n const directEvents = [];\n const oppositeEvents = [];\n\n events.forEach(event => {\n switch (event) {\n case 'hover':\n directEvents.push('mouseenter');\n oppositeEvents.push('mouseleave');\n break;\n case 'focus':\n directEvents.push('focus');\n oppositeEvents.push('blur');\n break;\n case 'click':\n directEvents.push('click');\n oppositeEvents.push('click');\n break;\n }\n });\n\n // schedule show tooltip\n directEvents.forEach(event => {\n const func = evt => {\n if (this._isOpening === true) {\n return;\n }\n evt.usedByTooltip = true;\n this._scheduleShow(reference, options.delay, options, evt);\n };\n this._events.push({ event, func });\n reference.addEventListener(event, func);\n });\n\n // schedule hide tooltip\n oppositeEvents.forEach(event => {\n const func = evt => {\n if (evt.usedByTooltip === true) {\n return;\n }\n this._scheduleHide(reference, options.delay, options, evt);\n };\n this._events.push({ event, func });\n reference.addEventListener(event, func);\n if (event === 'click' && options.closeOnClickOutside) {\n document.addEventListener('mousedown', e => {\n if (!this._isOpening) {\n return;\n }\n const popper = this.popperInstance.popper;\n if (reference.contains(e.target) ||\n popper.contains(e.target)) {\n return;\n }\n func(e);\n }, true);\n }\n });\n }\n\n _scheduleShow(reference, delay, options /*, evt */) {\n this._isOpening = true;\n // defaults to 0\n const computedDelay = (delay && delay.show) || delay || 0;\n this._showTimeout = window.setTimeout(\n () => this._show(reference, options),\n computedDelay\n );\n }\n\n _scheduleHide(reference, delay, options, evt) {\n this._isOpening = false;\n // defaults to 0\n const computedDelay = (delay && delay.hide) || delay || 0;\n window.setTimeout(() => {\n window.clearTimeout(this._showTimeout);\n if (this._isOpen === false) {\n return;\n }\n if (!document.body.contains(this._tooltipNode)) {\n return;\n }\n\n // if we are hiding because of a mouseleave, we must check that the new\n // reference isn't the tooltip, because in this case we don't want to hide it\n if (evt.type === 'mouseleave') {\n const isSet = this._setTooltipNodeEvent(evt, reference, delay, options);\n\n // if we set the new event, don't hide the tooltip yet\n // the new event will take care to hide it if necessary\n if (isSet) {\n return;\n }\n }\n\n this._hide(reference, options);\n }, computedDelay);\n }\n\n _setTooltipNodeEvent = (evt, reference, delay, options) => {\n const relatedreference =\n evt.relatedreference || evt.toElement || evt.relatedTarget;\n\n const callback = evt2 => {\n const relatedreference2 =\n evt2.relatedreference || evt2.toElement || evt2.relatedTarget;\n\n // Remove event listener after call\n this._tooltipNode.removeEventListener(evt.type, callback);\n\n // If the new reference is not the reference element\n if (!reference.contains(relatedreference2)) {\n // Schedule to hide tooltip\n this._scheduleHide(reference, options.delay, options, evt2);\n }\n };\n\n if (this._tooltipNode.contains(relatedreference)) {\n // listen to mouseleave on the tooltip element to be able to hide the tooltip\n this._tooltipNode.addEventListener(evt.type, callback);\n return true;\n }\n\n return false;\n };\n\n _updateTitleContent(title) {\n if(typeof this._tooltipNode === 'undefined') {\n if(typeof this.options.title !== 'undefined') {\n this.options.title = title;\n }\n return;\n }\n const titleNode = this._tooltipNode.parentNode.querySelector(this.options.innerSelector);\n this._clearTitleContent(titleNode, this.options.html, this.reference.getAttribute('title') || this.options.title)\n this._addTitleContent(this.reference, title, this.options.html, titleNode);\n this.options.title = title;\n this.popperInstance.update();\n }\n\n _clearTitleContent(titleNode, allowHtml, lastTitle) {\n if(lastTitle.nodeType === 1 || lastTitle.nodeType === 11) {\n allowHtml && titleNode.removeChild(lastTitle);\n } else {\n allowHtml ? titleNode.innerHTML = '' : titleNode.textContent = '';\n }\n }\n\n}\n\n/**\n * Title function, its context is the Tooltip instance.\n * @memberof Tooltip\n * @callback TitleFunction\n * @return {String} placement - The desired title.\n */\n"],"names":["isFunction","functionToCheck","getType","toString","call","DEFAULT_OPTIONS","Tooltip","reference","options","jquery","events","trigger","split","filter","indexOf","_isOpen","_popperOptions","_setEventListeners","template","title","allowHtml","tooltipGenerator","window","document","createElement","innerHTML","trim","tooltipNode","childNodes","id","Math","random","substr","setAttribute","titleNode","querySelector","innerSelector","_addTitleContent","nodeType","appendChild","titleText","textContent","_isOpening","_tooltipNode","style","visibility","popperInstance","update","getAttribute","_create","html","container","_findContainer","_append","popperOptions","placement","modifiers","arrowSelector","offset","boundariesElement","preventOverflow","Popper","_events","forEach","func","event","removeEventListener","_hide","destroy","removeOnDestroy","parentNode","removeChild","directEvents","oppositeEvents","push","evt","usedByTooltip","_scheduleShow","delay","addEventListener","_scheduleHide","closeOnClickOutside","e","popper","contains","target","computedDelay","show","_showTimeout","setTimeout","_show","hide","clearTimeout","body","type","isSet","_setTooltipNodeEvent","_clearTitleContent","lastTitle","dispose","_dispose","toggle","updateTitleContent","_updateTitleContent","relatedreference","toElement","relatedTarget","callback","evt2","relatedreference2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAOA,AAAe,SAASA,UAAT,CAAoBC,eAApB,EAAqC;QAC5CC,UAAU,EAAhB;SAEED,mBACAC,QAAQC,QAAR,CAAiBC,IAAjB,CAAsBH,eAAtB,MAA2C,mBAF7C;;;;;;;;;;;;;;;;;ACNF,MAAMI,kBAAkB;aACX,KADW;SAEf,CAFe;QAGhB,KAHgB;aAIX,KAJW;SAKf,EALe;YAOpB,8GAPoB;WAQb,aARa;UASd,CATc;iBAUP,iCAVO;iBAWP;CAXjB;;AAcA,AAAe,MAAMC,OAAN,CAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCfC,SAAZ,EAAuBC,OAAvB,EAAgC;;;;2BAEfH,eAAf,EAAmCG,OAAnC;;cAEUC,MAAV,KAAqBF,YAAYA,UAAU,CAAV,CAAjC;;;SAGKA,SAAL,GAAiBA,SAAjB;SACKC,OAAL,GAAeA,OAAf;;;UAGME,SACJ,OAAOF,QAAQG,OAAf,KAA2B,QAA3B,GACIH,QAAQG,OAAR,CACGC,KADH,CACS,GADT,EAEGC,MAFH,CAGIF,WAAW,CAAC,OAAD,EAAU,OAAV,EAAmB,OAAnB,EAA4BG,O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