v-float 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +210 -0
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.d.ts.map +1 -0
- package/dist/composables/interactions/index.d.ts +6 -0
- package/dist/composables/interactions/index.d.ts.map +1 -0
- package/dist/composables/interactions/use-click.d.ts +52 -0
- package/dist/composables/interactions/use-click.d.ts.map +1 -0
- package/dist/composables/interactions/use-client-point.d.ts +58 -0
- package/dist/composables/interactions/use-client-point.d.ts.map +1 -0
- package/dist/composables/interactions/use-dismiss.d.ts +68 -0
- package/dist/composables/interactions/use-dismiss.d.ts.map +1 -0
- package/dist/composables/interactions/use-focus.d.ts +30 -0
- package/dist/composables/interactions/use-focus.d.ts.map +1 -0
- package/dist/composables/interactions/use-hover.d.ts +64 -0
- package/dist/composables/interactions/use-hover.d.ts.map +1 -0
- package/dist/composables/middlewares/arrow.d.ts +26 -0
- package/dist/composables/middlewares/arrow.d.ts.map +1 -0
- package/dist/composables/middlewares/index.d.ts +3 -0
- package/dist/composables/middlewares/index.d.ts.map +1 -0
- package/dist/composables/use-arrow.d.ts +46 -0
- package/dist/composables/use-arrow.d.ts.map +1 -0
- package/dist/composables/use-floating-tree.d.ts +48 -0
- package/dist/composables/use-floating-tree.d.ts.map +1 -0
- package/dist/composables/use-floating.d.ts +161 -0
- package/dist/composables/use-floating.d.ts.map +1 -0
- package/dist/composables/use-tree.d.ts +151 -0
- package/dist/composables/use-tree.d.ts.map +1 -0
- package/dist/composables/utils/dom.d.ts +11 -0
- package/dist/composables/utils/dom.d.ts.map +1 -0
- package/dist/composables/utils/use-composition.d.ts +4 -0
- package/dist/composables/utils/use-composition.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +9 -0
- package/dist/utils/dom.d.ts.map +1 -0
- package/dist/utils/id.d.ts +2 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/reactivity.d.ts +2 -0
- package/dist/utils/reactivity.d.ts.map +1 -0
- package/dist/utils/type-guards.d.ts +8 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/v-float.es.js +1956 -0
- package/dist/v-float.umd.js +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(E,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(E=typeof globalThis<"u"?globalThis:E||self,a(E.VFloat={},E.Vue))})(this,function(E,a){"use strict";var Ln=Object.defineProperty;var at=E=>{throw TypeError(E)};var On=(E,a,C)=>a in E?Ln(E,a,{enumerable:!0,configurable:!0,writable:!0,value:C}):E[a]=C;var Q=(E,a,C)=>On(E,typeof a!="symbol"?a+"":a,C),Se=(E,a,C)=>a.has(E)||at("Cannot "+C);var Ve=(E,a,C)=>(Se(E,a,"read from private field"),C?C.call(E):a.get(E)),we=(E,a,C)=>a.has(E)?at("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(E):a.set(E,C),Ne=(E,a,C,ie)=>(Se(E,a,"write to private field"),ie?ie.call(E,C):a.set(E,C),C),ke=(E,a,C)=>(Se(E,a,"access private method"),C);var le,ce,ae,Fe;function C(e,t){const n=ie(e);return Math.round(t*n)/n}function ie(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}let ut=0;function ft(){return`vfloat-id-${ut++}`}const dt=["top","right","bottom","left"],Z=Math.min,U=Math.max,ue=Math.round,fe=Math.floor,k=e=>({x:e,y:e}),ht={left:"right",right:"left",bottom:"top",top:"bottom"},pt={start:"end",end:"start"};function ye(e,t,n){return U(e,Z(t,n))}function z(e,t){return typeof e=="function"?e(t):e}function q(e){return e.split("-")[0]}function re(e){return e.split("-")[1]}function He(e){return e==="x"?"y":"x"}function xe(e){return e==="y"?"height":"width"}function ee(e){return["top","bottom"].includes(q(e))?"y":"x"}function be(e){return He(ee(e))}function mt(e,t,n){n===void 0&&(n=!1);const o=re(e),i=be(e),s=xe(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=de(r)),[r,de(r)]}function vt(e){const t=de(e);return[Ee(e),t,Ee(t)]}function Ee(e){return e.replace(/start|end/g,t=>pt[t])}function gt(e,t,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?s:r;default:return[]}}function wt(e,t,n,o){const i=re(e);let s=gt(q(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(Ee)))),s}function de(e){return e.replace(/left|right|bottom|top/g,t=>ht[t])}function yt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Be(e){return typeof e!="number"?yt(e):{top:e,right:e,bottom:e,left:e}}function he(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function We(e,t,n){let{reference:o,floating:i}=e;const s=ee(t),r=be(t),l=xe(r),u=q(t),c=s==="y",d=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,g=o[l]/2-i[l]/2;let p;switch(u){case"top":p={x:d,y:o.y-i.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-i.width,y:f};break;default:p={x:o.x,y:o.y}}switch(re(t)){case"start":p[r]-=g*(n&&c?-1:1);break;case"end":p[r]+=g*(n&&c?-1:1);break}return p}const xt=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),u=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=We(c,o,u),g=o,p={},v=0;for(let h=0;h<l.length;h++){const{name:m,fn:y}=l[h],{x:L,y:b,data:w,reset:T}=await y({x:d,y:f,initialPlacement:o,placement:g,strategy:i,middlewareData:p,rects:c,platform:r,elements:{reference:e,floating:t}});d=L??d,f=b??f,p={...p,[m]:{...p[m],...w}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(c=T.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:d,y:f}=We(c,g,u)),h=-1)}return{x:d,y:f,placement:g,strategy:i,middlewareData:p}};async function pe(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=z(t,e),v=Be(p),m=l[g?f==="floating"?"reference":"floating":f],y=he(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:u})),L=f==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},T=he(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:L,offsetParent:b,strategy:u}):L);return{top:(y.top-T.top+v.top)/w.y,bottom:(T.bottom-y.bottom+v.bottom)/w.y,left:(y.left-T.left+v.left)/w.x,right:(T.right-y.right+v.right)/w.x}}const bt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:l,middlewareData:u}=t,{element:c,padding:d=0}=z(e,t)||{};if(c==null)return{};const f=Be(d),g={x:n,y:o},p=be(i),v=xe(p),h=await r.getDimensions(c),m=p==="y",y=m?"top":"left",L=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=s.reference[v]+s.reference[p]-g[p]-s.floating[v],T=g[p]-s.reference[p],P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let O=P?P[b]:0;(!O||!await(r.isElement==null?void 0:r.isElement(P)))&&(O=l.floating[b]||s.floating[v]);const j=w/2-T/2,B=O/2-h[v]/2-1,N=Z(f[y],B),Y=Z(f[L],B),x=N,M=O-h[v]-Y,R=O/2-h[v]/2+j,X=ye(x,R,M),$=!u.arrow&&re(i)!=null&&R!==X&&s.reference[v]/2-(R<x?N:Y)-h[v]/2<0,W=$?R<x?R-x:R-M:0;return{[p]:g[p]+W,data:{[p]:X,centerOffset:R-X-W,...$&&{alignmentOffset:W}},reset:$}}}),Et=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...m}=z(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=q(i),L=ee(l),b=q(l)===l,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=g||(b||!h?[de(l)]:vt(l)),P=v!=="none";!g&&P&&T.push(...wt(l,h,v,w));const O=[l,...T],j=await pe(t,m),B=[];let N=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&B.push(j[y]),f){const R=mt(i,r,w);B.push(j[R[0]],j[R[1]])}if(N=[...N,{placement:i,overflows:B}],!B.every(R=>R<=0)){var Y,x;const R=(((Y=s.flip)==null?void 0:Y.index)||0)+1,X=O[R];if(X)return{data:{index:R,overflows:N},reset:{placement:X}};let $=(x=N.filter(W=>W.overflows[0]<=0).sort((W,_)=>W.overflows[1]-_.overflows[1])[0])==null?void 0:x.placement;if(!$)switch(p){case"bestFit":{var M;const W=(M=N.filter(_=>{if(P){const K=ee(_.placement);return K===L||K==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(K=>K>0).reduce((K,Tn)=>K+Tn,0)]).sort((_,K)=>_[1]-K[1])[0])==null?void 0:M[0];W&&($=W);break}case"initialPlacement":$=l;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function $e(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ie(e){return dt.some(t=>e[t]>=0)}const Tt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=z(e,t);switch(o){case"referenceHidden":{const s=await pe(t,{...i,elementContext:"reference"}),r=$e(s,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ie(r)}}}case"escaped":{const s=await pe(t,{...i,altBoundary:!0}),r=$e(s,n.floating);return{data:{escapedOffsets:r,escaped:Ie(r)}}}default:return{}}}}};async function Lt(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),l=re(n),u=ee(n)==="y",c=["left","top"].includes(r)?-1:1,d=s&&u?-1:1,f=z(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(p=l==="end"?v*-1:v),u?{x:p*d,y:g*c}:{x:g*c,y:p*d}}const Ot=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:l}=t,u=await Lt(t,e);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:r}}}}},Pt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:m=>{let{x:y,y:L}=m;return{x:y,y:L}}},...u}=z(e,t),c={x:n,y:o},d=await pe(t,u),f=ee(q(i)),g=He(f);let p=c[g],v=c[f];if(s){const m=g==="y"?"top":"left",y=g==="y"?"bottom":"right",L=p+d[m],b=p-d[y];p=ye(L,p,b)}if(r){const m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",L=v+d[m],b=v-d[y];v=ye(L,v,b)}const h=l.fn({...t,[g]:p,[f]:v});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[g]:s,[f]:r}}}}}};function me(){return typeof window<"u"}function te(e){return je(e)?(e.nodeName||"").toLowerCase():"#document"}function A(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function F(e){var t;return(t=(je(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function je(e){return me()?e instanceof Node||e instanceof A(e).Node:!1}function D(e){return me()?e instanceof Element||e instanceof A(e).Element:!1}function H(e){return me()?e instanceof HTMLElement||e instanceof A(e).HTMLElement:!1}function Ye(e){return!me()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof A(e).ShadowRoot}function se(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Ct(e){return["table","td","th"].includes(te(e))}function ve(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Te(e){const t=Le(),n=D(e)?S(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Rt(e){let t=I(e);for(;H(t)&&!ne(t);){if(Te(t))return t;if(ve(t))return null;t=I(t)}return null}function Le(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ne(e){return["html","body","#document"].includes(te(e))}function S(e){return A(e).getComputedStyle(e)}function ge(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function I(e){if(te(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ye(e)&&e.host||F(e);return Ye(t)?t.host:t}function Xe(e){const t=I(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&se(t)?t:Xe(t)}function G(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Xe(e),s=i===((o=e.ownerDocument)==null?void 0:o.body),r=A(i);if(s){const l=Oe(r);return t.concat(r,r.visualViewport||[],se(i)?i:[],l&&n?G(l):[])}return t.concat(i,G(i,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _e(e){const t=S(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=H(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,l=ue(n)!==s||ue(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function Pe(e){return D(e)?e:e.contextElement}function oe(e){const t=Pe(e);if(!H(t))return k(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=_e(t);let r=(s?ue(n.width):n.width)/o,l=(s?ue(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Mt=k(0);function Ke(e){const t=A(e);return!Le()||!t.visualViewport?Mt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function At(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==A(e)?!1:t}function J(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Pe(e);let r=k(1);t&&(o?D(o)&&(r=oe(o)):r=oe(e));const l=At(s,n,o)?Ke(s):k(0);let u=(i.left+l.x)/r.x,c=(i.top+l.y)/r.y,d=i.width/r.x,f=i.height/r.y;if(s){const g=A(s),p=o&&D(o)?A(o):o;let v=g,h=Oe(v);for(;h&&o&&p!==v;){const m=oe(h),y=h.getBoundingClientRect(),L=S(h),b=y.left+(h.clientLeft+parseFloat(L.paddingLeft))*m.x,w=y.top+(h.clientTop+parseFloat(L.paddingTop))*m.y;u*=m.x,c*=m.y,d*=m.x,f*=m.y,u+=b,c+=w,v=A(h),h=Oe(v)}}return he({width:d,height:f,x:u,y:c})}function Ce(e,t){const n=ge(e).scrollLeft;return t?t.left+n:J(F(e)).left+n}function Ue(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:Ce(e,o)),s=o.top+t.scrollTop;return{x:i,y:s}}function Dt(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=F(o),l=t?ve(t.floating):!1;if(o===r||l&&s)return n;let u={scrollLeft:0,scrollTop:0},c=k(1);const d=k(0),f=H(o);if((f||!f&&!s)&&((te(o)!=="body"||se(r))&&(u=ge(o)),H(o))){const p=J(o);c=oe(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const g=r&&!f&&!s?Ue(r,u,!0):k(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+g.x,y:n.y*c.y-u.scrollTop*c.y+d.y+g.y}}function St(e){return Array.from(e.getClientRects())}function Vt(e){const t=F(e),n=ge(e),o=e.ownerDocument.body,i=U(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=U(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ce(e);const l=-n.scrollTop;return S(o).direction==="rtl"&&(r+=U(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}function Nt(e,t){const n=A(e),o=F(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,u=0;if(i){s=i.width,r=i.height;const c=Le();(!c||c&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:r,x:l,y:u}}function kt(e,t){const n=J(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=H(e)?oe(e):k(1),r=e.clientWidth*s.x,l=e.clientHeight*s.y,u=i*s.x,c=o*s.y;return{width:r,height:l,x:u,y:c}}function qe(e,t,n){let o;if(t==="viewport")o=Nt(e,n);else if(t==="document")o=Vt(F(e));else if(D(t))o=kt(t,n);else{const i=Ke(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return he(o)}function Ge(e,t){const n=I(e);return n===t||!D(n)||ne(n)?!1:S(n).position==="fixed"||Ge(n,t)}function Ft(e,t){const n=t.get(e);if(n)return n;let o=G(e,[],!1).filter(l=>D(l)&&te(l)!=="body"),i=null;const s=S(e).position==="fixed";let r=s?I(e):e;for(;D(r)&&!ne(r);){const l=S(r),u=Te(r);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||se(r)&&!u&&Ge(e,r))?o=o.filter(d=>d!==r):i=l,r=I(r)}return t.set(e,o),o}function Ht(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?ve(t)?[]:Ft(t,this._c):[].concat(n),o],l=r[0],u=r.reduce((c,d)=>{const f=qe(t,d,i);return c.top=U(f.top,c.top),c.right=Z(f.right,c.right),c.bottom=Z(f.bottom,c.bottom),c.left=U(f.left,c.left),c},qe(t,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Bt(e){const{width:t,height:n}=_e(e);return{width:t,height:n}}function Wt(e,t,n){const o=H(t),i=F(t),s=n==="fixed",r=J(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=k(0);if(o||!o&&!s)if((te(t)!=="body"||se(i))&&(l=ge(t)),o){const g=J(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else i&&(u.x=Ce(i));const c=i&&!o&&!s?Ue(i,l):k(0),d=r.left+l.scrollLeft-u.x-c.x,f=r.top+l.scrollTop-u.y-c.y;return{x:d,y:f,width:r.width,height:r.height}}function Re(e){return S(e).position==="static"}function Je(e,t){if(!H(e)||S(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return F(e)===n&&(n=n.ownerDocument.body),n}function Qe(e,t){const n=A(e);if(ve(e))return n;if(!H(e)){let i=I(e);for(;i&&!ne(i);){if(D(i)&&!Re(i))return i;i=I(i)}return n}let o=Je(e,t);for(;o&&Ct(o)&&Re(o);)o=Je(o,t);return o&&ne(o)&&Re(o)&&!Te(o)?n:o||Rt(e)||n}const $t=async function(e){const t=this.getOffsetParent||Qe,n=this.getDimensions,o=await n(e.floating);return{reference:Wt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function It(e){return S(e).direction==="rtl"}const jt={convertOffsetParentRelativeRectToViewportRelativeRect:Dt,getDocumentElement:F,getClippingRect:Ht,getOffsetParent:Qe,getElementRects:$t,getClientRects:St,getDimensions:Bt,getScale:oe,isElement:D,isRTL:It};function Ze(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yt(e,t){let n=null,o;const i=F(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function r(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const c=e.getBoundingClientRect(),{left:d,top:f,width:g,height:p}=c;if(l||t(),!g||!p)return;const v=fe(f),h=fe(i.clientWidth-(d+g)),m=fe(i.clientHeight-(f+p)),y=fe(d),b={rootMargin:-v+"px "+-h+"px "+-m+"px "+-y+"px",threshold:U(0,Z(1,u))||1};let w=!0;function T(P){const O=P[0].intersectionRatio;if(O!==u){if(!w)return r();O?r(!1,O):o=setTimeout(()=>{r(!1,1e-7)},1e3)}O===1&&!Ze(c,e.getBoundingClientRect())&&r(),w=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return r(!0),s}function ze(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,c=Pe(e),d=i||s?[...c?G(c):[],...G(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=c&&l?Yt(c,n):null;let g=-1,p=null;r&&(p=new ResizeObserver(y=>{let[L]=y;L&&L.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?J(e):null;u&&m();function m(){const y=J(e);h&&!Ze(h,y)&&n(),h=y,v=requestAnimationFrame(m)}return n(),()=>{var y;d.forEach(L=>{i&&L.removeEventListener("scroll",n),s&&L.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Xt=Ot,_t=Pt,Kt=Et,Ut=Tt,qt=bt,Gt=(e,t,n)=>{const o=new Map,i={platform:jt,...n},s={...i.platform,_c:o};return xt(e,t,{...i,platform:s})};function Jt(e,t,n={}){const{transform:o=!0,middlewares:i,whileElementsMounted:s,open:r=a.ref(!1),setOpen:l=b=>{r.value=b}}=n,u=a.computed(()=>a.toValue(n.placement)??"bottom"),c=a.computed(()=>a.toValue(n.strategy)??"absolute"),d=a.ref(0),f=a.ref(0),g=a.ref(u.value),p=a.ref(c.value),v=a.shallowRef({}),h=a.ref(!1),m=async()=>{if(!e.value||!t.value)return;const b=await Gt(e.value,t.value,{placement:u.value,strategy:c.value,middleware:i});d.value=b.x,f.value=b.y,g.value=b.placement,p.value=b.strategy,v.value=b.middlewareData,h.value=r.value};a.watch([u,c],()=>{r.value&&m()});let y;a.watch([e,t,r],([b,w,T])=>{!T||!b||!w||(s?y=s(b,w,m):y=ze(b,w,m),a.onWatcherCleanup(()=>{y==null||y(),y=void 0}))},{immediate:!0}),a.onScopeDispose(()=>y==null?void 0:y()),a.watch(r,b=>{b||(h.value=!1)});const L=a.computed(()=>{const b={position:p.value,left:"0",top:"0"};if(!h.value||!t.value)return b;const w=C(t.value,d.value),T=C(t.value,f.value);return a.toValue(o)?{...b,transform:`translate(${w}px, ${T}px)`,...ie(t.value)>=1.5&&{willChange:"transform"}}:{...b,left:`${w}px`,top:`${T}px`}});return{x:d,y:f,strategy:p,placement:g,middlewareData:v,isPositioned:h,floatingStyles:L,update:m,refs:{anchorEl:e,floatingEl:t},open:r,setOpen:l}}function Qt(e,t,n,o={}){return ze(e,t,n,o)}function Zt(e,t={}){const{middlewareData:n,placement:o}=e,{offset:i="-12px"}=t,s=a.computed(()=>{var u;return((u=n.value.arrow)==null?void 0:u.x)??0}),r=a.computed(()=>{var u;return((u=n.value.arrow)==null?void 0:u.y)??0}),l=a.computed(()=>{const u={top:"inset-block-end",right:"inset-inline-start",bottom:"inset-block-start",left:"inset-inline-end"}[a.toValue(o).split("-")[0]],c=s.value!=null?`${s.value}px`:"",d=r.value!=null?`${r.value}px`:"";return{"inset-inline-start":c,"inset-block-start":d,[u]:i}});return{arrowX:s,arrowY:r,arrowStyles:l}}const et=10;function zt(e){return e==="mouse"||e==="pen"}function en(e,t,n){const{delay:o}=n,i=a.computed(()=>{const c=a.toValue(o);return(typeof c=="number"?c:c.open)??0}),s=a.computed(()=>{const c=a.toValue(o);return(typeof c=="number"?c:c.close)??0});let r,l;const u=()=>{clearTimeout(r),clearTimeout(l)};return a.onScopeDispose(u),{show:c=>{u();const d=c??i.value;d===0?e():r=setTimeout(e,d)},hide:c=>{u();const d=c??s.value;d===0?t():l=setTimeout(t,d)},showDelay:i,hideDelay:s,clearTimeouts:u}}function tn(e,t={}){const{open:n,setOpen:o,refs:{anchorEl:i,floatingEl:s}}=e,{enabled:r=!0,delay:l=0,restMs:u=0,mouseOnly:c=!1}=t,d=a.computed(()=>a.toValue(r)),f=a.computed(()=>a.toValue(u)),g=a.computed(()=>{const x=i.value;return!x||x instanceof HTMLElement?x:x.contextElement??null}),{hide:p,show:v,showDelay:h,clearTimeouts:m}=en(()=>{n.value||o(!0)},()=>{n.value&&o(!1)},{delay:l});let y=null,L;const b=a.computed(()=>h.value===0&&f.value>0);function w(x){if(!d.value||!O(x)||!b.value||!y)return;const M={x:x.clientX,y:x.clientY},R=Math.abs(M.x-y.x),X=Math.abs(M.y-y.y);(R>et||X>et)&&(y=M,clearTimeout(L),L=setTimeout(()=>{v(0)},f.value))}function T(x){!d.value||!O(x)||!b.value||(y={x:x.clientX,y:x.clientY},L=setTimeout(()=>{v(0)},f.value))}function P(){clearTimeout(L),y=null}a.watchPostEffect(()=>{const x=g.value;!x||!d.value||!b.value||(x.addEventListener("pointerenter",T),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",P),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",T),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",P)}))}),a.onScopeDispose(()=>{clearTimeout(L)});function O(x){return!(a.toValue(c)&&!zt(x.pointerType))}function j(x){!d.value||!O(x)||b.value||v()}function B(x){!d.value||!O(x)||m()}function N(x){var M;!d.value||!O(x)||(M=s.value)!=null&&M.contains(x.relatedTarget)||p()}function Y(x){var M;!d.value||!O(x)||(M=g.value)!=null&&M.contains(x.relatedTarget)||p()}a.watchPostEffect(()=>{const x=g.value;!x||!d.value||(x.addEventListener("pointerenter",j),x.addEventListener("pointerleave",N),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",j),x.removeEventListener("pointerleave",N)}))}),a.watchPostEffect(()=>{const x=s.value;!x||!d.value||(x.addEventListener("pointerenter",B),x.addEventListener("pointerleave",Y),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",B),x.removeEventListener("pointerleave",Y)}))})}function nn(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}const on=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const rn=Object.prototype.toString,sn=e=>rn.call(e)==="[object Object]";function Me(e){return Array.isArray(e)?e:[e]}function ln(e,t,n){return a.watch(e,t,{...n,immediate:!0})}const cn=on?window:void 0;function an(e){var t;const n=a.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function V(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},o=(l,u,c,d)=>(l.addEventListener(u,c,d),()=>l.removeEventListener(u,c,d)),i=a.computed(()=>{const l=Me(a.toValue(e[0])).filter(u=>u!=null);return l.every(u=>typeof u!="string")?l:void 0}),s=ln(()=>{var l,u;return[(u=(l=i.value)==null?void 0:l.map(c=>an(c)))!=null?u:[cn].filter(c=>c!=null),Me(a.toValue(i.value?e[1]:e[0])),Me(a.unref(i.value?e[2]:e[1])),a.toValue(i.value?e[3]:e[2])]},([l,u,c,d])=>{if(n(),!(l!=null&&l.length)||!(u!=null&&u.length)||!(c!=null&&c.length))return;const f=sn(d)?{...d}:d;t.push(...l.flatMap(g=>u.flatMap(p=>c.map(v=>o(g,p,v,f)))))},{flush:"post"}),r=()=>{s(),n()};return nn(n),r}function un(e,t={}){const{open:n,setOpen:o,refs:{floatingEl:i,anchorEl:s}}=e,{enabled:r=!0,requireFocusVisible:l=!0}=t,u=a.computed(()=>s.value?s.value instanceof HTMLElement?s.value:s.value.contextElement:null);let c=!1,d=!0,f;V(window,"blur",()=>{!n.value&&u.value&&u.value===document.activeElement&&(c=!0)}),V(window,"focus",()=>{c=!1}),a.onMounted(()=>{tt()&&nt()&&(V(window,"keydown",()=>{d=!0},{capture:!0}),V(window,"pointerdown",()=>{d=!1},{capture:!0}))});function g(v){if(c){c=!1;return}const h=v.target;if(a.toValue(l)&&h){if(tt()&&nt()&&!v.relatedTarget){if(!d&&!fn(h))return}else if(!dn(h))return}o(!0)}function p(v){clearTimeout(f),f=window.setTimeout(()=>{var y;const m=(((y=u.value)==null?void 0:y.ownerDocument)??document).activeElement;!v.relatedTarget&&m===u.value||i.value&&m&&i.value.contains(m)||o(!1)},0)}a.watchPostEffect(()=>{if(!a.toValue(r))return;const v=u.value;!v||!(v instanceof HTMLElement)||(v.addEventListener("focus",g),v.addEventListener("blur",p),a.onWatcherCleanup(()=>{v.removeEventListener("focus",g),v.removeEventListener("blur",p)}))}),a.onScopeDispose(()=>{clearTimeout(f)})}function tt(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function nt(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function fn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}function dn(e){return e.matches(":focus-visible")}function hn(e,t={}){const{open:n,setOpen:o,refs:i}=e,{enabled:s=!0,event:r="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0}=t;let d,f=!1;const g=a.computed(()=>a.toValue(s)),p=a.computed(()=>i.anchorEl.value instanceof HTMLElement?i.anchorEl.value:null);function v(){n.value?a.toValue(l)&&o(!1):o(!0)}function h(w){d=w.pointerType}function m(w){if(w.button!==0||a.toValue(r)==="click"||ot(d)&&a.toValue(u))return;const T=w.target;!n.value&&T===p.value&&w.preventDefault(),v()}function y(){if(a.toValue(r)==="mousedown"&&d){d=void 0;return}if(ot(d)&&a.toValue(u)){d=void 0;return}v(),d=void 0}function L(w){if(d=void 0,w.defaultPrevented||!a.toValue(c)||it(w))return;const T=p.value;T&&(w.key===" "&&!rt(T)&&(w.preventDefault(),f=!0),w.key==="Enter"&&v())}function b(w){const T=p.value;T&&(w.defaultPrevented||!a.toValue(c)||it(w)||rt(T)||w.key===" "&&f&&(f=!1,v()))}a.watchPostEffect(()=>{const w=p.value;!g.value||!w||(w.addEventListener("pointerdown",h),w.addEventListener("mousedown",m),w.addEventListener("click",y),w.addEventListener("keydown",L),w.addEventListener("keyup",b),a.onWatcherCleanup(()=>{w.removeEventListener("pointerdown",h),w.removeEventListener("mousedown",m),w.removeEventListener("click",y),w.removeEventListener("keydown",L),w.removeEventListener("keyup",b)}))})}function ot(e,t){return e===void 0?!1:e==="mouse"}function it(e){return e.target instanceof HTMLElement&&e.target.tagName==="BUTTON"}function pn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function rt(e){return pn(e)}function mn(){const e=a.ref(!1);return V(document,"compositionstart",()=>{e.value=!0}),V(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function vn(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Ae(e){return e instanceof Element&&e instanceof HTMLElement}function st(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function gn(e,t){const n=t.offsetWidth-t.clientWidth,o=t.offsetHeight-t.clientHeight;return n>0&&e.clientX>t.clientWidth||o>0&&e.clientY>t.clientHeight}function wn(e,t={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:i=!0,outsidePressEvent:s="pointerdown",anchorPress:r=!1,anchorPressEvent:l="pointerdown",ancestorScroll:u=!1,capture:c}=t,d=a.computed(()=>a.toValue(n)),f=e.refs.floatingEl,g=a.computed(()=>{const w=e.refs.anchorEl.value;return w?w instanceof HTMLElement?w:w.contextElement instanceof HTMLElement?w.contextElement:null:null}),{isComposing:p}=mn(),{escapeKey:v,outsidePress:h}=vn(c);let m=!1;const y=w=>{!d.value||!e.open.value||!a.toValue(o)||w.key!=="Escape"||p()||e.setOpen(!1)},L=w=>{if(!d.value||!e.open.value)return;if(s==="click"&&m){m=!1;return}const T=a.toValue(i);if(!T||typeof T=="function"&&!T(w))return;const P=w.target;P&&(Ae(P)&&f.value&&gn(w,P)||st(w,g.value)||st(w,f.value)||e.setOpen(!1))},b=()=>{d.value&&e.open.value&&a.toValue(r)&&e.setOpen(!1)};a.watchEffect(w=>{if(!d.value||!e.open.value||!a.toValue(u))return;const T=()=>{e.open.value&&e.setOpen(!1)},P=[];g.value&&P.push(...G(g.value).filter(Ae)),f.value&&P.push(...G(f.value).filter(Ae));for(const O of P)O.addEventListener("scroll",T,{passive:!0});w(()=>{for(const O of P)O.removeEventListener("scroll",T)})}),V(document,"keydown",y,a.toValue(v)),V(document,s,L,a.toValue(h)),V(g,l,b),V(f,"mousedown",()=>{m=!0},{capture:!0}),V(f,"mouseup",()=>{m=!0},{capture:!0})}function yn(e,t,n={}){const{open:o,refs:i}=t;let s;const r=a.ref({x:null,y:null}),l=a.computed(()=>a.toValue(n.axis??"both")),u=a.computed(()=>a.toValue(n.enabled??!0)),c=a.computed(()=>a.toValue(n.x??null)),d=a.computed(()=>a.toValue(n.y??null)),f=(h,m)=>{r.value={x:h,y:m},o.value&&(i.anchorEl.value=xn(e.value,l.value,r.value))};a.watchEffect(()=>{const h=c.value,m=d.value;u.value&&h!=null&&m!=null&&f(h,m)});const g=h=>{s=h.pointerType,f(h.clientX,h.clientY)},p=h=>{s=h.pointerType,!o.value&<(s,!0)&&f(h.clientX,h.clientY)},v=h=>{o.value&<(s,!0)&&f(h.clientX,h.clientY)};return a.watchEffect(()=>{if(c.value!=null||d.value!=null)return;const h=e.value;!h||!u.value||(h.addEventListener("pointerenter",p),h.addEventListener("pointerdown",g),h.addEventListener("pointermove",v),a.onWatcherCleanup(()=>{h==null||h.removeEventListener("pointerenter",p),h==null||h.removeEventListener("pointerdown",g),h==null||h.removeEventListener("pointermove",v)}))}),{coordinates:a.readonly(r),updatePosition:f}}function xn(e,t,n){let o=null,i=null;const s=e;return{contextElement:s||void 0,getBoundingClientRect:()=>{const r=(s==null?void 0:s.getBoundingClientRect())??{width:0,height:0,x:0,y:0},l=t==="x"||t==="both",u=t==="y"||t==="both";let c=0,d=0,f=r.x,g=r.y;return s&&(o==null&&n.x!=null&&l&&(o=r.x-n.x),i==null&&n.y!=null&&u&&(i=r.y-n.y),f-=o||0,g-=i||0),l&&n.x!=null?f=n.x:(o=null,c=r.width),u&&n.y!=null?g=n.y:(i=null,d=r.height),t==="both"&&(c=0,d=0),{width:c,height:d,x:f,y:g,top:g,right:f+c,bottom:g+d,left:f}}}}function lt(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function bn(e){return{name:"arrow",options:e,fn(t){const n=a.toValue(e.element);return n==null?{}:qt({element:n,padding:e.padding}).fn(t)}}}class De{constructor(t,n=null,o={},i=!1){Q(this,"id");Q(this,"data");Q(this,"parent");Q(this,"children");we(this,le);this.id=o.id??ft(),this.data=t,this.parent=a.shallowRef(n),this.children=a.shallowRef([]),Ne(this,le,i)}addChild(t){this.children.value=[...this.children.value,t]}_removeChildInstance(t){return this.children.value.includes(t)?(this.children.value=this.children.value.filter(n=>n.id!==t.id),t.parent.value=null,!0):!1}updateData(t){const n=this.data;typeof n=="object"&&n!==null&&typeof t=="object"&&t!==null?this.data=Object.assign({},n,t):this.data=t}findChild(t){return this.children.value.find(t)??null}findDescendant(t){const n=[this];for(;n.length>0;){const o=n.pop();if(t(o))return o;for(let i=o.children.value.length-1;i>=0;i--)n.push(o.children.value[i])}return null}isDescendantOf(t){let n=this.parent.value;for(;n;){if(n.id===t.id)return!0;n=n.parent.value}return!1}getPath(){const t=[];let n=this;for(;n;)t.push(n),n=n.parent.value;return t.reverse()}get isRoot(){return Ve(this,le)}get isLeaf(){return this.children.value.length===0}}le=new WeakMap;class ct{constructor(t,n){we(this,ae);Q(this,"root");Q(this,"nodeMap");we(this,ce);Ne(this,ce,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=a.shallowReactive(new Map),this.root=new De(t,null,{},!0),this.nodeMap.set(this.root.id,this.root)}findNodeById(t){return this.nodeMap.get(t)??null}addNode(t,n=null,o={}){const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree addNode: Parent node with ID ${n} not found.`),null;o.id&&this.nodeMap.has(o.id)&&(o.id=void 0);const s=new De(t,i,o);return this.nodeMap.set(s.id,s),i.addChild(s),s}removeNode(t,n){const o=n??Ve(this,ce),i=this.findNodeById(t);if(!i)return!1;if(i.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const s=i.parent.value;if(o==="recursive")ke(this,ae,Fe).call(this,i);else{for(const r of i.children.value)r.parent.value=null;i.children.value=[],this.nodeMap.delete(i.id)}return s._removeChildInstance(i)}moveNode(t,n){const o=this.findNodeById(t);if(!o)return console.error(`Tree moveNode: Node with ID ${t} not found.`),!1;if(o.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(t===n)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree moveNode: New parent node with ID ${n} not found.`),!1;if(i.isDescendantOf(o))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const s=o.parent.value;if(s){if(!s._removeChildInstance(o))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(o.isRoot){if(o.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return i.addChild(o),o.parent.value=i,!0}traverse(t="dfs",n=this.root){const o=[];if(!n)return console.warn("Tree traverse: Start node is null, returning empty array."),o;if(t==="dfs"){const i=[n];for(;i.length>0;){const s=i.pop();o.push(s);for(let r=s.children.value.length-1;r>=0;r--)i.push(s.children.value[r])}}else{const i=[n];for(;i.length>0;){const s=i.shift();o.push(s);for(const r of s.children.value)i.push(r)}}return o}dispose(){this.nodeMap.clear()}}ce=new WeakMap,ae=new WeakSet,Fe=function(t){const n=[...t.children.value];for(const o of n)ke(this,ae,Fe).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function En(e,t={}){const n=new ct(e,t);return{get nodeMap(){return n.nodeMap},get root(){return n.root},findNodeById:r=>n.findNodeById(r),moveNode:(r,l)=>n.moveNode(r,l),dispose:()=>n.dispose(),addNode:(r,l)=>n.addNode(r,l),removeNode:(r,l)=>n.removeNode(r,l),traverse:(r,l)=>n.traverse(r,l),isTopmost:r=>{const l=n.findNodeById(r);if(!l||!l.data.open.value)return!1;let u=l.parent.value;for(;u;){if(u.data.open.value)return!1;u=u.parent.value}return!0},getAllOpenNodes:()=>{const r=[];for(const l of n.nodeMap.values())l.data.open.value&&r.push(l);return r},forEach:(r,l,u={})=>{const{relationship:c="self-and-children",applyToMatching:d=!0}=u,f=n.findNodeById(r);if(!f)return;const g=[],p=new Set,v=m=>{m&&!p.has(m.id)&&(g.push(m),p.add(m.id))},h=m=>{for(const y of m)v(y)};if(c==="ancestors-only")for(const m of f.getPath())m.id!==f.id&&v(m);else if(c==="siblings-only"){if(f.parent.value)for(const m of f.parent.value.children.value)m.id!==f.id&&v(m)}else if(c==="descendants-only")for(const m of n.traverse("dfs",f))m.id!==f.id&&v(m);else if(c==="children-only")h(f.children.value);else if(c==="self-and-ancestors")h(f.getPath());else if(c==="self-and-children")v(f),h(f.children.value);else if(c==="self-and-descendants")h(n.traverse("dfs",f));else if(c==="self-and-siblings")v(f),f.parent.value&&h(f.parent.value.children.value);else if(c==="self-ancestors-and-children")h(f.getPath()),h(f.children.value);else if(c==="full-branch")h(f.getPath()),h(n.traverse("dfs",f));else if(c==="all-except-branch"){const m=new Set;for(const y of f.getPath())m.add(y.id);for(const y of n.traverse("dfs",f))m.add(y.id);for(const y of n.nodeMap.values())!m.has(y.id)===d&&l(y);return}else{console.warn(`forEach: Unknown relationship "${c}".`);return}if(d)for(const m of g)l(m);else for(const m of n.nodeMap.values())p.has(m.id)||l(m)}}}E.Tree=ct,E.TreeNode=De,E.arrow=bn,E.autoUpdate=Qt,E.flip=Kt,E.hide=Ut,E.offset=Xt,E.shift=_t,E.useArrow=Zt,E.useClick=hn,E.useClientPoint=yn,E.useDismiss=wn,E.useFloating=Jt,E.useFloatingTree=En,E.useFocus=un,E.useHover=tn,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "v-float",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Vue 3 port of Floating UI - a library for positioning floating elements",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"types": "./dist/src/index.d.ts",
|
|
11
|
+
"main": "./dist/v-float.umd.js",
|
|
12
|
+
"module": "./dist/v-float.es.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/v-float.es.js",
|
|
17
|
+
"require": "./dist/v-float.umd.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@floating-ui/dom": "^1.6.13",
|
|
22
|
+
"@vueuse/core": "^13.0.0",
|
|
23
|
+
"vue": "^3.5.13"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"lucide-vue-next": "^0.513.0",
|
|
27
|
+
"@biomejs/biome": "1.9.4",
|
|
28
|
+
"@testing-library/vue": "^8.1.0",
|
|
29
|
+
"@tsconfig/node22": "^22.0.1",
|
|
30
|
+
"@types/jsdom": "^21.1.7",
|
|
31
|
+
"@types/node": "^22.13.14",
|
|
32
|
+
"@unocss/reset": "66.1.0-beta.7",
|
|
33
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
34
|
+
"@vitest/browser": "^3.0.9",
|
|
35
|
+
"@vitest/coverage-v8": "^3.1.1",
|
|
36
|
+
"@vitest/ui": "3.0.8",
|
|
37
|
+
"@vue/test-utils": "^2.4.6",
|
|
38
|
+
"@vue/tsconfig": "^0.7.0",
|
|
39
|
+
"jsdom": "^26.0.0",
|
|
40
|
+
"npm-run-all2": "^7.0.2",
|
|
41
|
+
"playwright": "^1.51.1",
|
|
42
|
+
"prettier": "^3.5.3",
|
|
43
|
+
"typescript": "~5.7.3",
|
|
44
|
+
"unocss": "66.1.0-beta.7",
|
|
45
|
+
"vite": "^6.2.3",
|
|
46
|
+
"vite-plugin-dts": "^4.5.3",
|
|
47
|
+
"vite-plugin-vue-devtools": "^7.7.2",
|
|
48
|
+
"vitepress": "^1.6.3",
|
|
49
|
+
"vitest": "^3.0.9",
|
|
50
|
+
"vitest-browser-vue": "^0.2.0",
|
|
51
|
+
"vue-tsc": "^2.2.8"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "vite",
|
|
55
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
56
|
+
"preview": "vite preview",
|
|
57
|
+
"test:unit": "vitest --no-watch",
|
|
58
|
+
"build-only": "vite build",
|
|
59
|
+
"type-check": "vue-tsc --build tsconfig.build.json",
|
|
60
|
+
"lint": "biome check --apply --write",
|
|
61
|
+
"test:browser": "vitest --workspace=vitest.workspace.ts"
|
|
62
|
+
}
|
|
63
|
+
}
|