vue-pointing-bubble 0.6.1 → 0.6.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.
|
@@ -5,10 +5,9 @@ export declare function sameKeys(a: Record<string, unknown> | null | undefined,
|
|
|
5
5
|
* frame. Falls back to `document.documentElement`.
|
|
6
6
|
*/
|
|
7
7
|
export declare function positioningFrameEl(boxEl: HTMLElement): HTMLElement;
|
|
8
|
-
export declare function effectiveZoom(el: Element): number;
|
|
9
8
|
/** Measure a frame element including ancestor CSS scale (e.g. Slidev). */
|
|
10
9
|
export declare function measureFrame(frameEl: HTMLElement): FrameRect;
|
|
11
10
|
/** Frame for tip/tail math: the bubble's positioning containing block. */
|
|
12
11
|
export declare function measureFrameFrom(boxEl: HTMLElement): FrameRect;
|
|
13
12
|
/** Box size and top-left in frame-local coordinates. */
|
|
14
|
-
export declare function measureBox(boxEl: HTMLElement, frame: FrameRect
|
|
13
|
+
export declare function measureBox(boxEl: HTMLElement, frame: FrameRect): BoxMeasure;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("vue"),G={target:null,placement:"auto",targetAnchor:"center",tailLength:45,tailBaseWidth:24,padding:8,shadow:!0,transitionDuration:200},H="pointing-bubble-styles",ot=`:where(.pointing-bubble__inner) {
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
width: var(--pb-width, max-content);
|
|
4
4
|
max-width: var(--pb-max-width, none);
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
background: white;
|
|
7
7
|
border: 2px solid gray;
|
|
8
8
|
border-radius: 8px;
|
|
9
|
-
}`,ut="drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))";function dt(e=document){if(e.getElementById(K))return;const t=e.createElement("style");t.id=K,t.textContent=ct,e.head.prepend(t)}function nt(e){return typeof e=="object"&&e!==null&&typeof e.x=="number"&&typeof e.y=="number"&&e.nodeType!==1}function q(e){return typeof Element>"u"||e==null?null:typeof e=="string"?document.querySelector(e):e instanceof Element?e:null}function j(e,t){return!e||!t?!1:Object.keys(e).every(n=>e[n]===t[n])}function ot(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t).position;if(n&&n!=="static")return t;if(t===document.documentElement)break;t=t.parentElement}return document.documentElement}function X(e){let t=1,n=e;for(;n;){const i=Number.parseFloat(getComputedStyle(n).zoom);Number.isFinite(i)&&i>0&&(t*=i),n=n.parentElement}return t}function ft(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),i=parseFloat(n.width)||0,o=parseFloat(n.height)||0;return{left:t.left,top:t.top,width:i,height:o,scaleX:i?t.width/i:1,scaleY:o?t.height/o:1,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}function pt(e){return ft(ot(e))}function ht(e,t,n=1,i=1){const o=getComputedStyle(e),{scaleX:u,scaleY:f,left:r,top:l}=t,a=e.getBoundingClientRect();return{x:(a.left*n-r*i)/(u*n),y:(a.top*n-l*i)/(f*n),width:a.width/u,height:a.height/f,fill:o.backgroundColor,stroke:o.borderTopColor,strokeWidth:parseFloat(o.borderTopWidth)||0,borderLeft:(parseFloat(o.borderLeftWidth)||0)/u,borderTop:(parseFloat(o.borderTopWidth)||0)/f,radius:o.borderTopLeftRadius,zIndex:o.zIndex}}function J(e,t,n){const i=e.x-n;let o=i,u=t.width?t.width-e.x-n:1/0;return t.viewportWidth&&(o=Math.min(o,t.left/t.scaleX+i),u=Math.min(u,(t.viewportWidth-t.left)/t.scaleX-e.x-n)),{left:Math.max(0,o),right:Math.max(0,u)}}function lt(e){return e.left>e.right?"left":"right"}function it(e){const{tip:t,box:n,frame:i,placement:o,targetRect:u,room:f,tailLength:r}=e;if(!n.width||!n.height)return null;const{width:l,height:a}=n,{x:g,y:m}=t,L=o==="manual",d=e.targetAnchor==="edge"?u:null;if(L){if(d){const E=n.x+l/2,F=n.y+a/2;if(!(E>=d.left&&E<=d.right&&F>=d.top&&F<=d.bottom)){const y=Math.min(d.right,Math.max(d.left,E)),v=Math.min(d.bottom,Math.max(d.top,F));return{placement:"manual",tx:y,ty:v,bx:n.x,by:n.y,w:l,h:a}}}return{placement:"manual",tx:g,ty:m,bx:n.x,by:n.y,w:l,h:a}}const C=E=>d?E==="top"?d.top:d.bottom:m;let S=o;if(o==="auto"){let E=m>(i.height||600)/2?"top":"bottom",F=lt(f);const{scaleX:z,scaleY:y}=i;if(i.viewportHeight){const v=i.top+(C("top")-a-r)*y>=0,T=i.top+(C("bottom")+a+r)*y<=i.viewportHeight;E==="top"&&!v&&T?E="bottom":E==="bottom"&&!T&&v&&(E="top")}if(i.viewportWidth){const v=i.left+(g-l-r)*z>=0,T=i.left+(g+l+r)*z<=i.viewportWidth;F==="left"&&!v&&T?F="right":F==="right"&&!T&&v&&(F="left")}S=`${E}-${F}`}const[c,$]=S.split("-"),k=C(c);return{placement:S,tx:g,ty:k,bx:$==="left"?g-l-r:g+r,by:c==="top"?k-a-r:k+r,w:l,h:a}}const mt=["tx","ty","bx","by"],gt=["tx","ty"];function bt(){return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function yt(e,t,n,i){let o=0;const u=()=>{typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(o)};if(!t||!e||n<=0||typeof requestAnimationFrame>"u"||bt())return i(t),{cancel:u};const f=performance.now(),r=l=>{const a=Math.min(1,(l-f)/n),g=1-Math.pow(1-a,3),m={...t},L=t.placement==="manual"?gt:mt;for(const d of L)m[d]=e[d]+(t[d]-e[d])*g;i(m),a<1&&(o=requestAnimationFrame(r))};return o=requestAnimationFrame(r),{cancel:u}}function rt(e){const{geometry:t,strokeWidth:n,radius:i,tailBaseWidth:o}=e,{placement:u,tx:f,ty:r,bx:l,by:a,w:g,h:m}=t,L=parseFloat(i)*(i.endsWith("%")?Math.min(g,m)/100:1)||0,d=o/2,C=(h,x,_)=>x>_?(x+_)/2:Math.min(_,Math.max(x,h));let S=null,c=0;if(u==="manual"){const h=Math.max(l-f,f-(l+g),0),x=Math.max(a-r,r-(a+m),0);if(h>0&&h>=x)S=f<l?"left":"right",c=r;else if(x>0)S=r<a?"top":"bottom",c=f;else return null}else if(u!=="none"){const[h,x]=u.split("-");S=x==="left"?"right":"left",c=a+m*(h==="top"?.65:.35)}else return null;const $=S==="top"||S==="bottom",k={left:(h,x)=>[l-x,h],right:(h,x)=>[l+g+x,h],top:(h,x)=>[h,a-x],bottom:(h,x)=>[h,a+m+x]}[S],E=$?l:a,F=$?l+g:a+m,z=C(c,E+d+n/2+L,F-d-n/2-L),y=([h,x])=>`${h} ${x}`,v=n>0?-n/2:0,T=2,N=2,I=z-d,s=z+d,W=k(I-T,v),O=k(I,v),b=k(s,v),w=k(s+T,v),B=k(I,-(n+N)),R=k(s,-(n+N)),A=k(I,1),M=k(s,1);return{fill:`M ${y(B)} L ${y(A)} L ${y(O)} L ${f} ${r} L ${y(b)} L ${y(M)} L ${y(R)} Z`,stroke:n?`M ${y(W)} L ${y(O)} L ${f} ${r} L ${y(b)} L ${y(w)}`:null}}const xt=["left","top","right","bottom","width","height","transform","translate","inset","inset-inline","inset-block"];function wt(e){return{hasTarget:e,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"}}function D(e,t){return e===t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function vt(e,t){return e===t?!0:!e||!t?!1:e.placement===t.placement&&e.tx===t.tx&&e.ty===t.ty&&e.bx===t.bx&&e.by===t.by&&e.w===t.w&&e.h===t.h}function St(e,t){return e.hasTarget===t.hasTarget&&e.placement===t.placement&&e.boxFill===t.boxFill&&e.boxStroke===t.boxStroke&&e.boxStrokeWidth===t.boxStrokeWidth&&e.boxZIndex===t.boxZIndex&&D(e.tip,t.tip)&&D(e.slotTip,t.slotTip)&&j(e.boxStyle,t.boxStyle)&&j(e.svgStyle,t.svgStyle)&&e.tail?.fill===t.tail?.fill&&e.tail?.stroke===t.tail?.stroke}function Q(e){if(typeof e.checkVisibility=="function")return e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function tt(e){const t=e.style;return xt.map(n=>t.getPropertyValue(n)).join("|")}function st(e){dt();let t={...et},n=null,i=null,o=null,u={left:0,top:0,width:0,height:0,scaleX:1,scaleY:1,viewportWidth:0,viewportHeight:0},f={...u},r=null,l=null,a=null,g=null,m=null,L=null,d=wt(!1),C=!1,S="";const c=()=>{const s=$();St(d,s)||(d=s,e.onChange?.(d))};function $(){const s=t.target!=null,W=t.placement==="manual",O=s?r?.placement??"none":"none",b={"--pb-padding":typeof t.padding=="number"?`${t.padding}px`:t.padding};if(t.maxWidth!=null&&(b["--pb-max-width"]=`${t.maxWidth}px`),t.shadow&&(b.filter=ut),!s)b["--pb-width"]="fit-content";else if(Object.assign(b,{position:"absolute",pointerEvents:"auto",overflow:"visible"}),W)b["--pb-width"]="fit-content";else if(Object.assign(b,{left:`${r?.bx??0}px`,top:`${r?.by??0}px`,margin:"0"}),t.maxWidth==null&&n){const A=J(n,f,t.tailLength),M=l?.placement??t.placement,h=M==="auto"?lt(A):M.split("-")[1];b["--pb-max-width"]=`${A[h]}px`}const w=o?.zIndex;w&&w!=="auto"&&(b.zIndex=w);const B=s&&r&&o?rt({geometry:r,strokeWidth:o.strokeWidth,radius:o.radius,tailBaseWidth:t.tailBaseWidth}):null;let R={};if(B&&r&&f.width&&f.height){const A=o?.borderLeft??0,M=o?.borderTop??0;R={position:"absolute",left:`${-r.bx-A}px`,top:`${-r.by-M}px`,width:`${f.width}px`,height:`${f.height}px`,overflow:"visible",pointerEvents:"none",zIndex:o?.zIndex??"auto"}}return{hasTarget:s,placement:O,tip:n,slotTip:l?{x:l.tx,y:l.ty}:n,boxStyle:b,svgStyle:R,tail:B,boxFill:o?.fill??"",boxStroke:o?.stroke??"",boxStrokeWidth:o?.strokeWidth??0,boxZIndex:o?.zIndex??"auto"}}function k(){if(!n||!o){(l!==null||r!==null)&&(l=null,E(null));return}const s=J(n,f,t.tailLength),W=it({tip:n,box:o,frame:f,placement:t.placement,targetAnchor:t.targetAnchor,targetRect:i,room:s,tailLength:t.tailLength});vt(l,W)||(l=W,E(l))}function E(s){a?.cancel(),a=yt(r,s,t.transitionDuration,W=>{r=W,c()})}function F(s,W,O){const b=ht(s,u,W,O);return j(b,o)?!1:(o=b,!0)}function z(){const s=e.getBoxEl();if(!s){n=null,i=null,o=null,l=null,r=null,C=!1,c();return}if(!Q(s)){a?.cancel(),C=!0;return}const W=C;if(C=!1,t.target==null){n=null,i=null,o=null,l=null,r=null,c();return}const O=f;u=pt(s);const b=ot(s),w=X(b),B=X(s);f={...u,left:u.left*w,top:u.top*w,width:u.width*w/B,height:u.height*w/B,scaleX:u.scaleX*B,scaleY:u.scaleY*B};const R=!j(f,O),A=typeof t.target=="string"?b.querySelector(t.target)??q(t.target):q(t.target);let M=!1,h=!1;if(A){const _=A.getBoundingClientRect(),P=X(A),{scaleX:H,scaleY:U,left:V,top:G}=u,Y={left:(_.left*P-V*w)/(H*B),top:(_.top*P-G*w)/(U*B),right:(_.right*P-V*w)/(H*B),bottom:(_.bottom*P-G*w)/(U*B)};h=!j(Y,i),h&&(i=Y);const Z={x:(Y.left+Y.right)/2,y:(Y.top+Y.bottom)/2};M=!D(n,Z),n=Z}else if(nt(t.target)){h=i!=null,i=null;const _={x:t.target.x,y:t.target.y};M=!D(n,_),n=_}else{n=null,i=null,o=null,l=null,r=null,c();return}const x=F(s,B,w);S=tt(s),!(!W&&!R&&!M&&!h&&!x&&r)&&k()}function y(){z()}typeof window<"u"&&(window.addEventListener("resize",y),window.addEventListener("scroll",y,!0));const v=z;function T(s){const W=e.getBoxEl();if(!W)return;if(s.some(w=>w.attributeName==="class"||w.attributeName==="hidden")){if(!Q(W)){a?.cancel(),C=!0;return}v();return}const b=tt(W);b!==S&&(S=b,v())}function N(){const s=e.getBoxEl();s!==L&&(L=s,g?.disconnect(),m?.disconnect(),g=null,m=null,s&&(typeof ResizeObserver<"u"&&(g=new ResizeObserver(()=>v()),g.observe(s)),typeof MutationObserver<"u"&&(m=new MutationObserver(T),m.observe(s,{attributes:!0,attributeFilter:["style","class","hidden"]}))))}function I(){N(),v()}return{update:I,setConfig(s){t={...t,...s},I()},getConfig:()=>t,getState:()=>d,destroy(){a?.cancel(),g?.disconnect(),m?.disconnect(),L=null,typeof window<"u"&&(window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0))}}}const kt=["data-placement"],Et=["d","fill"],Wt=["d","stroke","stroke-width"],at=p.defineComponent({name:"PointingBubble",inheritAttrs:!1,__name:"PointingBubble",props:{target:{default:null},placement:{default:"auto"},targetAnchor:{default:"center"},maxWidth:{default:void 0},tailLength:{default:45},tailBaseWidth:{default:24},padding:{default:8},shadow:{type:Boolean,default:!0},transitionDuration:{default:200}},setup(e,{expose:t}){const n=e,i=p.useAttrs(),o=p.computed(()=>i.class),u=p.computed(()=>i.style),f=p.computed(()=>{const{class:c,style:$,...k}=i;return k}),r=p.ref(null),l=p.reactive({hasTarget:!1,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"});function a(c){return c==null?null:typeof c=="string"||typeof Element<"u"&&c instanceof Element?c:typeof c=="object"&&"$el"in c&&c.$el instanceof Element?c.$el:typeof c=="object"&&typeof c.x=="number"&&typeof c.y=="number"?c:null}const g=p.getCurrentInstance(),m=st({getBoxEl:()=>r.value,onChange:c=>{Object.assign(l,c),g?.update()}});function L(){m.setConfig({target:a(n.target),placement:n.placement,targetAnchor:n.targetAnchor,maxWidth:n.maxWidth,tailLength:n.tailLength,tailBaseWidth:n.tailBaseWidth,padding:n.padding,shadow:n.shadow,transitionDuration:n.transitionDuration})}p.watch(()=>[n.target,typeof n.target=="object"&&n.target&&"x"in n.target?n.target.x:null,typeof n.target=="object"&&n.target&&"y"in n.target?n.target.y:null,n.placement,n.targetAnchor,n.maxWidth,n.tailLength,n.tailBaseWidth,n.padding,n.shadow,n.transitionDuration],L,{flush:"post"}),p.onMounted(()=>{L()}),p.onBeforeUnmount(()=>{m.destroy()});function d(){m.update()}t({update:d});const C=p.computed(()=>({...u.value,...l.boxStyle})),S=p.computed(()=>l.svgStyle);return(c,$)=>(p.openBlock(),p.createElementBlock("div",p.mergeProps({ref_key:"rootRef",ref:r,class:["pointing-bubble","pointing-bubble__inner",o.value],"data-placement":l.placement},f.value,{style:C.value}),[p.renderSlot(c.$slots,"default",{placement:l.placement,tip:l.slotTip},()=>[$[0]||($[0]=p.createElementVNode("p",{style:{margin:0,fontSize:"14px",fontWeight:600,color:"#1e293b"}}," Callout content ",-1))]),e.target&&l.tail?(p.openBlock(),p.createElementBlock("svg",{key:0,class:"pointing-bubble__svg",style:p.normalizeStyle(S.value)},[p.createElementVNode("path",{class:"pointing-bubble__path",d:l.tail.fill,fill:l.boxFill},null,8,Et),l.tail.stroke?(p.openBlock(),p.createElementBlock("path",{key:0,class:"pointing-bubble__path",d:l.tail.stroke,fill:"none",stroke:l.boxStroke,"stroke-width":l.boxStrokeWidth,"stroke-linejoin":"round","stroke-linecap":"butt"},null,8,Wt)):p.createCommentVNode("",!0)],4)):p.createCommentVNode("",!0)],16,kt))}});exports.DEFAULT_BUBBLE_CONFIG=et;exports.PointingBubble=at;exports.buildTailPaths=rt;exports.computeGeometry=it;exports.createBubbleController=st;exports.default=at;exports.isPoint=nt;exports.resolveElement=q;
|
|
9
|
+
}`,lt="drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))";function it(e=document){if(e.getElementById(H))return;const t=e.createElement("style");t.id=H,t.textContent=ot,e.head.prepend(t)}function Z(e){return typeof e=="object"&&e!==null&&typeof e.x=="number"&&typeof e.y=="number"&&e.nodeType!==1}function N(e){return typeof Element>"u"||e==null?null:typeof e=="string"?document.querySelector(e):e instanceof Element?e:null}function Y(e,t){return!e||!t?!1:Object.keys(e).every(n=>e[n]===t[n])}function K(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t).position;if(n&&n!=="static")return t;if(t===document.documentElement)break;t=t.parentElement}return document.documentElement}function rt(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),l=parseFloat(n.width)||0,o=parseFloat(n.height)||0;return{left:t.left,top:t.top,width:l,height:o,scaleX:l?t.width/l:1,scaleY:o?t.height/o:1,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}function st(e){return rt(K(e))}function at(e,t){const n=getComputedStyle(e),{scaleX:l,scaleY:o,left:u,top:a}=t,i=e.getBoundingClientRect();return{x:(i.left-u)/l,y:(i.top-a)/o,width:i.width/l,height:i.height/o,fill:n.backgroundColor,stroke:n.borderTopColor,strokeWidth:parseFloat(n.borderTopWidth)||0,borderLeft:(parseFloat(n.borderLeftWidth)||0)/l,borderTop:(parseFloat(n.borderTopWidth)||0)/o,radius:n.borderTopLeftRadius,zIndex:n.zIndex}}function U(e,t,n){const l=e.x-n;let o=l,u=t.width?t.width-e.x-n:1/0;return t.viewportWidth&&(o=Math.min(o,t.left/t.scaleX+l),u=Math.min(u,(t.viewportWidth-t.left)/t.scaleX-e.x-n)),{left:Math.max(0,o),right:Math.max(0,u)}}function J(e){return e.left>e.right?"left":"right"}function Q(e){const{tip:t,box:n,frame:l,placement:o,targetRect:u,room:a,tailLength:i}=e;if(!n.width||!n.height)return null;const{width:r,height:f}=n,{x:h,y:g}=t,E=o==="manual",c=e.targetAnchor==="edge"?u:null;if(E){if(c){const k=n.x+r/2,W=n.y+f/2;if(!(k>=c.left&&k<=c.right&&W>=c.top&&W<=c.bottom)){const b=Math.min(c.right,Math.max(c.left,k)),B=Math.min(c.bottom,Math.max(c.top,W));return{placement:"manual",tx:b,ty:B,bx:n.x,by:n.y,w:r,h:f}}}return{placement:"manual",tx:h,ty:g,bx:n.x,by:n.y,w:r,h:f}}const _=k=>c?k==="top"?c.top:c.bottom:g;let w=o;if(o==="auto"){let k=g>(l.height||600)/2?"top":"bottom",W=J(a);const{scaleX:$,scaleY:b}=l;if(l.viewportHeight){const B=l.top+(_("top")-f-i)*b>=0,A=l.top+(_("bottom")+f+i)*b<=l.viewportHeight;k==="top"&&!B&&A?k="bottom":k==="bottom"&&!A&&B&&(k="top")}if(l.viewportWidth){const B=l.left+(h-r-i)*$>=0,A=l.left+(h+r+i)*$<=l.viewportWidth;W==="left"&&!B&&A?W="right":W==="right"&&!A&&B&&(W="left")}w=`${k}-${W}`}const[d,T]=w.split("-"),v=_(d);return{placement:w,tx:h,ty:v,bx:T==="left"?h-r-i:h+i,by:d==="top"?v-f-i:v+i,w:r,h:f}}const ct=["tx","ty","bx","by"],ut=["tx","ty"];function dt(){return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function ft(e,t,n,l){let o=0;const u=()=>{typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(o)};if(!t||!e||n<=0||typeof requestAnimationFrame>"u"||dt())return l(t),{cancel:u};const a=performance.now(),i=r=>{const f=Math.min(1,(r-a)/n),h=1-Math.pow(1-f,3),g={...t},E=t.placement==="manual"?ut:ct;for(const c of E)g[c]=e[c]+(t[c]-e[c])*h;l(g),f<1&&(o=requestAnimationFrame(i))};return o=requestAnimationFrame(i),{cancel:u}}function tt(e){const{geometry:t,strokeWidth:n,radius:l,tailBaseWidth:o}=e,{placement:u,tx:a,ty:i,bx:r,by:f,w:h,h:g}=t,E=parseFloat(l)*(l.endsWith("%")?Math.min(h,g)/100:1)||0,c=o/2,_=(y,m,R)=>m>R?(m+R)/2:Math.min(R,Math.max(m,y));let w=null,d=0;if(u==="manual"){const y=Math.max(r-a,a-(r+h),0),m=Math.max(f-i,i-(f+g),0);if(y>0&&y>=m)w=a<r?"left":"right",d=i;else if(m>0)w=i<f?"top":"bottom",d=a;else return null}else if(u!=="none"){const[y,m]=u.split("-");w=m==="left"?"right":"left",d=f+g*(y==="top"?.65:.35)}else return null;const T=w==="top"||w==="bottom",v={left:(y,m)=>[r-m,y],right:(y,m)=>[r+h+m,y],top:(y,m)=>[y,f-m],bottom:(y,m)=>[y,f+g+m]}[w],k=T?r:f,W=T?r+h:f+g,$=_(d,k+c+n/2+E,W-c-n/2-E),b=([y,m])=>`${y} ${m}`,B=n>0?-n/2:0,A=2,P=2,s=$-c,x=$+c,z=v(s-A,B),S=v(s,B),C=v(x,B),M=v(x+A,B),F=v(s,-(n+P)),O=v(x,-(n+P)),L=v(s,1),I=v(x,1);return{fill:`M ${b(F)} L ${b(L)} L ${b(S)} L ${a} ${i} L ${b(C)} L ${b(I)} L ${b(O)} Z`,stroke:n?`M ${b(z)} L ${b(S)} L ${a} ${i} L ${b(C)} L ${b(M)}`:null}}const pt=["left","top","right","bottom","width","height","transform","translate","inset","inset-inline","inset-block"];function ht(e){return{hasTarget:e,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"}}function D(e,t){return e===t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function mt(e,t){return e===t?!0:!e||!t?!1:e.placement===t.placement&&e.tx===t.tx&&e.ty===t.ty&&e.bx===t.bx&&e.by===t.by&&e.w===t.w&&e.h===t.h}function gt(e,t){return e.hasTarget===t.hasTarget&&e.placement===t.placement&&e.boxFill===t.boxFill&&e.boxStroke===t.boxStroke&&e.boxStrokeWidth===t.boxStrokeWidth&&e.boxZIndex===t.boxZIndex&&D(e.tip,t.tip)&&D(e.slotTip,t.slotTip)&&Y(e.boxStyle,t.boxStyle)&&Y(e.svgStyle,t.svgStyle)&&e.tail?.fill===t.tail?.fill&&e.tail?.stroke===t.tail?.stroke}function V(e){if(typeof e.checkVisibility=="function")return e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function X(e){const t=e.style;return pt.map(n=>t.getPropertyValue(n)).join("|")}function et(e){it();let t={...G},n=null,l=null,o=null,u={left:0,top:0,width:0,height:0,scaleX:1,scaleY:1,viewportWidth:0,viewportHeight:0},a=null,i=null,r=null,f=null,h=null,g=null,E=ht(!1),c=!1,_="";const w=()=>{const s=d();gt(E,s)||(E=s,e.onChange?.(E))};function d(){const s=t.target!=null,x=t.placement==="manual",z=s?a?.placement??"none":"none",S={"--pb-padding":typeof t.padding=="number"?`${t.padding}px`:t.padding};if(t.maxWidth!=null&&(S["--pb-max-width"]=`${t.maxWidth}px`),t.shadow&&(S.filter=lt),!s)S["--pb-width"]="fit-content";else if(Object.assign(S,{position:"absolute",pointerEvents:"auto",overflow:"visible"}),x)S["--pb-width"]="fit-content";else if(Object.assign(S,{left:`${a?.bx??0}px`,top:`${a?.by??0}px`,margin:"0"}),t.maxWidth==null&&n){const O=U(n,u,t.tailLength),L=i?.placement??t.placement,I=L==="auto"?J(O):L.split("-")[1];S["--pb-max-width"]=`${O[I]}px`}const C=o?.zIndex;C&&C!=="auto"&&(S.zIndex=C);const M=s&&a&&o?tt({geometry:a,strokeWidth:o.strokeWidth,radius:o.radius,tailBaseWidth:t.tailBaseWidth}):null;let F={};if(M&&a&&u.width&&u.height){const O=o?.borderLeft??0,L=o?.borderTop??0;F={position:"absolute",left:`${-a.bx-O}px`,top:`${-a.by-L}px`,width:`${u.width}px`,height:`${u.height}px`,overflow:"visible",pointerEvents:"none",zIndex:o?.zIndex??"auto"}}return{hasTarget:s,placement:z,tip:n,slotTip:i?{x:i.tx,y:i.ty}:n,boxStyle:S,svgStyle:F,tail:M,boxFill:o?.fill??"",boxStroke:o?.stroke??"",boxStrokeWidth:o?.strokeWidth??0,boxZIndex:o?.zIndex??"auto"}}function T(){if(!n||!o){(i!==null||a!==null)&&(i=null,v(null));return}const s=U(n,u,t.tailLength),x=Q({tip:n,box:o,frame:u,placement:t.placement,targetAnchor:t.targetAnchor,targetRect:l,room:s,tailLength:t.tailLength});mt(i,x)||(i=x,v(i))}function v(s){r?.cancel(),r=ft(a,s,t.transitionDuration,x=>{a=x,w()})}function k(s){const x=at(s,u);return Y(x,o)?!1:(o=x,!0)}function W(){const s=e.getBoxEl();if(!s){n=null,l=null,o=null,i=null,a=null,c=!1,w();return}if(!V(s)){r?.cancel(),c=!0;return}const x=c;if(c=!1,t.target==null){n=null,l=null,o=null,i=null,a=null,w();return}const z=u;u=st(s);const S=!Y(u,z),C=typeof t.target=="string"?K(s).querySelector(t.target)??N(t.target):N(t.target);let M=!1,F=!1;if(C){const L=C.getBoundingClientRect(),{scaleX:I,scaleY:y,left:m,top:R}=u,j={left:(L.left-m)/I,top:(L.top-R)/y,right:(L.right-m)/I,bottom:(L.bottom-R)/y};F=!Y(j,l),F&&(l=j);const q={x:(j.left+j.right)/2,y:(j.top+j.bottom)/2};M=!D(n,q),n=q}else if(Z(t.target)){F=l!=null,l=null;const L={x:t.target.x,y:t.target.y};M=!D(n,L),n=L}else{n=null,l=null,o=null,i=null,a=null,w();return}const O=k(s);_=X(s),!(!x&&!S&&!M&&!F&&!O&&a)&&T()}function $(){W()}typeof window<"u"&&(window.addEventListener("resize",$),window.addEventListener("scroll",$,!0));const b=W;function B(s){const x=e.getBoxEl();if(!x)return;if(s.some(C=>C.attributeName==="class"||C.attributeName==="hidden")){if(!V(x)){r?.cancel(),c=!0;return}b();return}const S=X(x);S!==_&&(_=S,b())}function A(){const s=e.getBoxEl();s!==g&&(g=s,f?.disconnect(),h?.disconnect(),f=null,h=null,s&&(typeof ResizeObserver<"u"&&(f=new ResizeObserver(()=>b()),f.observe(s)),typeof MutationObserver<"u"&&(h=new MutationObserver(B),h.observe(s,{attributes:!0,attributeFilter:["style","class","hidden"]}))))}function P(){A(),b()}return{update:P,setConfig(s){t={...t,...s},P()},getConfig:()=>t,getState:()=>E,destroy(){r?.cancel(),f?.disconnect(),h?.disconnect(),g=null,typeof window<"u"&&(window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0))}}}const bt=["data-placement"],xt=["d","fill"],yt=["d","stroke","stroke-width"],nt=p.defineComponent({name:"PointingBubble",inheritAttrs:!1,__name:"PointingBubble",props:{target:{default:null},placement:{default:"auto"},targetAnchor:{default:"center"},maxWidth:{default:void 0},tailLength:{default:45},tailBaseWidth:{default:24},padding:{default:8},shadow:{type:Boolean,default:!0},transitionDuration:{default:200}},setup(e,{expose:t}){const n=e,l=p.useAttrs(),o=p.computed(()=>l.class),u=p.computed(()=>l.style),a=p.computed(()=>{const{class:d,style:T,...v}=l;return v}),i=p.ref(null),r=p.reactive({hasTarget:!1,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"});function f(d){return d==null?null:typeof d=="string"||typeof Element<"u"&&d instanceof Element?d:typeof d=="object"&&"$el"in d&&d.$el instanceof Element?d.$el:typeof d=="object"&&typeof d.x=="number"&&typeof d.y=="number"?d:null}const h=p.getCurrentInstance(),g=et({getBoxEl:()=>i.value,onChange:d=>{Object.assign(r,d),h?.update()}});function E(){g.setConfig({target:f(n.target),placement:n.placement,targetAnchor:n.targetAnchor,maxWidth:n.maxWidth,tailLength:n.tailLength,tailBaseWidth:n.tailBaseWidth,padding:n.padding,shadow:n.shadow,transitionDuration:n.transitionDuration})}p.watch(()=>[n.target,typeof n.target=="object"&&n.target&&"x"in n.target?n.target.x:null,typeof n.target=="object"&&n.target&&"y"in n.target?n.target.y:null,n.placement,n.targetAnchor,n.maxWidth,n.tailLength,n.tailBaseWidth,n.padding,n.shadow,n.transitionDuration],E,{flush:"post"}),p.onMounted(()=>{E()}),p.onBeforeUnmount(()=>{g.destroy()});function c(){g.update()}t({update:c});const _=p.computed(()=>({...u.value,...r.boxStyle})),w=p.computed(()=>r.svgStyle);return(d,T)=>(p.openBlock(),p.createElementBlock("div",p.mergeProps({ref_key:"rootRef",ref:i,class:["pointing-bubble","pointing-bubble__inner",o.value],"data-placement":r.placement},a.value,{style:_.value}),[p.renderSlot(d.$slots,"default",{placement:r.placement,tip:r.slotTip},()=>[T[0]||(T[0]=p.createElementVNode("p",{style:{margin:0,fontSize:"14px",fontWeight:600,color:"#1e293b"}}," Callout content ",-1))]),e.target&&r.tail?(p.openBlock(),p.createElementBlock("svg",{key:0,class:"pointing-bubble__svg",style:p.normalizeStyle(w.value)},[p.createElementVNode("path",{class:"pointing-bubble__path",d:r.tail.fill,fill:r.boxFill},null,8,xt),r.tail.stroke?(p.openBlock(),p.createElementBlock("path",{key:0,class:"pointing-bubble__path",d:r.tail.stroke,fill:"none",stroke:r.boxStroke,"stroke-width":r.boxStrokeWidth,"stroke-linejoin":"round","stroke-linecap":"butt"},null,8,yt)):p.createCommentVNode("",!0)],4)):p.createCommentVNode("",!0)],16,bt))}});exports.DEFAULT_BUBBLE_CONFIG=G;exports.PointingBubble=nt;exports.buildTailPaths=tt;exports.computeGeometry=Q;exports.createBubbleController=et;exports.default=nt;exports.isPoint=Z;exports.resolveElement=N;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as et, useAttrs as nt, computed as j, ref as ot, reactive as it, getCurrentInstance as lt, watch as rt, onMounted as st, onBeforeUnmount as at, openBlock as H, createElementBlock as q, mergeProps as ct, renderSlot as ut, createElementVNode as X, normalizeStyle as dt, createCommentVNode as U } from "vue";
|
|
2
|
+
const ft = {
|
|
3
3
|
target: null,
|
|
4
4
|
placement: "auto",
|
|
5
5
|
targetAnchor: "center",
|
|
@@ -8,7 +8,7 @@ const xt = {
|
|
|
8
8
|
padding: 8,
|
|
9
9
|
shadow: !0,
|
|
10
10
|
transitionDuration: 200
|
|
11
|
-
},
|
|
11
|
+
}, V = "pointing-bubble-styles", pt = `:where(.pointing-bubble__inner) {
|
|
12
12
|
box-sizing: border-box;
|
|
13
13
|
width: var(--pb-width, max-content);
|
|
14
14
|
max-width: var(--pb-max-width, none);
|
|
@@ -16,22 +16,22 @@ const xt = {
|
|
|
16
16
|
background: white;
|
|
17
17
|
border: 2px solid gray;
|
|
18
18
|
border-radius: 8px;
|
|
19
|
-
}`,
|
|
20
|
-
function
|
|
21
|
-
if (e.getElementById(
|
|
19
|
+
}`, ht = "drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))";
|
|
20
|
+
function mt(e = document) {
|
|
21
|
+
if (e.getElementById(V)) return;
|
|
22
22
|
const t = e.createElement("style");
|
|
23
|
-
t.id =
|
|
23
|
+
t.id = V, t.textContent = pt, e.head.prepend(t);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function gt(e) {
|
|
26
26
|
return typeof e == "object" && e !== null && typeof e.x == "number" && typeof e.y == "number" && e.nodeType !== 1;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Z(e) {
|
|
29
29
|
return typeof Element > "u" || e == null ? null : typeof e == "string" ? document.querySelector(e) : e instanceof Element ? e : null;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function D(e, t) {
|
|
32
32
|
return !e || !t ? !1 : Object.keys(e).every((n) => e[n] === t[n]);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Q(e) {
|
|
35
35
|
let t = e.parentElement;
|
|
36
36
|
for (; t; ) {
|
|
37
37
|
const n = getComputedStyle(t).position;
|
|
@@ -41,150 +41,142 @@ function lt(e) {
|
|
|
41
41
|
}
|
|
42
42
|
return document.documentElement;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
for (; n; ) {
|
|
47
|
-
const l = Number.parseFloat(getComputedStyle(n).zoom);
|
|
48
|
-
Number.isFinite(l) && l > 0 && (t *= l), n = n.parentElement;
|
|
49
|
-
}
|
|
50
|
-
return t;
|
|
51
|
-
}
|
|
52
|
-
function kt(e) {
|
|
53
|
-
const t = e.getBoundingClientRect(), n = getComputedStyle(e), l = parseFloat(n.width) || 0, o = parseFloat(n.height) || 0;
|
|
44
|
+
function bt(e) {
|
|
45
|
+
const t = e.getBoundingClientRect(), n = getComputedStyle(e), i = parseFloat(n.width) || 0, o = parseFloat(n.height) || 0;
|
|
54
46
|
return {
|
|
55
47
|
left: t.left,
|
|
56
48
|
top: t.top,
|
|
57
|
-
width:
|
|
49
|
+
width: i,
|
|
58
50
|
height: o,
|
|
59
|
-
scaleX:
|
|
51
|
+
scaleX: i ? t.width / i : 1,
|
|
60
52
|
scaleY: o ? t.height / o : 1,
|
|
61
53
|
viewportWidth: window.innerWidth,
|
|
62
54
|
viewportHeight: window.innerHeight
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
57
|
+
function xt(e) {
|
|
58
|
+
return bt(Q(e));
|
|
67
59
|
}
|
|
68
|
-
function
|
|
69
|
-
const
|
|
60
|
+
function yt(e, t) {
|
|
61
|
+
const n = getComputedStyle(e), { scaleX: i, scaleY: o, left: u, top: a } = t, l = e.getBoundingClientRect();
|
|
70
62
|
return {
|
|
71
|
-
x: (
|
|
72
|
-
y: (
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
75
|
-
fill:
|
|
76
|
-
stroke:
|
|
77
|
-
strokeWidth: parseFloat(
|
|
63
|
+
x: (l.left - u) / i,
|
|
64
|
+
y: (l.top - a) / o,
|
|
65
|
+
width: l.width / i,
|
|
66
|
+
height: l.height / o,
|
|
67
|
+
fill: n.backgroundColor,
|
|
68
|
+
stroke: n.borderTopColor,
|
|
69
|
+
strokeWidth: parseFloat(n.borderTopWidth) || 0,
|
|
78
70
|
// Abspos SVG is positioned against the padding edge; path math uses the
|
|
79
71
|
// border box from getBoundingClientRect — subtract these when offsetting.
|
|
80
|
-
borderLeft: (parseFloat(
|
|
81
|
-
borderTop: (parseFloat(
|
|
82
|
-
radius:
|
|
83
|
-
zIndex:
|
|
72
|
+
borderLeft: (parseFloat(n.borderLeftWidth) || 0) / i,
|
|
73
|
+
borderTop: (parseFloat(n.borderTopWidth) || 0) / o,
|
|
74
|
+
radius: n.borderTopLeftRadius,
|
|
75
|
+
zIndex: n.zIndex
|
|
84
76
|
};
|
|
85
77
|
}
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
let o =
|
|
89
|
-
return t.viewportWidth && (o = Math.min(o, t.left / t.scaleX +
|
|
78
|
+
function G(e, t, n) {
|
|
79
|
+
const i = e.x - n;
|
|
80
|
+
let o = i, u = t.width ? t.width - e.x - n : 1 / 0;
|
|
81
|
+
return t.viewportWidth && (o = Math.min(o, t.left / t.scaleX + i), u = Math.min(
|
|
90
82
|
u,
|
|
91
83
|
(t.viewportWidth - t.left) / t.scaleX - e.x - n
|
|
92
84
|
)), { left: Math.max(0, o), right: Math.max(0, u) };
|
|
93
85
|
}
|
|
94
|
-
function
|
|
86
|
+
function tt(e) {
|
|
95
87
|
return e.left > e.right ? "left" : "right";
|
|
96
88
|
}
|
|
97
|
-
function
|
|
98
|
-
const { tip: t, box: n, frame:
|
|
89
|
+
function wt(e) {
|
|
90
|
+
const { tip: t, box: n, frame: i, placement: o, targetRect: u, room: a, tailLength: l } = e;
|
|
99
91
|
if (!n.width || !n.height) return null;
|
|
100
|
-
const { width:
|
|
101
|
-
if (
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
if (!(
|
|
105
|
-
const
|
|
106
|
-
return { placement: "manual", tx:
|
|
92
|
+
const { width: r, height: f } = n, { x: p, y: m } = t, k = o === "manual", c = e.targetAnchor === "edge" ? u : null;
|
|
93
|
+
if (k) {
|
|
94
|
+
if (c) {
|
|
95
|
+
const S = n.x + r / 2, W = n.y + f / 2;
|
|
96
|
+
if (!(S >= c.left && S <= c.right && W >= c.top && W <= c.bottom)) {
|
|
97
|
+
const g = Math.min(c.right, Math.max(c.left, S)), E = Math.min(c.bottom, Math.max(c.top, W));
|
|
98
|
+
return { placement: "manual", tx: g, ty: E, bx: n.x, by: n.y, w: r, h: f };
|
|
107
99
|
}
|
|
108
100
|
}
|
|
109
|
-
return { placement: "manual", tx:
|
|
101
|
+
return { placement: "manual", tx: p, ty: m, bx: n.x, by: n.y, w: r, h: f };
|
|
110
102
|
}
|
|
111
|
-
const
|
|
112
|
-
let
|
|
103
|
+
const $ = (S) => c ? S === "top" ? c.top : c.bottom : m;
|
|
104
|
+
let y = o;
|
|
113
105
|
if (o === "auto") {
|
|
114
|
-
let
|
|
115
|
-
const { scaleX:
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
|
|
106
|
+
let S = m > (i.height || 600) / 2 ? "top" : "bottom", W = tt(a);
|
|
107
|
+
const { scaleX: C, scaleY: g } = i;
|
|
108
|
+
if (i.viewportHeight) {
|
|
109
|
+
const E = i.top + ($("top") - f - l) * g >= 0, A = i.top + ($("bottom") + f + l) * g <= i.viewportHeight;
|
|
110
|
+
S === "top" && !E && A ? S = "bottom" : S === "bottom" && !A && E && (S = "top");
|
|
119
111
|
}
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
|
|
112
|
+
if (i.viewportWidth) {
|
|
113
|
+
const E = i.left + (p - r - l) * C >= 0, A = i.left + (p + r + l) * C <= i.viewportWidth;
|
|
114
|
+
W === "left" && !E && A ? W = "right" : W === "right" && !A && E && (W = "left");
|
|
123
115
|
}
|
|
124
|
-
|
|
116
|
+
y = `${S}-${W}`;
|
|
125
117
|
}
|
|
126
|
-
const [
|
|
118
|
+
const [d, _] = y.split("-"), w = $(d);
|
|
127
119
|
return {
|
|
128
|
-
placement:
|
|
129
|
-
tx:
|
|
130
|
-
ty:
|
|
131
|
-
bx:
|
|
132
|
-
by:
|
|
133
|
-
w:
|
|
134
|
-
h:
|
|
120
|
+
placement: y,
|
|
121
|
+
tx: p,
|
|
122
|
+
ty: w,
|
|
123
|
+
bx: _ === "left" ? p - r - l : p + l,
|
|
124
|
+
by: d === "top" ? w - f - l : w + l,
|
|
125
|
+
w: r,
|
|
126
|
+
h: f
|
|
135
127
|
};
|
|
136
128
|
}
|
|
137
|
-
const
|
|
138
|
-
function
|
|
129
|
+
const vt = ["tx", "ty", "bx", "by"], St = ["tx", "ty"];
|
|
130
|
+
function kt() {
|
|
139
131
|
return typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
140
132
|
}
|
|
141
|
-
function
|
|
133
|
+
function Wt(e, t, n, i) {
|
|
142
134
|
let o = 0;
|
|
143
135
|
const u = () => {
|
|
144
136
|
typeof cancelAnimationFrame < "u" && cancelAnimationFrame(o);
|
|
145
137
|
};
|
|
146
|
-
if (!t || !e || n <= 0 || typeof requestAnimationFrame > "u" ||
|
|
147
|
-
return
|
|
148
|
-
const
|
|
149
|
-
const
|
|
150
|
-
for (const
|
|
151
|
-
|
|
152
|
-
|
|
138
|
+
if (!t || !e || n <= 0 || typeof requestAnimationFrame > "u" || kt())
|
|
139
|
+
return i(t), { cancel: u };
|
|
140
|
+
const a = performance.now(), l = (r) => {
|
|
141
|
+
const f = Math.min(1, (r - a) / n), p = 1 - Math.pow(1 - f, 3), m = { ...t }, k = t.placement === "manual" ? St : vt;
|
|
142
|
+
for (const c of k)
|
|
143
|
+
m[c] = e[c] + (t[c] - e[c]) * p;
|
|
144
|
+
i(m), f < 1 && (o = requestAnimationFrame(l));
|
|
153
145
|
};
|
|
154
|
-
return o = requestAnimationFrame(
|
|
146
|
+
return o = requestAnimationFrame(l), { cancel: u };
|
|
155
147
|
}
|
|
156
|
-
function
|
|
157
|
-
const { geometry: t, strokeWidth: n, radius:
|
|
158
|
-
let
|
|
148
|
+
function Et(e) {
|
|
149
|
+
const { geometry: t, strokeWidth: n, radius: i, tailBaseWidth: o } = e, { placement: u, tx: a, ty: l, bx: r, by: f, w: p, h: m } = t, k = parseFloat(i) * (i.endsWith("%") ? Math.min(p, m) / 100 : 1) || 0, c = o / 2, $ = (x, h, O) => h > O ? (h + O) / 2 : Math.min(O, Math.max(h, x));
|
|
150
|
+
let y = null, d = 0;
|
|
159
151
|
if (u === "manual") {
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
|
|
163
|
-
else if (
|
|
164
|
-
|
|
152
|
+
const x = Math.max(r - a, a - (r + p), 0), h = Math.max(f - l, l - (f + m), 0);
|
|
153
|
+
if (x > 0 && x >= h)
|
|
154
|
+
y = a < r ? "left" : "right", d = l;
|
|
155
|
+
else if (h > 0)
|
|
156
|
+
y = l < f ? "top" : "bottom", d = a;
|
|
165
157
|
else
|
|
166
158
|
return null;
|
|
167
159
|
} else if (u !== "none") {
|
|
168
|
-
const [
|
|
169
|
-
|
|
160
|
+
const [x, h] = u.split("-");
|
|
161
|
+
y = h === "left" ? "right" : "left", d = f + m * (x === "top" ? 0.65 : 0.35);
|
|
170
162
|
} else
|
|
171
163
|
return null;
|
|
172
|
-
const
|
|
173
|
-
left: (
|
|
174
|
-
right: (
|
|
175
|
-
top: (
|
|
176
|
-
bottom: (
|
|
177
|
-
}[
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
),
|
|
164
|
+
const _ = y === "top" || y === "bottom", w = {
|
|
165
|
+
left: (x, h) => [r - h, x],
|
|
166
|
+
right: (x, h) => [r + p + h, x],
|
|
167
|
+
top: (x, h) => [x, f - h],
|
|
168
|
+
bottom: (x, h) => [x, f + m + h]
|
|
169
|
+
}[y], S = _ ? r : f, W = _ ? r + p : f + m, C = $(
|
|
170
|
+
d,
|
|
171
|
+
S + c + n / 2 + k,
|
|
172
|
+
W - c - n / 2 - k
|
|
173
|
+
), g = ([x, h]) => `${x} ${h}`, E = n > 0 ? -n / 2 : 0, A = 2, Y = 2, s = C - c, b = C + c, z = w(s - A, E), v = w(s, E), B = w(b, E), F = w(b + A, E), T = w(s, -(n + Y)), M = w(b, -(n + Y)), L = w(s, 1), I = w(b, 1);
|
|
182
174
|
return {
|
|
183
|
-
fill: `M ${
|
|
184
|
-
stroke: n ? `M ${
|
|
175
|
+
fill: `M ${g(T)} L ${g(L)} L ${g(v)} L ${a} ${l} L ${g(B)} L ${g(I)} L ${g(M)} Z`,
|
|
176
|
+
stroke: n ? `M ${g(z)} L ${g(v)} L ${a} ${l} L ${g(B)} L ${g(F)}` : null
|
|
185
177
|
};
|
|
186
178
|
}
|
|
187
|
-
const
|
|
179
|
+
const Lt = [
|
|
188
180
|
"left",
|
|
189
181
|
"top",
|
|
190
182
|
"right",
|
|
@@ -197,7 +189,7 @@ const At = [
|
|
|
197
189
|
"inset-inline",
|
|
198
190
|
"inset-block"
|
|
199
191
|
];
|
|
200
|
-
function
|
|
192
|
+
function Bt(e) {
|
|
201
193
|
return {
|
|
202
194
|
hasTarget: e,
|
|
203
195
|
placement: "none",
|
|
@@ -215,13 +207,13 @@ function Tt(e) {
|
|
|
215
207
|
function P(e, t) {
|
|
216
208
|
return e === t ? !0 : !e || !t ? !1 : e.x === t.x && e.y === t.y;
|
|
217
209
|
}
|
|
218
|
-
function
|
|
210
|
+
function $t(e, t) {
|
|
219
211
|
return e === t ? !0 : !e || !t ? !1 : e.placement === t.placement && e.tx === t.tx && e.ty === t.ty && e.bx === t.bx && e.by === t.by && e.w === t.w && e.h === t.h;
|
|
220
212
|
}
|
|
221
|
-
function
|
|
222
|
-
return e.hasTarget === t.hasTarget && e.placement === t.placement && e.boxFill === t.boxFill && e.boxStroke === t.boxStroke && e.boxStrokeWidth === t.boxStrokeWidth && e.boxZIndex === t.boxZIndex && P(e.tip, t.tip) && P(e.slotTip, t.slotTip) &&
|
|
213
|
+
function Ct(e, t) {
|
|
214
|
+
return e.hasTarget === t.hasTarget && e.placement === t.placement && e.boxFill === t.boxFill && e.boxStroke === t.boxStroke && e.boxStrokeWidth === t.boxStrokeWidth && e.boxZIndex === t.boxZIndex && P(e.tip, t.tip) && P(e.slotTip, t.slotTip) && D(e.boxStyle, t.boxStyle) && D(e.svgStyle, t.svgStyle) && e.tail?.fill === t.tail?.fill && e.tail?.stroke === t.tail?.stroke;
|
|
223
215
|
}
|
|
224
|
-
function
|
|
216
|
+
function K(e) {
|
|
225
217
|
if (typeof e.checkVisibility == "function")
|
|
226
218
|
return e.checkVisibility({
|
|
227
219
|
checkOpacity: !0,
|
|
@@ -230,13 +222,13 @@ function ot(e) {
|
|
|
230
222
|
const t = getComputedStyle(e);
|
|
231
223
|
return !(t.display === "none" || t.visibility === "hidden" || parseFloat(t.opacity) === 0);
|
|
232
224
|
}
|
|
233
|
-
function
|
|
225
|
+
function J(e) {
|
|
234
226
|
const t = e.style;
|
|
235
|
-
return
|
|
227
|
+
return Lt.map((n) => t.getPropertyValue(n)).join("|");
|
|
236
228
|
}
|
|
237
|
-
function
|
|
238
|
-
|
|
239
|
-
let t = { ...
|
|
229
|
+
function _t(e) {
|
|
230
|
+
mt();
|
|
231
|
+
let t = { ...ft }, n = null, i = null, o = null, u = {
|
|
240
232
|
left: 0,
|
|
241
233
|
top: 0,
|
|
242
234
|
width: 0,
|
|
@@ -245,48 +237,48 @@ function It(e) {
|
|
|
245
237
|
scaleY: 1,
|
|
246
238
|
viewportWidth: 0,
|
|
247
239
|
viewportHeight: 0
|
|
248
|
-
},
|
|
249
|
-
const
|
|
250
|
-
const s =
|
|
251
|
-
|
|
240
|
+
}, a = null, l = null, r = null, f = null, p = null, m = null, k = Bt(!1), c = !1, $ = "";
|
|
241
|
+
const y = () => {
|
|
242
|
+
const s = d();
|
|
243
|
+
Ct(k, s) || (k = s, e.onChange?.(k));
|
|
252
244
|
};
|
|
253
|
-
function
|
|
254
|
-
const s = t.target != null,
|
|
245
|
+
function d() {
|
|
246
|
+
const s = t.target != null, b = t.placement === "manual", z = s ? a?.placement ?? "none" : "none", v = {
|
|
255
247
|
"--pb-padding": typeof t.padding == "number" ? `${t.padding}px` : t.padding
|
|
256
248
|
};
|
|
257
|
-
if (t.maxWidth != null && (
|
|
258
|
-
|
|
259
|
-
else if (Object.assign(
|
|
249
|
+
if (t.maxWidth != null && (v["--pb-max-width"] = `${t.maxWidth}px`), t.shadow && (v.filter = ht), !s)
|
|
250
|
+
v["--pb-width"] = "fit-content";
|
|
251
|
+
else if (Object.assign(v, {
|
|
260
252
|
position: "absolute",
|
|
261
253
|
pointerEvents: "auto",
|
|
262
254
|
overflow: "visible"
|
|
263
|
-
}),
|
|
264
|
-
|
|
265
|
-
else if (Object.assign(
|
|
266
|
-
left: `${
|
|
267
|
-
top: `${
|
|
255
|
+
}), b)
|
|
256
|
+
v["--pb-width"] = "fit-content";
|
|
257
|
+
else if (Object.assign(v, {
|
|
258
|
+
left: `${a?.bx ?? 0}px`,
|
|
259
|
+
top: `${a?.by ?? 0}px`,
|
|
268
260
|
margin: "0"
|
|
269
261
|
}), t.maxWidth == null && n) {
|
|
270
|
-
const
|
|
271
|
-
|
|
262
|
+
const M = G(n, u, t.tailLength), L = l?.placement ?? t.placement, I = L === "auto" ? tt(M) : L.split("-")[1];
|
|
263
|
+
v["--pb-max-width"] = `${M[I]}px`;
|
|
272
264
|
}
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
geometry:
|
|
265
|
+
const B = o?.zIndex;
|
|
266
|
+
B && B !== "auto" && (v.zIndex = B);
|
|
267
|
+
const F = s && a && o ? Et({
|
|
268
|
+
geometry: a,
|
|
277
269
|
strokeWidth: o.strokeWidth,
|
|
278
270
|
radius: o.radius,
|
|
279
271
|
tailBaseWidth: t.tailBaseWidth
|
|
280
272
|
}) : null;
|
|
281
|
-
let
|
|
282
|
-
if (
|
|
283
|
-
const
|
|
284
|
-
|
|
273
|
+
let T = {};
|
|
274
|
+
if (F && a && u.width && u.height) {
|
|
275
|
+
const M = o?.borderLeft ?? 0, L = o?.borderTop ?? 0;
|
|
276
|
+
T = {
|
|
285
277
|
position: "absolute",
|
|
286
|
-
left: `${-
|
|
287
|
-
top: `${-
|
|
288
|
-
width: `${
|
|
289
|
-
height: `${
|
|
278
|
+
left: `${-a.bx - M}px`,
|
|
279
|
+
top: `${-a.by - L}px`,
|
|
280
|
+
width: `${u.width}px`,
|
|
281
|
+
height: `${u.height}px`,
|
|
290
282
|
overflow: "visible",
|
|
291
283
|
pointerEvents: "none",
|
|
292
284
|
zIndex: o?.zIndex ?? "auto"
|
|
@@ -296,153 +288,143 @@ function It(e) {
|
|
|
296
288
|
hasTarget: s,
|
|
297
289
|
placement: z,
|
|
298
290
|
tip: n,
|
|
299
|
-
slotTip:
|
|
300
|
-
boxStyle:
|
|
301
|
-
svgStyle:
|
|
302
|
-
tail:
|
|
291
|
+
slotTip: l ? { x: l.tx, y: l.ty } : n,
|
|
292
|
+
boxStyle: v,
|
|
293
|
+
svgStyle: T,
|
|
294
|
+
tail: F,
|
|
303
295
|
boxFill: o?.fill ?? "",
|
|
304
296
|
boxStroke: o?.stroke ?? "",
|
|
305
297
|
boxStrokeWidth: o?.strokeWidth ?? 0,
|
|
306
298
|
boxZIndex: o?.zIndex ?? "auto"
|
|
307
299
|
};
|
|
308
300
|
}
|
|
309
|
-
function
|
|
301
|
+
function _() {
|
|
310
302
|
if (!n || !o) {
|
|
311
|
-
(
|
|
303
|
+
(l !== null || a !== null) && (l = null, w(null));
|
|
312
304
|
return;
|
|
313
305
|
}
|
|
314
|
-
const s =
|
|
306
|
+
const s = G(n, u, t.tailLength), b = wt({
|
|
315
307
|
tip: n,
|
|
316
308
|
box: o,
|
|
317
|
-
frame:
|
|
309
|
+
frame: u,
|
|
318
310
|
placement: t.placement,
|
|
319
311
|
targetAnchor: t.targetAnchor,
|
|
320
|
-
targetRect:
|
|
312
|
+
targetRect: i,
|
|
321
313
|
room: s,
|
|
322
314
|
tailLength: t.tailLength
|
|
323
315
|
});
|
|
324
|
-
|
|
316
|
+
$t(l, b) || (l = b, w(l));
|
|
325
317
|
}
|
|
326
|
-
function
|
|
327
|
-
|
|
328
|
-
|
|
318
|
+
function w(s) {
|
|
319
|
+
r?.cancel(), r = Wt(
|
|
320
|
+
a,
|
|
329
321
|
s,
|
|
330
322
|
t.transitionDuration,
|
|
331
|
-
(
|
|
332
|
-
|
|
323
|
+
(b) => {
|
|
324
|
+
a = b, y();
|
|
333
325
|
}
|
|
334
326
|
);
|
|
335
327
|
}
|
|
336
|
-
function
|
|
337
|
-
const
|
|
338
|
-
return
|
|
339
|
-
|
|
328
|
+
function S(s) {
|
|
329
|
+
const b = yt(s, u);
|
|
330
|
+
return D(
|
|
331
|
+
b,
|
|
340
332
|
o
|
|
341
|
-
) ? !1 : (o =
|
|
333
|
+
) ? !1 : (o = b, !0);
|
|
342
334
|
}
|
|
343
|
-
function
|
|
335
|
+
function W() {
|
|
344
336
|
const s = e.getBoxEl();
|
|
345
337
|
if (!s) {
|
|
346
|
-
n = null,
|
|
338
|
+
n = null, i = null, o = null, l = null, a = null, c = !1, y();
|
|
347
339
|
return;
|
|
348
340
|
}
|
|
349
|
-
if (!
|
|
350
|
-
|
|
341
|
+
if (!K(s)) {
|
|
342
|
+
r?.cancel(), c = !0;
|
|
351
343
|
return;
|
|
352
344
|
}
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
n = null,
|
|
345
|
+
const b = c;
|
|
346
|
+
if (c = !1, t.target == null) {
|
|
347
|
+
n = null, i = null, o = null, l = null, a = null, y();
|
|
356
348
|
return;
|
|
357
349
|
}
|
|
358
|
-
const z =
|
|
359
|
-
u =
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
...u,
|
|
363
|
-
left: u.left * y,
|
|
364
|
-
top: u.top * y,
|
|
365
|
-
width: u.width * y / E,
|
|
366
|
-
height: u.height * y / E,
|
|
367
|
-
scaleX: u.scaleX * E,
|
|
368
|
-
scaleY: u.scaleY * E
|
|
369
|
-
};
|
|
370
|
-
const O = !j(
|
|
371
|
-
f,
|
|
350
|
+
const z = u;
|
|
351
|
+
u = xt(s);
|
|
352
|
+
const v = !D(
|
|
353
|
+
u,
|
|
372
354
|
z
|
|
373
|
-
),
|
|
374
|
-
let
|
|
375
|
-
if (
|
|
376
|
-
const
|
|
377
|
-
left: (
|
|
378
|
-
top: (
|
|
379
|
-
right: (
|
|
380
|
-
bottom: (
|
|
355
|
+
), B = typeof t.target == "string" ? Q(s).querySelector(t.target) ?? Z(t.target) : Z(t.target);
|
|
356
|
+
let F = !1, T = !1;
|
|
357
|
+
if (B) {
|
|
358
|
+
const L = B.getBoundingClientRect(), { scaleX: I, scaleY: x, left: h, top: O } = u, R = {
|
|
359
|
+
left: (L.left - h) / I,
|
|
360
|
+
top: (L.top - O) / x,
|
|
361
|
+
right: (L.right - h) / I,
|
|
362
|
+
bottom: (L.bottom - O) / x
|
|
381
363
|
};
|
|
382
|
-
|
|
364
|
+
T = !D(
|
|
383
365
|
R,
|
|
384
|
-
|
|
385
|
-
),
|
|
386
|
-
const
|
|
366
|
+
i
|
|
367
|
+
), T && (i = R);
|
|
368
|
+
const N = {
|
|
387
369
|
x: (R.left + R.right) / 2,
|
|
388
370
|
y: (R.top + R.bottom) / 2
|
|
389
371
|
};
|
|
390
|
-
|
|
391
|
-
} else if (
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
|
|
372
|
+
F = !P(n, N), n = N;
|
|
373
|
+
} else if (gt(t.target)) {
|
|
374
|
+
T = i != null, i = null;
|
|
375
|
+
const L = { x: t.target.x, y: t.target.y };
|
|
376
|
+
F = !P(n, L), n = L;
|
|
395
377
|
} else {
|
|
396
|
-
n = null,
|
|
378
|
+
n = null, i = null, o = null, l = null, a = null, y();
|
|
397
379
|
return;
|
|
398
380
|
}
|
|
399
|
-
const
|
|
400
|
-
|
|
381
|
+
const M = S(s);
|
|
382
|
+
$ = J(s), !(!b && !v && !F && !T && !M && a) && _();
|
|
401
383
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
384
|
+
function C() {
|
|
385
|
+
W();
|
|
404
386
|
}
|
|
405
|
-
typeof window < "u" && (window.addEventListener("resize",
|
|
406
|
-
const
|
|
407
|
-
function
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
387
|
+
typeof window < "u" && (window.addEventListener("resize", C), window.addEventListener("scroll", C, !0));
|
|
388
|
+
const g = W;
|
|
389
|
+
function E(s) {
|
|
390
|
+
const b = e.getBoxEl();
|
|
391
|
+
if (!b) return;
|
|
410
392
|
if (s.some(
|
|
411
|
-
(
|
|
393
|
+
(B) => B.attributeName === "class" || B.attributeName === "hidden"
|
|
412
394
|
)) {
|
|
413
|
-
if (!
|
|
414
|
-
|
|
395
|
+
if (!K(b)) {
|
|
396
|
+
r?.cancel(), c = !0;
|
|
415
397
|
return;
|
|
416
398
|
}
|
|
417
|
-
|
|
399
|
+
g();
|
|
418
400
|
return;
|
|
419
401
|
}
|
|
420
|
-
const
|
|
421
|
-
|
|
402
|
+
const v = J(b);
|
|
403
|
+
v !== $ && ($ = v, g());
|
|
422
404
|
}
|
|
423
|
-
function
|
|
405
|
+
function A() {
|
|
424
406
|
const s = e.getBoxEl();
|
|
425
|
-
s !==
|
|
407
|
+
s !== m && (m = s, f?.disconnect(), p?.disconnect(), f = null, p = null, s && (typeof ResizeObserver < "u" && (f = new ResizeObserver(() => g()), f.observe(s)), typeof MutationObserver < "u" && (p = new MutationObserver(E), p.observe(s, {
|
|
426
408
|
attributes: !0,
|
|
427
409
|
attributeFilter: ["style", "class", "hidden"]
|
|
428
410
|
}))));
|
|
429
411
|
}
|
|
430
|
-
function
|
|
431
|
-
|
|
412
|
+
function Y() {
|
|
413
|
+
A(), g();
|
|
432
414
|
}
|
|
433
415
|
return {
|
|
434
|
-
update:
|
|
416
|
+
update: Y,
|
|
435
417
|
setConfig(s) {
|
|
436
|
-
t = { ...t, ...s },
|
|
418
|
+
t = { ...t, ...s }, Y();
|
|
437
419
|
},
|
|
438
420
|
getConfig: () => t,
|
|
439
|
-
getState: () =>
|
|
421
|
+
getState: () => k,
|
|
440
422
|
destroy() {
|
|
441
|
-
|
|
423
|
+
r?.cancel(), f?.disconnect(), p?.disconnect(), m = null, typeof window < "u" && (window.removeEventListener("resize", C), window.removeEventListener("scroll", C, !0));
|
|
442
424
|
}
|
|
443
425
|
};
|
|
444
426
|
}
|
|
445
|
-
const
|
|
427
|
+
const At = ["data-placement"], Tt = ["d", "fill"], Ft = ["d", "stroke", "stroke-width"], zt = /* @__PURE__ */ et({
|
|
446
428
|
name: "PointingBubble",
|
|
447
429
|
inheritAttrs: !1,
|
|
448
430
|
__name: "PointingBubble",
|
|
@@ -458,10 +440,10 @@ const Ot = ["data-placement"], Rt = ["d", "fill"], Yt = ["d", "stroke", "stroke-
|
|
|
458
440
|
transitionDuration: { default: 200 }
|
|
459
441
|
},
|
|
460
442
|
setup(e, { expose: t }) {
|
|
461
|
-
const n = e,
|
|
462
|
-
const { class:
|
|
463
|
-
return
|
|
464
|
-
}),
|
|
443
|
+
const n = e, i = nt(), o = j(() => i.class), u = j(() => i.style), a = j(() => {
|
|
444
|
+
const { class: d, style: _, ...w } = i;
|
|
445
|
+
return w;
|
|
446
|
+
}), l = ot(null), r = it({
|
|
465
447
|
hasTarget: !1,
|
|
466
448
|
placement: "none",
|
|
467
449
|
tip: null,
|
|
@@ -474,18 +456,18 @@ const Ot = ["data-placement"], Rt = ["d", "fill"], Yt = ["d", "stroke", "stroke-
|
|
|
474
456
|
boxStrokeWidth: 0,
|
|
475
457
|
boxZIndex: "auto"
|
|
476
458
|
});
|
|
477
|
-
function
|
|
478
|
-
return
|
|
459
|
+
function f(d) {
|
|
460
|
+
return d == null ? null : typeof d == "string" || typeof Element < "u" && d instanceof Element ? d : typeof d == "object" && "$el" in d && d.$el instanceof Element ? d.$el : typeof d == "object" && typeof d.x == "number" && typeof d.y == "number" ? d : null;
|
|
479
461
|
}
|
|
480
|
-
const
|
|
481
|
-
getBoxEl: () =>
|
|
482
|
-
onChange: (
|
|
483
|
-
Object.assign(
|
|
462
|
+
const p = lt(), m = _t({
|
|
463
|
+
getBoxEl: () => l.value,
|
|
464
|
+
onChange: (d) => {
|
|
465
|
+
Object.assign(r, d), p?.update();
|
|
484
466
|
}
|
|
485
467
|
});
|
|
486
|
-
function
|
|
487
|
-
|
|
488
|
-
target:
|
|
468
|
+
function k() {
|
|
469
|
+
m.setConfig({
|
|
470
|
+
target: f(n.target),
|
|
489
471
|
placement: n.placement,
|
|
490
472
|
targetAnchor: n.targetAnchor,
|
|
491
473
|
maxWidth: n.maxWidth,
|
|
@@ -496,7 +478,7 @@ const Ot = ["data-placement"], Rt = ["d", "fill"], Yt = ["d", "stroke", "stroke-
|
|
|
496
478
|
transitionDuration: n.transitionDuration
|
|
497
479
|
});
|
|
498
480
|
}
|
|
499
|
-
|
|
481
|
+
rt(
|
|
500
482
|
() => [
|
|
501
483
|
n.target,
|
|
502
484
|
typeof n.target == "object" && n.target && "x" in n.target ? n.target.x : null,
|
|
@@ -510,71 +492,71 @@ const Ot = ["data-placement"], Rt = ["d", "fill"], Yt = ["d", "stroke", "stroke-
|
|
|
510
492
|
n.shadow,
|
|
511
493
|
n.transitionDuration
|
|
512
494
|
],
|
|
513
|
-
|
|
495
|
+
k,
|
|
514
496
|
{ flush: "post" }
|
|
515
|
-
),
|
|
516
|
-
|
|
517
|
-
}),
|
|
518
|
-
|
|
497
|
+
), st(() => {
|
|
498
|
+
k();
|
|
499
|
+
}), at(() => {
|
|
500
|
+
m.destroy();
|
|
519
501
|
});
|
|
520
|
-
function
|
|
521
|
-
|
|
502
|
+
function c() {
|
|
503
|
+
m.update();
|
|
522
504
|
}
|
|
523
|
-
t({ update:
|
|
524
|
-
const
|
|
505
|
+
t({ update: c });
|
|
506
|
+
const $ = j(
|
|
525
507
|
() => ({
|
|
526
508
|
...u.value,
|
|
527
|
-
...
|
|
509
|
+
...r.boxStyle
|
|
528
510
|
})
|
|
529
|
-
),
|
|
530
|
-
return (
|
|
511
|
+
), y = j(() => r.svgStyle);
|
|
512
|
+
return (d, _) => (H(), q("div", ct({
|
|
531
513
|
ref_key: "rootRef",
|
|
532
|
-
ref:
|
|
514
|
+
ref: l,
|
|
533
515
|
class: ["pointing-bubble", "pointing-bubble__inner", o.value],
|
|
534
|
-
"data-placement":
|
|
535
|
-
},
|
|
536
|
-
|
|
537
|
-
placement:
|
|
538
|
-
tip:
|
|
516
|
+
"data-placement": r.placement
|
|
517
|
+
}, a.value, { style: $.value }), [
|
|
518
|
+
ut(d.$slots, "default", {
|
|
519
|
+
placement: r.placement,
|
|
520
|
+
tip: r.slotTip
|
|
539
521
|
}, () => [
|
|
540
|
-
|
|
522
|
+
_[0] || (_[0] = X("p", { style: {
|
|
541
523
|
margin: 0,
|
|
542
524
|
fontSize: "14px",
|
|
543
525
|
fontWeight: 600,
|
|
544
526
|
color: "#1e293b"
|
|
545
527
|
} }, " Callout content ", -1))
|
|
546
528
|
]),
|
|
547
|
-
e.target &&
|
|
529
|
+
e.target && r.tail ? (H(), q("svg", {
|
|
548
530
|
key: 0,
|
|
549
531
|
class: "pointing-bubble__svg",
|
|
550
|
-
style:
|
|
532
|
+
style: dt(y.value)
|
|
551
533
|
}, [
|
|
552
|
-
|
|
534
|
+
X("path", {
|
|
553
535
|
class: "pointing-bubble__path",
|
|
554
|
-
d:
|
|
555
|
-
fill:
|
|
556
|
-
}, null, 8,
|
|
557
|
-
|
|
536
|
+
d: r.tail.fill,
|
|
537
|
+
fill: r.boxFill
|
|
538
|
+
}, null, 8, Tt),
|
|
539
|
+
r.tail.stroke ? (H(), q("path", {
|
|
558
540
|
key: 0,
|
|
559
541
|
class: "pointing-bubble__path",
|
|
560
|
-
d:
|
|
542
|
+
d: r.tail.stroke,
|
|
561
543
|
fill: "none",
|
|
562
|
-
stroke:
|
|
563
|
-
"stroke-width":
|
|
544
|
+
stroke: r.boxStroke,
|
|
545
|
+
"stroke-width": r.boxStrokeWidth,
|
|
564
546
|
"stroke-linejoin": "round",
|
|
565
547
|
"stroke-linecap": "butt"
|
|
566
|
-
}, null, 8,
|
|
567
|
-
], 4)) :
|
|
568
|
-
], 16,
|
|
548
|
+
}, null, 8, Ft)) : U("", !0)
|
|
549
|
+
], 4)) : U("", !0)
|
|
550
|
+
], 16, At));
|
|
569
551
|
}
|
|
570
552
|
});
|
|
571
553
|
export {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
554
|
+
ft as DEFAULT_BUBBLE_CONFIG,
|
|
555
|
+
zt as PointingBubble,
|
|
556
|
+
Et as buildTailPaths,
|
|
557
|
+
wt as computeGeometry,
|
|
558
|
+
_t as createBubbleController,
|
|
559
|
+
zt as default,
|
|
560
|
+
gt as isPoint,
|
|
561
|
+
Z as resolveElement
|
|
580
562
|
};
|