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