ray-template/js/useContextmenuCoordinate-BZbaaGOq.js

1 line
801 B
JavaScript

import{D as e,P as t,R as n,X as r,z as i}from"./toString-BWDzaUQG.js";import{on as a,sn as o}from"./index-BL9Gs7_D.js";import{Mn as s}from"./Card-DevreQc-.js";function c(n){return e()?(t(n),!0):!1}var l=(e,t)=>{let l=i(0),u=i(0),d=i(!1),f=()=>{let e=r(t);return typeof e==`boolean`?{capture:e,passive:!1}:{...e,passive:!1}},p=!1,m=0,h=e=>{p&&e||(e||(m+=1),d.value=e)},g=e=>{e.preventDefault(),h(!1);let t=m;s().then(()=>{if(p||t!==m)return;let{clientX:n,clientY:r}=e;l.value=n,u.value=r,h(!0)})},_=a(e,e=>{h(!1);let n=r(t);typeof n==`object`&&n.clickOutside?.(e)},{ignore:()=>{let e=r(t);return typeof e==`object`?r(e.ignore)??[]:[]}}),v=o(e,`contextmenu`,g,f),y=o(e,`click`,()=>{h(!1)}),b=()=>{p=!0,h(!1),v(),y(),_()};return c(b),{stop:b,x:n(l),y:n(u),show:n(d),updateShow:h}};export{c as n,l as t};