PageSourceSearch

https://www.stjernen.no/assets/SyTooltip-CDUUPweC.js

js stjernen.no collected 2026-10-02 22:09:56 UTC 2,837 bytes, 1 lines download raw bytes

1import{e as C}from"./popper.esm-d__YpLP1.js";import{ab as I,cv as L,r as g,j as z,n as F,z as M,an as c,C as v,D as S,E as V,I as k,ag as D,J as N,bc as G,G as H,K as $,Y as B,B as W}from"./index-BO6Ka_k5.js";const a=8,m=8,j=I({name:"SyTooltip",components:{Popper:C},props:{placement:{type:String,default:"top"},appendToBody:{type:Boolean,default:!1},stickyPlacement:{type:String,default:""}},setup(e){const o=g(null),f=g(null),T=g(!1),h=g({position:"fixed",top:"0",left:"0",zIndex:9999});let d=null,p=null;const n=z(()=>e.placement),r=t=>{t&&clearTimeout(t)},R=()=>{var t;return e.stickyPlacement&&((t=o.value)!=null&&t.closest(".sticky-header"))?e.stickyPlacement.split("-")[0]:e.placement.split("-")[0]},w=(t,i,s)=>Math.min(Math.max(t,m),Math.max(m,s-i-m)),u=()=>{if(!o.value||!f.value)return;const t=o.value.getBoundingClientRect(),i=f.value.getBoundingClientRect(),s=R();let l=t.top-i.height-a,y=t.left+t.width/2-i.width/2;s==="bottom"?l=t.bottom+a:s==="left"?(l=t.top+t.height/2-i.height/2,y=t.left-i.width-a):s==="right"&&(l=t.top+t.height/2-i.height/2,y=t.right+a),l<m&&s==="top"?l=t.bottom+a:l+i.height>window.innerHeight-m&&s==="bottom"&&(l=t.top-i.height-a),h.value={position:"fixed",top:`${w(l,i.height,window.innerHeight)}px`,left:`${w(y,i.width,window.innerWidth)}px`,zIndex:9999}},E=()=>{window.addEventListener("scroll",u,!0),window.addEventListener("resize",u)},P=()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)},O=()=>{r(p),r(d),d=setTimeout(async()=>{T.value=!0,await F(),u(),E()},200)},b=()=>{r(d),r(p),p=setTimeout(()=>{T.value=!1,P()},100)};return L(()=>{r(d),r(p),P()}),{isSSR:!1,triggerRef:o,tooltipRef:f,isTooltipOpen:T,tooltipStyle:h,popperPlacement:n,openTooltip:O,closeTooltip:b}}});function A(e,o,f,T,h,d){const p=W("Popper");return e.isSSR?c(e.$slots,"default",{key:0},void 0,!0):e.appendToBody?(v(),S(H,{key:1},[V("span",{ref:"triggerRef",class:"tooltip-trigger",onMouseenter:o[
10]||(o[0]=(...n)=>e.openTooltip&&e.openTooltip(...n)),onMouseleave:o[1]||(o[1]=(...n)=>e.closeTooltip&&e.closeTooltip(...n)),onFocusin:o[2]||(o[2]=(...n)=>e.openTooltip&&e.openTooltip(...n)),onFocusout:o[3]||(o[3]=(...n)=>e.closeTooltip&&e.closeTooltip(...n))},[c(e.$slots,"default",{},void 0,!0)],544),(v(),k(G,{to:"body"},[e.isTooltipOpen?(v(),S("div",{key:0,ref:"tooltipRef",class:"teleported-popper",style:D(e.tooltipStyle),role:"tooltip"},[c(e.$slots,"content",{close:e.closeTooltip,isOpen:e.isTooltipOpen},void 0,!0)],4)):N("",!0)]))],64)):(v(),k(p,B({key:2},e.$attrs,{"open-delay":"200","close-delay":"100",hover:"",placement:e.popperPlacement}),{content:$(n=>[c(e.$slots,"content",B(n,{class:"tooltip-popper"}),void 0,!0)]),default:$(()=>[c(e.$slots,"default",{},void 0,!0)]),_:3},16,["placement"]))}const U=M(j,[["render",A],["__scopeId","data-v-91f722de"]]);export{U as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.