Tooltip.js/build/tooltip.js

4 lines
11 KiB
JavaScript
Raw Permalink Normal View History

2024-10-03 15:46:55 -05:00
var C=(O,q)=>()=>(q||O((q={exports:{}}).exports,q),q.exports);var w=C((A,H)=>{H.exports={options:{html:!1,placement:"top",container:"body",scrollContainer:window,template:'<div class="tooltip" data-tooltip-target="tooltip"></div>',removalDelay:200,tooltipOffset:10,windowPadding:{top:10,right:10,bottom:10,left:10}},init:function O(q){var z=this;document.documentElement.scrollTop=1,this.documentElement=document.documentElement.scrollTop===1?document.documentElement:document.body;var J=document.createElement("div");if(J.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',this.innerHTMLBug=!J.getElementsByTagName("link").length,J=void 0,"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch)document.body.style.cursor="pointer";if(this.map={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],defaultTag:this.innerHTMLBug?[1,"X<div>","</div>"]:[0,"",""]},this.map.td=this.map.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],this.map.option=this.map.optgroup=[1,'<select multiple="multiple">',"</select>"],this.map.thead=this.map.tbody=this.map.colgroup=this.map.caption=this.map.tfoot=[1,"<table>","</table>"],this.map.text=this.map.circle=this.map.ellipse=this.map.line=this.map.path=this.map.polygon=this.map.polyline=this.map.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"],q instanceof Object){for(var D in q)if(window.Object.hasOwnProperty.call(q,D)&&window.Object.hasOwnProperty.call(this.options,D))if(typeof q[D]==="object"&&!Array.isArray(q[D])){for(var F in q[D])if(window.Object.hasOwnProperty.call(q[D],F)&&window.Object.hasOwnProperty.call(this.options[D],F))this.options[D][F]=q[D][F]}else this.options[D]=q[D]}function S(I){if(!I)I=window.event;var G=I.target||I.srcElement;if(z.currentTooltip&&z.currentTooltip.getAttribute("data-autoclose")==="false")return;else if(z.currentTooltip)if(G===z.currentTooltip)return;else if(G===z.currentTrigger){z.close(z.currentTooltip);return}else{if(z.hasParent(G,z.currentTooltip))return!1;z.close(z.currentTooltip)}if(!z.hasClass(G,"tooltip-click"))return;z.open(G)}function K(I){if(!I)I=window.event;var G=I.target||I.srcElement;if(!z.hasClass(G,"tooltip-hover"))return;if(z.currentTooltip&&z.currentTooltip.getAttribute("data-autoclose")==="false")return;else if(z.currentTooltip)if(G===z.currentTooltip)return;else{if(z.hasParent(G,z.currentTooltip))return!1;z.close(z.currentTooltip)}function Q(Z){if(!Z)Z=window.event;var V=I.target||I.srcElement;if(z.hasClass(V))return;if(z.currentTooltip&&z.currentTooltip.getAttribute("data-autoclose")==="false")return;z.close(z.currentTooltip),z.removeEventListener(G,"mouseout",Q);return}z.open(G),z.addEventListener(G,"mouseout",Q);return}function U(I){if(!I)I=window.event;var G=I.target||I.srcElement;if(!z.hasClass(G,"tooltip-focus"))return;if(z.currentTooltip&&z.currentTooltip.getAttribute("data-autoclose")==="false")return;else if(z.currentTooltip)z.close(z.currentTooltip);function Q(){if(z.currentTooltip&&z.currentTooltip.getAttribute("data-autoclose")==="false")return;z.close(z.currentTooltip),z.removeEventListener(G,"blur",Q);return}z.open(G),z.addEventListener(G,"blur",Q);return}this.windowChangeHandler=function I(){if(z.currentTooltip&&z.currentTrigger)z.positionTooltip(z.currentTooltip,z.currentTrigger);return},this.addEventListener(document.body,"click",S),this.addEventListener(document.body,"mouseover",K),this.addEventListener(document.body,"focus",U,!0),this.addEventListener(window,"scroll",this.windowChangeHandler),this.addEventListener(window,"resize",this.windowChangeHandler)},open:function O(q,z){if(typeof q==="string")q=document.body.querySelector(q);if(!z)z={};var J=z.className||q.getAttribute("data-tooltip-classname"),D=z.content||q.getAttribute("data-tooltip-content"),F=z.title||q.getAttribute("data-tooltip-title"),S=z.html||q.getAttribute("data-tooltip-html"),K=z.placement||q.getAttribute("data-tooltip-placement"),U=z.container||q.getAttribute("data-tooltip-co
//# debugId=9835718B3D42F23F64756E2164756E21