2 lines
37 KiB
JavaScript
2 lines
37 KiB
JavaScript
|
(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.tippy=t()})(this,function(){'use strict';function t(e){return'[object Object]'===Object.prototype.toString.call(e)}function o(e){return[].slice.call(e)}function r(e){if(e instanceof Element||t(e))return[e];if(e instanceof NodeList)return o(e);if(Array.isArray(e))return e;try{return o(document.querySelectorAll(e))}catch(e){return[]}}function n(e){for(var t=[!1,'webkit'],o=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var i=t[r],n=i?''+i+o:e;if('undefined'!=typeof document.body.style[n])return n}return null}function a(e,t,o){var i=o.arrow,r=o.arrowType,a=o.arrowTransform,s=o.animateFill,p=o.inertia,l=o.animation,d=o.size,c=o.theme,f=o.html,m=o.zIndex,u=o.interactive,h=o.maxWidth,g=document.createElement('div');g.setAttribute('class','tippy-popper'),g.setAttribute('role','tooltip'),g.setAttribute('id','tippy-'+e),g.style.zIndex=m,g.style.maxWidth=h;var b=document.createElement('div');if(b.setAttribute('class','tippy-tooltip'),b.setAttribute('data-size',d),b.setAttribute('data-animation',l),b.setAttribute('data-state','hidden'),c.split(' ').forEach(function(e){b.classList.add(e+'-theme')}),i){var y=document.createElement('div');y.style[n('transform')]=a,'round'===r?(y.classList.add('tippy-roundarrow'),y.innerHTML='<svg viewBox="0 0 24 8" xmlns="http://www.w3.org/2000/svg"><path d="M1 8s4.577-.019 7.253-4.218c2.357-3.698 5.175-3.721 7.508 0C18.404 7.997 23 8 23 8H1z"/></svg>'):y.classList.add('tippy-arrow'),b.appendChild(y)}if(s){b.setAttribute('data-animatefill','');var v=document.createElement('div');v.setAttribute('data-state','hidden'),v.classList.add('tippy-backdrop'),b.appendChild(v)}p&&b.setAttribute('data-inertia',''),u&&b.setAttribute('data-interactive','');var w=document.createElement('div');if(w.setAttribute('class','tippy-content'),f){var E;f instanceof Element?(w.appendChild(f),E='#'+f.id||'tippy-html-template'):(w.innerHTML=document.querySelector(f).innerHTML,E=f),g.setAttribute('data-html',''),u&&g.setAttribute('tabindex','-1'),b.setAttribute('data-template-id',E)}else w.innerHTML=t;return b.appendChild(w),g.appendChild(b),g}function s(e,t,o,i){var r=o.handleTrigger,n=o.handleMouseLeave,a=o.handleBlur,s=o.handleDelegateShow,p=o.handleDelegateHide,l=[];if('manual'===e)return l;var d=function(e,o){t.addEventListener(e,o),l.push({event:e,handler:o})};return i.target?(Ue.supportsTouch&&i.touchHold&&(d('touchstart',s),d('touchend',p)),'mouseenter'===e&&(d('mouseover',s),d('mouseout',p)),'focus'===e&&(d('focusin',s),d('focusout',p)),'click'===e&&d('click',s)):(d(e,r),Ue.supportsTouch&&i.touchHold&&(d('touchstart',r),d('touchend',n)),'mouseenter'===e&&d('mouseleave',n),'focus'===e&&d(Be?'focusout':'blur',a)),l}function p(e,t){var o=Fe.reduce(function(o,i){var r=e.getAttribute('data-tippy-'+i.toLowerCase())||t[i];return'false'===r&&(r=!1),'true'===r&&(r=!0),isFinite(r)&&!isNaN(parseFloat(r))&&(r=parseFloat(r)),'target'!==i&&'string'==typeof r&&'['===r.trim().charAt(0)&&(r=JSON.parse(r)),o[i]=r,o},{});return Xe({},t,o)}function l(e,t){return t.arrow&&(t.animateFill=!1),t.appendTo&&'function'==typeof t.appendTo&&(t.appendTo=t.appendTo()),'function'==typeof t.html&&(t.html=t.html(e)),t}function d(e){return{tooltip:e.querySelector(qe.TOOLTIP),backdrop:e.querySelector(qe.BACKDROP),content:e.querySelector(qe.CONTENT)}}function c(e){var t=e.getAttribute('title');t&&e.setAttribute('data-original-title',t),e.removeAttribute('title')}function f(e){return e&&'[object Function]'==={}.toString.call(e)}function m(e,t){if(1!==e.nodeType)return[];var o=getComputedStyle(e,null);return t?o[t]:o}function u(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function h(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var t=m(e),o=t.overflow,i=t.overflowX,r=t.overflowY;return /(auto|scroll)/.test(o+r+i)?e:h(u(e))}function g(e){var t=e&&e.offsetParent,o=t&&t.nodeName;return o&&'BODY'!==o&&'HTML'!==o?-1!==['TD','TAB
|