mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-12-04 02:53:36 +08:00
1 line
737 B
JavaScript
1 line
737 B
JavaScript
import{D as e,P as t,R as n,X as r,z as i}from"./toString-BWDzaUQG.js";import{cn as a,sn as o}from"./index-DO-N-bSc.js";import{Tn as s}from"./replaceable-DW6s2lkT.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)})},_=o(e,e=>{h(!1);let n=r(t);typeof n==`object`&&n.clickOutside?.(e)}),v=a(e,`contextmenu`,g,f),y=a(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}; |