@substrate-system/tool-tip 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,5 +1,5 @@
1
- var b=Object.defineProperty;var p=(g,t)=>b(g,"name",{value:t,configurable:!0});var u=class extends HTMLElement{static{p(this,"ToolTip")}static observedAttributes=["content","placement","disabled","open","distance","skidding"];popup=null;arrow=null;target=null;_open=!1;_disabled=!1;get content(){return this.getAttribute("content")||""}set content(t){this.setAttribute("content",t)}get placement(){return this.getAttribute("placement")||"top"}set placement(t){this.setAttribute("placement",t)}get trigger(){return(this.getAttribute("trigger")||"hover focus").split(" ").filter(Boolean)}set trigger(t){Array.isArray(t)?this.setAttribute("trigger",t.join(" ")):this.setAttribute("trigger",t)}get disabled(){return this._disabled}set disabled(t){this._disabled=t,t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get open(){return this._open}set open(t){if(this._disabled)return;let e=this._open;this._open=t,t&&!e?this.showTooltip():!t&&e&&this.hideTooltip()}get distance(){return parseInt(this.getAttribute("distance")||"8",10)}set distance(t){this.setAttribute("distance",String(t))}get skidding(){return parseInt(this.getAttribute("skidding")||"0",10)}set skidding(t){this.setAttribute("skidding",String(t))}get hoist(){return this.hasAttribute("hoist")}set hoist(t){t?this.setAttribute("hoist",""):this.removeAttribute("hoist")}connectedCallback(){if(this.style.display="contents",this.target=this.firstElementChild,!this.target){console.warn("tool-tip: No target element found. Add a child element.");return}this.createPopup(),this.bindEvents(),this.hasAttribute("open")&&(this._open=!0,this.showTooltip())}disconnectedCallback(){this.unbindEvents(),this.popup?.remove()}attributeChangedCallback(t,e,i){if(t==="content"&&this.popup){let s=this.popup.querySelector(".tool-tip__body");s&&(s.textContent=i||"")}t==="placement"&&this._open&&this.positionPopup(),t==="disabled"&&(this._disabled=i!==null,this._disabled&&this._open&&this.hide()),t==="open"&&(this.open=i!==null),(t==="distance"||t==="skidding")&&this._open&&this.positionPopup()}createPopup(){this.popup=document.createElement("div"),this.popup.className="tool-tip__popup",this.popup.setAttribute("role","tooltip"),this.popup.setAttribute("aria-hidden","true"),this.popup.innerHTML=`
2
- <div class="tool-tip__body">${this.content}</div>
3
- <div class="tool-tip__arrow"></div>
4
- `,this.arrow=this.popup.querySelector(".tool-tip__arrow"),this.hoist?document.body.appendChild(this.popup):this.appendChild(this.popup)}bindEvents(){if(!this.target)return;let t=this.trigger;t.includes("hover")&&(this.target.addEventListener("mouseenter",this.handleMouseEnter),this.target.addEventListener("mouseleave",this.handleMouseLeave)),t.includes("focus")&&(this.target.addEventListener("focus",this.handleFocus),this.target.addEventListener("blur",this.handleBlur)),t.includes("click")&&this.target.addEventListener("click",this.handleClick),this.target.addEventListener("keydown",this.handleKeyDown)}unbindEvents(){this.target&&(this.target.removeEventListener("mouseenter",this.handleMouseEnter),this.target.removeEventListener("mouseleave",this.handleMouseLeave),this.target.removeEventListener("focus",this.handleFocus),this.target.removeEventListener("blur",this.handleBlur),this.target.removeEventListener("click",this.handleClick),this.target.removeEventListener("keydown",this.handleKeyDown))}handleMouseEnter=p(()=>{this.show()},"handleMouseEnter");handleMouseLeave=p(()=>{this.hide()},"handleMouseLeave");handleFocus=p(()=>{this.show()},"handleFocus");handleBlur=p(()=>{this.hide()},"handleBlur");handleClick=p(()=>{this._open?this.hide():this.show()},"handleClick");handleKeyDown=p(t=>{t.key==="Escape"&&this._open&&this.hide()},"handleKeyDown");showTooltip(){if(!this.popup||this._disabled)return;let t=new CustomEvent("tool-tip-show",{bubbles:!0,cancelable:!0});this.dispatchEvent(t)&&(this.popup.classList.add("tool-tip__popup--visible"),this.popup.setAttribute("aria-hidden","false"),this.positionPopup(),this.dispatchEvent(new CustomEvent("tool-tip-after-show",{bubbles:!0})))}hideTooltip(){if(!this.popup)return;let t=new CustomEvent("tool-tip-hide",{bubbles:!0,cancelable:!0});this.dispatchEvent(t)&&(this.popup.classList.remove("tool-tip__popup--visible"),this.popup.setAttribute("aria-hidden","true"),this.dispatchEvent(new CustomEvent("tool-tip-after-hide",{bubbles:!0})))}positionPopup(){if(!this.popup||!this.target)return;let t=this.target.getBoundingClientRect(),e=this.popup.getBoundingClientRect(),i=8,s=0,a=0,o="",n="",r="",h=this.distance,l=this.skidding,d=this.getOptimalPlacement(t,e);switch(this.popup.dataset.placement=d,d){case"top":s=t.top-e.height-h-i,a=t.left+t.width/2-e.width/2+l,o="100%",n="50%",r="translateX(-50%)";break;case"top-start":s=t.top-e.height-h-i,a=t.left+l,o="100%",n=`${Math.min(24,e.width/2)}px`,r="translateX(-50%)";break;case"top-end":s=t.top-e.height-h-i,a=t.right-e.width+l,o="100%",n=`calc(100% - ${Math.min(24,e.width/2)}px)`,r="translateX(-50%)";break;case"bottom":s=t.bottom+h+i,a=t.left+t.width/2-e.width/2+l,o="0",n="50%",r="translateX(-50%) translateY(-100%)";break;case"bottom-start":s=t.bottom+h+i,a=t.left+l,o="0",n=`${Math.min(24,e.width/2)}px`,r="translateX(-50%) translateY(-100%)";break;case"bottom-end":s=t.bottom+h+i,a=t.right-e.width+l,o="0",n=`calc(100% - ${Math.min(24,e.width/2)}px)`,r="translateX(-50%) translateY(-100%)";break;case"left":s=t.top+t.height/2-e.height/2+l,a=t.left-e.width-h-i,o="50%",n="100%",r="translateY(-50%)";break;case"left-start":s=t.top+l,a=t.left-e.width-h-i,o=`${Math.min(16,e.height/2)}px`,n="100%",r="translateY(-50%)";break;case"left-end":s=t.bottom-e.height+l,a=t.left-e.width-h-i,o=`calc(100% - ${Math.min(16,e.height/2)}px)`,n="100%",r="translateY(-50%)";break;case"right":s=t.top+t.height/2-e.height/2+l,a=t.right+h+i,o="50%",n="0",r="translateY(-50%) translateX(-100%)";break;case"right-start":s=t.top+l,a=t.right+h+i,o=`${Math.min(16,e.height/2)}px`,n="0",r="translateY(-50%) translateX(-100%)";break;case"right-end":s=t.bottom-e.height+l,a=t.right+h+i,o=`calc(100% - ${Math.min(16,e.height/2)}px)`,n="0",r="translateY(-50%) translateX(-100%)";break}this.hoist&&(s+=window.scrollY,a+=window.scrollX),this.popup.style.top=`${s}px`,this.popup.style.left=`${a}px`,this.arrow&&(this.arrow.style.top=o,this.arrow.style.left=n,this.arrow.style.transform=r)}getOptimalPlacement(t,e){let i=this.placement,s=window.innerWidth,a=window.innerHeight,o=this.distance,n=8,r={top:t.top-e.height-o-n>0,bottom:t.bottom+e.height+o+n<a,left:t.left-e.width-o-n>0,right:t.right+e.width+o+n<s},h=i.split("-")[0];if(r[h])return i;let d={top:"bottom",bottom:"top",left:"right",right:"left"}[h];if(r[d]){let c=i.includes("-")?i.split("-")[1]:"";return c?`${d}-${c}`:d}for(let c of["top","bottom","left","right"])if(r[c])return c;return i}show(){this._disabled||(this.open=!0)}hide(){this.open=!1}};"customElements"in window&&customElements.define("tool-tip",u);export{u as ToolTip};
1
+ var w=Object.defineProperty;var l=(p,t)=>w(p,"name",{value:t,configurable:!0});var E=Object.defineProperty,y=l((p,t)=>E(p,"name",{value:t,configurable:!0}),"__name");function f(p){return Object.keys(p).reduce((t,e)=>{let i=p[e];return i?typeof i=="boolean"?i?(t+` ${e}`).trim():t:Array.isArray(i)?t+` ${e}="${i.join(" ")}"`:(t+` ${e}="${i}"`).trim():t},"")}l(f,"toAttributes");y(f,"toAttributes");var k=Object.defineProperty,m=l((p,t)=>k(p,"name",{value:t,configurable:!0}),"__name");function v(p){return document.createElement(p).constructor!==window.HTMLElement}l(v,"isRegistered");m(v,"isRegistered");function b(p,t){window&&"customElements"in window&&(v(p)||window.customElements.define(p,t))}l(b,"define");m(b,"define");var T=document.querySelector.bind(document),P=document.querySelectorAll.bind(document);var g=class extends HTMLElement{static{l(this,"ToolTip")}static observedAttributes=["content","placement","disabled","open","distance","skidding"];popup=null;arrow=null;target=null;_open=!1;_disabled=!1;get content(){return this.getAttribute("content")||""}set content(t){this.setAttribute("content",t)}get placement(){return this.getAttribute("placement")||"top"}set placement(t){this.setAttribute("placement",t)}get trigger(){return(this.getAttribute("trigger")||"hover focus").split(" ").filter(Boolean)}set trigger(t){Array.isArray(t)?this.setAttribute("trigger",t.join(" ")):this.setAttribute("trigger",t)}get disabled(){return this._disabled}set disabled(t){this._disabled=t,t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get open(){return this._open}set open(t){if(this._disabled)return;let e=this._open;this._open=t,t&&!e?this.showTooltip():!t&&e&&this.hideTooltip()}get distance(){return parseInt(this.getAttribute("distance")||"8",10)}set distance(t){this.setAttribute("distance",String(t))}get skidding(){return parseInt(this.getAttribute("skidding")||"0",10)}set skidding(t){this.setAttribute("skidding",String(t))}get hoist(){return this.hasAttribute("hoist")}set hoist(t){t?this.setAttribute("hoist",""):this.removeAttribute("hoist")}connectedCallback(){if(this.style.display="contents",this.target=this.firstElementChild,!this.target){console.warn("tool-tip: No target element found. Add a child element.");return}this.createPopup(),this.bindEvents(),this.hasAttribute("open")&&(this._open=!0,this.showTooltip())}disconnectedCallback(){this.unbindEvents(),this.popup?.remove()}attributeChangedCallback(t,e,i){if(t==="content"&&this.popup){let s=this.popup.querySelector(".body");s&&(s.textContent=i||"")}t==="placement"&&this._open&&this.positionPopup(),t==="disabled"&&(this._disabled=i!==null,this._disabled&&this._open&&this.hide()),t==="open"&&(this.open=i!==null),(t==="distance"||t==="skidding")&&this._open&&this.positionPopup()}createPopup(){this.popup=document.createElement("div"),this.popup.className="popup",this.popup.setAttribute("role","tooltip"),this.popup.setAttribute("aria-hidden","true"),this.popup.innerHTML=`
2
+ <div class="body">${this.content}</div>
3
+ <div class="arrow"></div>
4
+ `,this.arrow=this.popup.querySelector(".arrow"),this.hoist?document.body.appendChild(this.popup):this.appendChild(this.popup)}bindEvents(){if(!this.target)return;let t=this.trigger;t.includes("hover")&&(this.target.addEventListener("mouseenter",this.handleMouseEnter),this.target.addEventListener("mouseleave",this.handleMouseLeave)),t.includes("focus")&&(this.target.addEventListener("focus",this.handleFocus),this.target.addEventListener("blur",this.handleBlur)),t.includes("click")&&this.target.addEventListener("click",this.handleClick),this.target.addEventListener("keydown",this.handleKeyDown)}unbindEvents(){this.target&&(this.target.removeEventListener("mouseenter",this.handleMouseEnter),this.target.removeEventListener("mouseleave",this.handleMouseLeave),this.target.removeEventListener("blur",this.handleBlur),this.target.removeEventListener("click",this.handleClick),this.target.removeEventListener("keydown",this.handleKeyDown))}handleMouseEnter=l(()=>{this.show()},"handleMouseEnter");handleMouseLeave=l(()=>{this.hide()},"handleMouseLeave");handleFocus=l(()=>{this.show()},"handleFocus");handleBlur=l(()=>{this.hide()},"handleBlur");handleClick=l(()=>{this._open?this.hide():this.show()},"handleClick");handleKeyDown=l(t=>{t.key==="Escape"&&this._open&&this.hide()},"handleKeyDown");showTooltip(){if(!this.popup||this._disabled)return;let t=new CustomEvent("tool-tip-show",{bubbles:!0,cancelable:!0});this.dispatchEvent(t)&&(this.popup.classList.add("visible"),this.popup.setAttribute("aria-hidden","false"),this.positionPopup(),this.dispatchEvent(new CustomEvent("tool-tip-after-show",{bubbles:!0})))}hideTooltip(){if(!this.popup)return;let t=new CustomEvent("tool-tip-hide",{bubbles:!0,cancelable:!0});this.dispatchEvent(t)&&(this.popup.classList.remove("visible"),this.popup.setAttribute("aria-hidden","true"),this.dispatchEvent(new CustomEvent("tool-tip-after-hide",{bubbles:!0})))}positionPopup(){if(!this.popup||!this.target)return;let t=this.target.getBoundingClientRect(),e=this.popup.getBoundingClientRect(),i=8,s=0,a=0,r="",n="",o="",h=this.distance,d=this.skidding,u=this.getOptimalPlacement(t,e);switch(this.popup.dataset.placement=u,u){case"top":s=t.top-e.height-h-i,a=t.left+t.width/2-e.width/2+d,r="100%",n="50%",o="translateX(-50%)";break;case"top-start":s=t.top-e.height-h-i,a=t.left+d,r="100%",n=`${Math.min(24,e.width/2)}px`,o="translateX(-50%)";break;case"top-end":s=t.top-e.height-h-i,a=t.right-e.width+d,r="100%",n=`calc(100% - ${Math.min(24,e.width/2)}px)`,o="translateX(-50%)";break;case"bottom":s=t.bottom+h+i,a=t.left+t.width/2-e.width/2+d,r="0",n="50%",o="translateX(-50%) translateY(-100%)";break;case"bottom-start":s=t.bottom+h+i,a=t.left+d,r="0",n=`${Math.min(24,e.width/2)}px`,o="translateX(-50%) translateY(-100%)";break;case"bottom-end":s=t.bottom+h+i,a=t.right-e.width+d,r="0",n=`calc(100% - ${Math.min(24,e.width/2)}px)`,o="translateX(-50%) translateY(-100%)";break;case"left":s=t.top+t.height/2-e.height/2+d,a=t.left-e.width-h-i,r="50%",n="100%",o="translateY(-50%)";break;case"left-start":s=t.top+d,a=t.left-e.width-h-i,r=`${Math.min(16,e.height/2)}px`,n="100%",o="translateY(-50%)";break;case"left-end":s=t.bottom-e.height+d,a=t.left-e.width-h-i,r=`calc(100% - ${Math.min(16,e.height/2)}px)`,n="100%",o="translateY(-50%)";break;case"right":s=t.top+t.height/2-e.height/2+d,a=t.right+h+i,r="50%",n="0",o="translateY(-50%) translateX(-100%)";break;case"right-start":s=t.top+d,a=t.right+h+i,r=`${Math.min(16,e.height/2)}px`,n="0",o="translateY(-50%) translateX(-100%)";break;case"right-end":s=t.bottom-e.height+d,a=t.right+h+i,r=`calc(100% - ${Math.min(16,e.height/2)}px)`,n="0",o="translateY(-50%) translateX(-100%)";break}this.hoist&&(s+=window.scrollY,a+=window.scrollX),this.popup.style.top=`${s}px`,this.popup.style.left=`${a}px`,this.arrow&&(this.arrow.style.top=r,this.arrow.style.left=n,this.arrow.style.transform=o)}getOptimalPlacement(t,e){let i=this.placement,s=window.innerWidth,a=window.innerHeight,r=this.distance,n=8,o={top:t.top-e.height-r-n>0,bottom:t.bottom+e.height+r+n<a,left:t.left-e.width-r-n>0,right:t.right+e.width+r+n<s},h=i.split("-")[0];if(o[h])return i;let u={top:"bottom",bottom:"top",left:"right",right:"left"}[h];if(o[u]){let c=i.includes("-")?i.split("-")[1]:"";return c?`${u}-${c}`:u}for(let c of["top","bottom","left","right"])if(o[c])return c;return i}show(){this._disabled||(this.open=!0)}hide(){this.open=!1}};b("tool-tip",g);export{g as ToolTip};
5
5
  //# sourceMappingURL=index.min.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["// for document.querySelector\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tool-tip':ToolTip\n }\n}\n\nexport type Placement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n\nexport type Trigger = 'hover'|'focus'|'click'|'manual'\n\nexport class ToolTip extends HTMLElement {\n static observedAttributes = ['content', 'placement', 'disabled',\n 'open', 'distance', 'skidding']\n\n private popup: HTMLDivElement | null = null\n private arrow: HTMLDivElement | null = null\n private target: HTMLElement | null = null\n\n private _open = false\n private _disabled = false\n\n get content (): string {\n return this.getAttribute('content') || ''\n }\n\n set content (value: string) {\n this.setAttribute('content', value)\n }\n\n get placement (): Placement {\n return (this.getAttribute('placement') as Placement) || 'top'\n }\n\n set placement (value: Placement) {\n this.setAttribute('placement', value)\n }\n\n get trigger (): Trigger[] {\n const attr = this.getAttribute('trigger') || 'hover focus'\n return attr.split(' ').filter(Boolean) as Trigger[]\n }\n\n set trigger (value: Trigger[] | string) {\n if (Array.isArray(value)) {\n this.setAttribute('trigger', value.join(' '))\n } else {\n this.setAttribute('trigger', value)\n }\n }\n\n get disabled (): boolean {\n return this._disabled\n }\n\n set disabled (value: boolean) {\n this._disabled = value\n if (value) {\n this.setAttribute('disabled', '')\n } else {\n this.removeAttribute('disabled')\n }\n }\n\n get open (): boolean {\n return this._open\n }\n\n set open (value: boolean) {\n if (this._disabled) return\n const wasOpen = this._open\n this._open = value\n\n if (value && !wasOpen) {\n this.showTooltip()\n } else if (!value && wasOpen) {\n this.hideTooltip()\n }\n }\n\n get distance (): number {\n return parseInt(this.getAttribute('distance') || '8', 10)\n }\n\n set distance (value: number) {\n this.setAttribute('distance', String(value))\n }\n\n get skidding (): number {\n return parseInt(this.getAttribute('skidding') || '0', 10)\n }\n\n set skidding (value: number) {\n this.setAttribute('skidding', String(value))\n }\n\n get hoist (): boolean {\n return this.hasAttribute('hoist')\n }\n\n set hoist (value: boolean) {\n if (value) {\n this.setAttribute('hoist', '')\n } else {\n this.removeAttribute('hoist')\n }\n }\n\n connectedCallback () {\n // Use display: contents so the tooltip doesn't affect layout\n this.style.display = 'contents'\n\n // Find the target element (first child element)\n this.target = this.firstElementChild as HTMLElement\n\n if (!this.target) {\n console.warn('tool-tip: No target element found. ' +\n 'Add a child element.')\n return\n }\n\n // Create the popup element\n this.createPopup()\n\n // Bind event handlers\n this.bindEvents()\n\n // Check if open attribute is set\n if (this.hasAttribute('open')) {\n this._open = true\n this.showTooltip()\n }\n }\n\n disconnectedCallback () {\n this.unbindEvents()\n this.popup?.remove()\n }\n\n attributeChangedCallback (\n name:string,\n _oldValue:string|null,\n newValue:string|null\n ) {\n if (name === 'content' && this.popup) {\n const body = this.popup.querySelector('.tool-tip__body')\n if (body) {\n body.textContent = newValue || ''\n }\n }\n\n if (name === 'placement' && this._open) {\n this.positionPopup()\n }\n\n if (name === 'disabled') {\n this._disabled = newValue !== null\n if (this._disabled && this._open) {\n this.hide()\n }\n }\n\n if (name === 'open') {\n this.open = newValue !== null\n }\n\n if ((name === 'distance' || name === 'skidding') && this._open) {\n this.positionPopup()\n }\n }\n\n private createPopup () {\n this.popup = document.createElement('div')\n this.popup.className = 'tool-tip__popup'\n this.popup.setAttribute('role', 'tooltip')\n this.popup.setAttribute('aria-hidden', 'true')\n this.popup.innerHTML = `\n <div class=\"tool-tip__body\">${this.content}</div>\n <div class=\"tool-tip__arrow\"></div>\n `\n\n this.arrow = this.popup.querySelector('.tool-tip__arrow')\n\n // Append to body if hoisted, otherwise to this element's parent\n if (this.hoist) {\n document.body.appendChild(this.popup)\n } else {\n this.appendChild(this.popup)\n }\n }\n\n private bindEvents () {\n if (!this.target) return\n\n const triggers = this.trigger\n\n if (triggers.includes('hover')) {\n this.target.addEventListener('mouseenter', this.handleMouseEnter)\n this.target.addEventListener('mouseleave', this.handleMouseLeave)\n }\n\n if (triggers.includes('focus')) {\n this.target.addEventListener('focus', this.handleFocus)\n this.target.addEventListener('blur', this.handleBlur)\n }\n\n if (triggers.includes('click')) {\n this.target.addEventListener('click', this.handleClick)\n }\n\n // Add keyboard support\n this.target.addEventListener('keydown', this.handleKeyDown)\n }\n\n private unbindEvents () {\n if (!this.target) return\n\n this.target.removeEventListener('mouseenter', this.handleMouseEnter)\n this.target.removeEventListener('mouseleave', this.handleMouseLeave)\n this.target.removeEventListener('focus', this.handleFocus)\n this.target.removeEventListener('blur', this.handleBlur)\n this.target.removeEventListener('click', this.handleClick)\n this.target.removeEventListener('keydown', this.handleKeyDown)\n }\n\n private handleMouseEnter = () => {\n this.show()\n }\n\n private handleMouseLeave = () => {\n this.hide()\n }\n\n private handleFocus = () => {\n this.show()\n }\n\n private handleBlur = () => {\n this.hide()\n }\n\n private handleClick = () => {\n if (this._open) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Close tooltip on Escape\n if (event.key === 'Escape' && this._open) {\n this.hide()\n }\n }\n\n private showTooltip () {\n if (!this.popup || this._disabled) return\n\n // Emit show event\n const showEvent = new CustomEvent('tool-tip-show', {\n bubbles: true,\n cancelable: true,\n })\n if (!this.dispatchEvent(showEvent)) return\n\n this.popup.classList.add('tool-tip__popup--visible')\n this.popup.setAttribute('aria-hidden', 'false')\n\n // Position the popup\n this.positionPopup()\n\n // Emit after-show event\n this.dispatchEvent(new CustomEvent('tool-tip-after-show', {\n bubbles: true\n }))\n }\n\n private hideTooltip () {\n if (!this.popup) return\n\n // Emit hide event\n const hideEvent = new CustomEvent('tool-tip-hide', {\n bubbles: true,\n cancelable: true,\n })\n if (!this.dispatchEvent(hideEvent)) return\n\n this.popup.classList.remove('tool-tip__popup--visible')\n this.popup.setAttribute('aria-hidden', 'true')\n\n // Emit after-hide event\n this.dispatchEvent(new CustomEvent('tool-tip-after-hide', {\n bubbles: true\n }))\n }\n\n private positionPopup () {\n if (!this.popup || !this.target) return\n\n const targetRect = this.target.getBoundingClientRect()\n const popupRect = this.popup.getBoundingClientRect()\n const arrowSize = 8\n\n let top = 0\n let left = 0\n let arrowTop = ''\n let arrowLeft = ''\n let arrowTransform = ''\n\n const distance = this.distance\n const skidding = this.skidding\n const placement = this.getOptimalPlacement(targetRect, popupRect)\n\n // Set data attribute for CSS styling\n this.popup.dataset.placement = placement\n\n switch (placement) {\n case 'top':\n top = targetRect.top - popupRect.height - distance - arrowSize\n left = targetRect.left + (targetRect.width / 2) -\n (popupRect.width / 2) + skidding\n arrowTop = '100%'\n arrowLeft = '50%'\n arrowTransform = 'translateX(-50%)'\n break\n case 'top-start':\n top = targetRect.top - popupRect.height - distance - arrowSize\n left = targetRect.left + skidding\n arrowTop = '100%'\n arrowLeft = `${Math.min(24, popupRect.width / 2)}px`\n arrowTransform = 'translateX(-50%)'\n break\n case 'top-end':\n top = targetRect.top - popupRect.height - distance - arrowSize\n left = targetRect.right - popupRect.width + skidding\n arrowTop = '100%'\n arrowLeft = `calc(100% - ${Math.min(24, popupRect.width / 2)}px)`\n arrowTransform = 'translateX(-50%)'\n break\n case 'bottom':\n top = targetRect.bottom + distance + arrowSize\n left = targetRect.left + (targetRect.width / 2) -\n (popupRect.width / 2) + skidding\n arrowTop = '0'\n arrowLeft = '50%'\n arrowTransform = 'translateX(-50%) translateY(-100%)'\n break\n case 'bottom-start':\n top = targetRect.bottom + distance + arrowSize\n left = targetRect.left + skidding\n arrowTop = '0'\n arrowLeft = `${Math.min(24, popupRect.width / 2)}px`\n arrowTransform = 'translateX(-50%) translateY(-100%)'\n break\n case 'bottom-end':\n top = targetRect.bottom + distance + arrowSize\n left = targetRect.right - popupRect.width + skidding\n arrowTop = '0'\n arrowLeft = `calc(100% - ${Math.min(24, popupRect.width / 2)}px)`\n arrowTransform = 'translateX(-50%) translateY(-100%)'\n break\n case 'left':\n top = targetRect.top + (targetRect.height / 2) -\n (popupRect.height / 2) + skidding\n left = targetRect.left - popupRect.width - distance - arrowSize\n arrowTop = '50%'\n arrowLeft = '100%'\n arrowTransform = 'translateY(-50%)'\n break\n case 'left-start':\n top = targetRect.top + skidding\n left = targetRect.left - popupRect.width - distance - arrowSize\n arrowTop = `${Math.min(16, popupRect.height / 2)}px`\n arrowLeft = '100%'\n arrowTransform = 'translateY(-50%)'\n break\n case 'left-end':\n top = targetRect.bottom - popupRect.height + skidding\n left = targetRect.left - popupRect.width - distance - arrowSize\n arrowTop = `calc(100% - ${Math.min(16, popupRect.height / 2)}px)`\n arrowLeft = '100%'\n arrowTransform = 'translateY(-50%)'\n break\n case 'right':\n top = targetRect.top + (targetRect.height / 2) -\n (popupRect.height / 2) + skidding\n left = targetRect.right + distance + arrowSize\n arrowTop = '50%'\n arrowLeft = '0'\n arrowTransform = 'translateY(-50%) translateX(-100%)'\n break\n case 'right-start':\n top = targetRect.top + skidding\n left = targetRect.right + distance + arrowSize\n arrowTop = `${Math.min(16, popupRect.height / 2)}px`\n arrowLeft = '0'\n arrowTransform = 'translateY(-50%) translateX(-100%)'\n break\n case 'right-end':\n top = targetRect.bottom - popupRect.height + skidding\n left = targetRect.right + distance + arrowSize\n arrowTop = `calc(100% - ${Math.min(16, popupRect.height / 2)}px)`\n arrowLeft = '0'\n arrowTransform = 'translateY(-50%) translateX(-100%)'\n break\n }\n\n // Adjust for scroll position\n if (this.hoist) {\n top += window.scrollY\n left += window.scrollX\n }\n\n // Apply position\n this.popup.style.top = `${top}px`\n this.popup.style.left = `${left}px`\n\n // Position the arrow\n if (this.arrow) {\n this.arrow.style.top = arrowTop\n this.arrow.style.left = arrowLeft\n this.arrow.style.transform = arrowTransform\n }\n }\n\n private getOptimalPlacement (targetRect:DOMRect, popupRect:DOMRect):Placement {\n const placement = this.placement\n const viewportWidth = window.innerWidth\n const viewportHeight = window.innerHeight\n const distance = this.distance\n const arrowSize = 8\n\n // Check if the preferred placement fits\n const fits = {\n top: targetRect.top - popupRect.height - distance - arrowSize > 0,\n bottom: (targetRect.bottom + popupRect.height + distance +\n arrowSize < viewportHeight),\n left: targetRect.left - popupRect.width - distance - arrowSize > 0,\n right: (targetRect.right + popupRect.width + distance +\n arrowSize < viewportWidth),\n }\n\n // Get the base direction from the placement\n const baseDirection = placement.split('-')[0] as 'top'|\n 'bottom'|\n 'left'|\n 'right'\n\n // If preferred placement fits, use it\n if (fits[baseDirection]) {\n return placement\n }\n\n // Find the best alternative\n const opposites: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n }\n\n const opposite = opposites[baseDirection] as\n 'top'|'bottom'|'left'|'right'\n if (fits[opposite]) {\n // Return the opposite with the same alignment\n const alignment = (placement.includes('-') ?\n placement.split('-')[1] :\n '')\n return (alignment ?\n `${opposite}-${alignment}` :\n opposite) as Placement\n }\n\n // Fall back to a direction that fits\n for (const dir of ['top', 'bottom', 'left', 'right'] as const) {\n if (fits[dir]) {\n return dir\n }\n }\n\n // If nothing fits, return original placement\n return placement\n }\n\n /**\n * Programmatically show the tooltip\n */\n show () {\n if (this._disabled) return\n this.open = true\n }\n\n /**\n * Programmatically hide the tooltip\n */\n hide () {\n this.open = false\n }\n}\n\nif ('customElements' in window) {\n customElements.define('tool-tip', ToolTip)\n}\n"],
5
- "mappings": "+EAuBO,IAAMA,EAAN,cAAsB,WAAY,CAvBzC,MAuByC,CAAAC,EAAA,gBACrC,OAAO,mBAAqB,CAAC,UAAW,YAAa,WACjD,OAAQ,WAAY,UAAU,EAE1B,MAA+B,KAC/B,MAA+B,KAC/B,OAA6B,KAE7B,MAAQ,GACR,UAAY,GAEpB,IAAI,SAAmB,CACnB,OAAO,KAAK,aAAa,SAAS,GAAK,EAC3C,CAEA,IAAI,QAASC,EAAe,CACxB,KAAK,aAAa,UAAWA,CAAK,CACtC,CAEA,IAAI,WAAwB,CACxB,OAAQ,KAAK,aAAa,WAAW,GAAmB,K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AAQM,EACJ,GAAGD,CAAQ,IAAIC,CAAS,GACxBD,CACR,CAGA,QAAWE,IAAO,CAAC,MAAO,SAAU,OAAQ,OAAO,EAC/C,GAAIJ,EAAKI,CAAG,EACR,OAAOA,EAKf,OAAOP,CACX,CAKA,MAAQ,CACA,KAAK,YACT,KAAK,KAAO,GAChB,CAKA,MAAQ,CACJ,KAAK,KAAO,EAChB,CACJ,EAEI,mBAAoB,QACpB,eAAe,OAAO,WAAYtB,CAAO",
6
- "names": ["ToolTip", "__name", "value", "wasOpen", "name", "_oldValue", "newValue", "body", "triggers", "event", "showEvent", "hideEvent", "targetRect", "popupRect", "arrowSize", "top", "left", "arrowTop", "arrowLeft", "arrowTransform", "distance", "skidding", "placement", "viewportWidth", "viewportHeight", "fits", "baseDirection", "opposite", "alignment", "dir"]
3
+ "sources": ["../node_modules/@substrate-system/web-component/src/attributes.ts", "../node_modules/@substrate-system/web-component/src/util.ts", "../src/index.ts"],
4
+ "sourcesContent": ["export type Attrs = Record<string, undefined|null|string|number|boolean|(string|number)[]>\n\n/**\n * Transform an object into an HTML attributes string. The object should be\n * like `{ attributeName: value }`.\n *\n * @param attrs An object for the attributes.\n * @returns {string} A string suitable for use as HTML attributes.\n */\nexport function toAttributes (attrs:Attrs):string {\n return Object.keys(attrs).reduce((acc, k) => {\n const value = attrs[k]\n if (!value) return acc\n\n if (typeof value === 'boolean') {\n if (value) return (acc + ` ${k}`).trim()\n return acc\n }\n\n if (Array.isArray(value)) {\n return (acc + ` ${k}=\"${value.join(' ')}\"`)\n }\n\n return (acc + ` ${k}=\"${value}\"`).trim()\n }, '')\n}\n", "export { toAttributes } from './attributes.js'\n\n/**\n * Check if the given tag name has been registered.\n *\n * @see {@link https://stackoverflow.com/a/28210364 stackoverflow}\n * @param {string} elName The custom element tag name.\n * @returns {boolean} True if the given name has been registered already.\n */\nexport function isRegistered (elName:string):boolean {\n return document.createElement(elName).constructor !== window.HTMLElement\n}\n\nexport function define (name:string, element:CustomElementConstructor) {\n if (!window) return\n if (!('customElements' in window)) return\n\n if (!isRegistered(name)) {\n window.customElements.define(name, element)\n }\n}\n\nexport const qs = document.querySelector.bind(document)\nexport const qsa = document.querySelectorAll.bind(document)\n", "import { define } from '@substrate-system/web-component/util'\n\n// for document.querySelector\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tool-tip':ToolTip\n }\n}\n\nexport type Placement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n\nexport type Trigger = 'hover'|'focus'|'click'|'manual'\n\nexport class ToolTip extends HTMLElement {\n static observedAttributes = ['content', 'placement', 'disabled',\n 'open', 'distance', 'skidding']\n\n private popup:HTMLDivElement|null = null\n private arrow:HTMLDivElement|null = null\n private target:HTMLElement|null = null\n\n private _open = false\n private _disabled = false\n\n get content ():string {\n return this.getAttribute('content') || ''\n }\n\n set content (value:string) {\n this.setAttribute('content', value)\n }\n\n get placement ():Placement {\n return (this.getAttribute('placement') as Placement) || 'top'\n }\n\n set placement (value:Placement) {\n this.setAttribute('placement', value)\n }\n\n get trigger ():Trigger[] {\n const attr = this.getAttribute('trigger') || 'hover focus'\n return attr.split(' ').filter(Boolean) as Trigger[]\n }\n\n set trigger (value:Trigger[]|string) {\n if (Array.isArray(value)) {\n this.setAttribute('trigger', value.join(' '))\n } else {\n this.setAttribute('trigger', value)\n }\n }\n\n get disabled (): boolean {\n return this._disabled\n }\n\n set disabled (value: boolean) {\n this._disabled = value\n if (value) {\n this.setAttribute('disabled', '')\n } else {\n this.removeAttribute('disabled')\n }\n }\n\n get open ():boolean {\n return this._open\n }\n\n set open (value:boolean) {\n if (this._disabled) return\n const wasOpen = this._open\n this._open = value\n\n if (value && !wasOpen) {\n this.showTooltip()\n } else if (!value && wasOpen) {\n this.hideTooltip()\n }\n }\n\n get distance ():number {\n return parseInt(this.getAttribute('distance') || '8', 10)\n }\n\n set distance (value:number) {\n this.setAttribute('distance', String(value))\n }\n\n get skidding ():number {\n return parseInt(this.getAttribute('skidding') || '0', 10)\n }\n\n set skidding (value:number) {\n this.setAttribute('skidding', String(value))\n }\n\n get hoist ():boolean {\n return this.hasAttribute('hoist')\n }\n\n set hoist (value:boolean) {\n if (value) {\n this.setAttribute('hoist', '')\n } else {\n this.removeAttribute('hoist')\n }\n }\n\n connectedCallback () {\n // Use display: contents so the tooltip doesn't affect layout\n this.style.display = 'contents'\n\n // Find the target element (first child element)\n this.target = this.firstElementChild as HTMLElement\n\n if (!this.target) {\n console.warn('tool-tip: No target element found. ' +\n 'Add a child element.')\n return\n }\n\n // Create the popup element\n this.createPopup()\n\n // Bind event handlers\n this.bindEvents()\n\n // Check if open attribute is set\n if (this.hasAttribute('open')) {\n this._open = true\n this.showTooltip()\n }\n }\n\n disconnectedCallback () {\n this.unbindEvents()\n this.popup?.remove()\n }\n\n attributeChangedCallback (\n name:string,\n _oldValue:string|null,\n newValue:string|null\n ) {\n if (name === 'content' && this.popup) {\n const body = this.popup.querySelector('.body')\n if (body) {\n body.textContent = newValue || ''\n }\n }\n\n if (name === 'placement' && this._open) {\n this.positionPopup()\n }\n\n if (name === 'disabled') {\n this._disabled = newValue !== null\n if (this._disabled && this._open) {\n this.hide()\n }\n }\n\n if (name === 'open') {\n this.open = newValue !== null\n }\n\n if ((name === 'distance' || name === 'skidding') && this._open) {\n this.positionPopup()\n }\n }\n\n private createPopup () {\n this.popup = document.createElement('div')\n this.popup.className = 'popup'\n this.popup.setAttribute('role', 'tooltip')\n this.popup.setAttribute('aria-hidden', 'true')\n this.popup.innerHTML = `\n <div class=\"body\">${this.content}</div>\n <div class=\"arrow\"></div>\n `\n\n this.arrow = this.popup.querySelector('.arrow')\n\n // Append to body if hoisted, otherwise to this element's parent\n if (this.hoist) {\n document.body.appendChild(this.popup)\n } else {\n this.appendChild(this.popup)\n }\n }\n\n private bindEvents () {\n if (!this.target) return\n\n const triggers = this.trigger\n\n if (triggers.includes('hover')) {\n this.target.addEventListener('mouseenter', this.handleMouseEnter)\n this.target.addEventListener('mouseleave', this.handleMouseLeave)\n }\n\n if (triggers.includes('focus')) {\n this.target.addEventListener('focus', this.handleFocus)\n this.target.addEventListener('blur', this.handleBlur)\n }\n\n if (triggers.includes('click')) {\n this.target.addEventListener('click', this.handleClick)\n }\n\n // Add keyboard support\n this.target.addEventListener('keydown', this.handleKeyDown)\n }\n\n private unbindEvents () {\n if (!this.target) return\n\n this.target.removeEventListener('mouseenter', this.handleMouseEnter)\n this.target.removeEventListener('mouseleave', this.handleMouseLeave)\n this.target.removeEventListener('blur', this.handleBlur)\n this.target.removeEventListener('click', this.handleClick)\n this.target.removeEventListener('keydown', this.handleKeyDown)\n }\n\n private handleMouseEnter = () => {\n this.show()\n }\n\n private handleMouseLeave = () => {\n this.hide()\n }\n\n private handleFocus = () => {\n this.show()\n }\n\n private handleBlur = () => {\n this.hide()\n }\n\n private handleClick = () => {\n if (this._open) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Close tooltip on Escape\n if (event.key === 'Escape' && this._open) {\n this.hide()\n }\n }\n\n private showTooltip () {\n if (!this.popup || this._disabled) return\n\n // Emit show event\n const showEvent = new CustomEvent('tool-tip-show', {\n bubbles: true,\n cancelable: true,\n })\n if (!this.dispatchEvent(showEvent)) return\n\n this.popup.classList.add('visible')\n this.popup.setAttribute('aria-hidden', 'false')\n\n // Position the popup\n this.positionPopup()\n\n // Emit after-show event\n this.dispatchEvent(new CustomEvent('tool-tip-after-show', {\n bubbles: true\n }))\n }\n\n private hideTooltip () {\n if (!this.popup) return\n\n // Emit hide event\n const hideEvent = new CustomEvent('tool-tip-hide', {\n bubbles: true,\n cancelable: true,\n })\n if (!this.dispatchEvent(hideEvent)) return\n\n this.popup.classList.remove('visible')\n this.popup.setAttribute('aria-hidden', 'true')\n\n // Emit after-hide event\n this.dispatchEvent(new CustomEvent('tool-tip-after-hide', {\n bubbles: true\n }))\n }\n\n private positionPopup () {\n if (!this.popup || !this.target) return\n\n const targetRect = this.target.getBoundingClientRect()\n const popupRect = this.popup.getBoundingClientRect()\n const arrowSize = 8\n\n let top = 0\n let left = 0\n let arrowTop = ''\n let arrowLeft = ''\n let arrowTransform = ''\n\n const distance = this.distance\n const skidding = this.skidding\n const placement = this.getOptimalPlacement(targetRect, popupRect)\n\n // Set data attribute for CSS styling\n this.popup.dataset.placement = placement\n\n switch (placement) {\n case 'top':\n top = targetRect.top - popupRect.height - distance - arrowSize\n left = targetRect.left + (targetRect.width / 2) -\n (popupRect.width / 2) + skidding\n arrowTop = '100%'\n arrowLeft = '50%'\n arrowTransform = 'translateX(-50%)'\n break\n case 'top-start':\n top = targetRect.top - popupRect.height - distance - arrowSize\n left = targetRect.left + skidding\n arrowTop = '100%'\n arrowLeft = `${Math.min(24, popupRect.width / 2)}px`\n arrowTransform = 'translateX(-50%)'\n break\n case 'top-end':\n top = targetRect.top - popupRect.height - distance - arrowSize\n left = targetRect.right - popupRect.width + skidding\n arrowTop = '100%'\n arrowLeft = `calc(100% - ${Math.min(24, popupRect.width / 2)}px)`\n arrowTransform = 'translateX(-50%)'\n break\n case 'bottom':\n top = targetRect.bottom + distance + arrowSize\n left = targetRect.left + (targetRect.width / 2) -\n (popupRect.width / 2) + skidding\n arrowTop = '0'\n arrowLeft = '50%'\n arrowTransform = 'translateX(-50%) translateY(-100%)'\n break\n case 'bottom-start':\n top = targetRect.bottom + distance + arrowSize\n left = targetRect.left + skidding\n arrowTop = '0'\n arrowLeft = `${Math.min(24, popupRect.width / 2)}px`\n arrowTransform = 'translateX(-50%) translateY(-100%)'\n break\n case 'bottom-end':\n top = targetRect.bottom + distance + arrowSize\n left = targetRect.right - popupRect.width + skidding\n arrowTop = '0'\n arrowLeft = `calc(100% - ${Math.min(24, popupRect.width / 2)}px)`\n arrowTransform = 'translateX(-50%) translateY(-100%)'\n break\n case 'left':\n top = targetRect.top + (targetRect.height / 2) -\n (popupRect.height / 2) + skidding\n left = targetRect.left - popupRect.width - distance - arrowSize\n arrowTop = '50%'\n arrowLeft = '100%'\n arrowTransform = 'translateY(-50%)'\n break\n case 'left-start':\n top = targetRect.top + skidding\n left = targetRect.left - popupRect.width - distance - arrowSize\n arrowTop = `${Math.min(16, popupRect.height / 2)}px`\n arrowLeft = '100%'\n arrowTransform = 'translateY(-50%)'\n break\n case 'left-end':\n top = targetRect.bottom - popupRect.height + skidding\n left = targetRect.left - popupRect.width - distance - arrowSize\n arrowTop = `calc(100% - ${Math.min(16, popupRect.height / 2)}px)`\n arrowLeft = '100%'\n arrowTransform = 'translateY(-50%)'\n break\n case 'right':\n top = targetRect.top + (targetRect.height / 2) -\n (popupRect.height / 2) + skidding\n left = targetRect.right + distance + arrowSize\n arrowTop = '50%'\n arrowLeft = '0'\n arrowTransform = 'translateY(-50%) translateX(-100%)'\n break\n case 'right-start':\n top = targetRect.top + skidding\n left = targetRect.right + distance + arrowSize\n arrowTop = `${Math.min(16, popupRect.height / 2)}px`\n arrowLeft = '0'\n arrowTransform = 'translateY(-50%) translateX(-100%)'\n break\n case 'right-end':\n top = targetRect.bottom - popupRect.height + skidding\n left = targetRect.right + distance + arrowSize\n arrowTop = `calc(100% - ${Math.min(16, popupRect.height / 2)}px)`\n arrowLeft = '0'\n arrowTransform = 'translateY(-50%) translateX(-100%)'\n break\n }\n\n // Adjust for scroll position\n if (this.hoist) {\n top += window.scrollY\n left += window.scrollX\n }\n\n // Apply position\n this.popup.style.top = `${top}px`\n this.popup.style.left = `${left}px`\n\n // Position the arrow\n if (this.arrow) {\n this.arrow.style.top = arrowTop\n this.arrow.style.left = arrowLeft\n this.arrow.style.transform = arrowTransform\n }\n }\n\n private getOptimalPlacement (targetRect:DOMRect, popupRect:DOMRect):Placement {\n const placement = this.placement\n const viewportWidth = window.innerWidth\n const viewportHeight = window.innerHeight\n const distance = this.distance\n const arrowSize = 8\n\n // Check if the preferred placement fits\n const fits = {\n top: targetRect.top - popupRect.height - distance - arrowSize > 0,\n bottom: (targetRect.bottom + popupRect.height + distance +\n arrowSize < viewportHeight),\n left: targetRect.left - popupRect.width - distance - arrowSize > 0,\n right: (targetRect.right + popupRect.width + distance +\n arrowSize < viewportWidth),\n }\n\n // Get the base direction from the placement\n const baseDirection = placement.split('-')[0] as 'top'|\n 'bottom'|\n 'left'|\n 'right'\n\n // If preferred placement fits, use it\n if (fits[baseDirection]) {\n return placement\n }\n\n // Find the best alternative\n const opposites: Record<string, string> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n }\n\n const opposite = opposites[baseDirection] as\n 'top'|'bottom'|'left'|'right'\n if (fits[opposite]) {\n // Return the opposite with the same alignment\n const alignment = (placement.includes('-') ?\n placement.split('-')[1] :\n '')\n return (alignment ?\n `${opposite}-${alignment}` :\n opposite) as Placement\n }\n\n // Fall back to a direction that fits\n for (const dir of ['top', 'bottom', 'left', 'right'] as const) {\n if (fits[dir]) {\n return dir\n }\n }\n\n // If nothing fits, return original placement\n return placement\n }\n\n /**\n * Programmatically show the tooltip\n */\n show () {\n if (this._disabled) return\n this.open = true\n }\n\n /**\n * Programmatically hide the tooltip\n */\n hide () {\n this.open = false\n }\n}\n\ndefine('tool-tip', ToolTip)\n"],
5
+ "mappings": "sKASO,SAASA,EAAcC,EAAoB,CAC9C,OAAO,OAAO,KAAKA,CAAK,EAAE,OAAO,CAACC,EAAKC,IAAM,CACzC,IAAMC,EAAQH,EAAME,CAAC,EACrB,OAAKC,EAED,OAAOA,GAAU,UACbA,GAAeF,EAAM,IAAIC,CAAC,IAAI,KAAK,EAChCD,EAGP,MAAM,QAAQE,CAAK,EACXF,EAAM,IAAIC,CAAC,KAAKC,EAAM,KAAK,GAAG,CAAC,KAGnCF,EAAM,IAAIC,CAAC,KAAKC,CAAK,KAAK,KAAK,EAXpBF,CAYvB,EAAG,EAAE,CACT,CAhBgBG,EAAAL,EAAA,gBAAAK,EAAAL,EAAA,cAAA,yFCAT,SAASM,EAAcC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AK,MAAM,MAAM,UAAYC,EAErC,CAEQ,oBAAqBP,EAAoBC,EAA6B,CAC1E,IAAMS,EAAY,KAAK,UACjBC,EAAgB,OAAO,WACvBC,EAAiB,OAAO,YACxBJ,EAAW,KAAK,SAChBN,EAAY,EAGZW,EAAO,CACT,IAAKb,EAAW,IAAMC,EAAU,OAASO,EAAWN,EAAY,EAChE,OAASF,EAAW,OAASC,EAAU,OAASO,EAC5CN,EAAYU,EAChB,KAAMZ,EAAW,KAAOC,EAAU,MAAQO,EAAWN,EAAY,EACjE,MAAQF,EAAW,MAAQC,EAAU,MAAQO,EACzCN,EAAYS,CACpB,EAGMG,EAAgBJ,EAAU,MAAM,GAAG,EAAE,CAAC,EAM5C,GAAIG,EAAKC,CAAa,EAClB,OAAOJ,EAWX,IAAMK,EAPoC,CACtC,IAAK,SACL,OAAQ,MACR,KAAM,QACN,MAAO,MACX,EAE2BD,CAAa,EAExC,GAAID,EAAKE,CAAQ,EAAG,CAEhB,IAAMC,EAAaN,EAAU,SAAS,GAAG,EACrCA,EAAU,MAAM,GAAG,EAAE,CAAC,EACtB,GACJ,OAAQM,EACJ,GAAGD,CAAQ,IAAIC,CAAS,GACxBD,CACR,CAGA,QAAWE,IAAO,CAAC,MAAO,SAAU,OAAQ,OAAO,EAC/C,GAAIJ,EAAKI,CAAG,EACR,OAAOA,EAKf,OAAOP,CACX,CAKA,MAAQ,CACA,KAAK,YACT,KAAK,KAAO,GAChB,CAKA,MAAQ,CACJ,KAAK,KAAO,EAChB,CACJ,EAEAQ,EAAO,WAAY9B,CAAO",
6
+ "names": ["toAttributes", "attrs", "acc", "k", "value", "__name", "isRegistered", "elName", "__name", "define", "name", "element", "qs", "qsa", "ToolTip", "__name", "value", "wasOpen", "name", "_oldValue", "newValue", "body", "triggers", "event", "showEvent", "hideEvent", "targetRect", "popupRect", "arrowSize", "top", "left", "arrowTop", "arrowLeft", "arrowTransform", "distance", "skidding", "placement", "viewportWidth", "viewportHeight", "fits", "baseDirection", "opposite", "alignment", "dir", "define"]
7
7
  }
package/dist/meta.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "inputs": {
3
3
  "src/index.ts": {
4
- "bytes": 15752,
4
+ "bytes": 15584,
5
5
  "imports": [],
6
6
  "format": "esm"
7
7
  }
@@ -11,20 +11,26 @@
11
11
  "imports": [],
12
12
  "exports": [],
13
13
  "inputs": {},
14
- "bytes": 24293
14
+ "bytes": 24057
15
15
  },
16
16
  "dist/index.js": {
17
- "imports": [],
17
+ "imports": [
18
+ {
19
+ "path": "@substrate-system/web-component/util",
20
+ "kind": "import-statement",
21
+ "external": true
22
+ }
23
+ ],
18
24
  "exports": [
19
25
  "ToolTip"
20
26
  ],
21
27
  "entryPoint": "src/index.ts",
22
28
  "inputs": {
23
29
  "src/index.ts": {
24
- "bytesInOutput": 12111
30
+ "bytesInOutput": 11973
25
31
  }
26
32
  },
27
- "bytes": 12296
33
+ "bytes": 12158
28
34
  }
29
35
  }
30
36
  }