You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prodio/app/public/admin/assets/el-message-box-35f36743.js

2 lines
940 B

import{N as g}from"./el-button-98327865.js";import{z as T,H as W,A as U}from"./index-7ade0fa6.js";const z=(t,e,p)=>{let c={offsetX:0,offsetY:0};const m=i=>{const L=i.clientX,M=i.clientY,{offsetX:n,offsetY:s}=c,o=t.value.getBoundingClientRect(),u=o.left,l=o.top,w=o.width,X=o.height,Y=document.documentElement.clientWidth,x=document.documentElement.clientHeight,H=-u+n,b=-l+s,B=Y-u-w+n,D=x-l-X+s,d=f=>{const r=Math.min(Math.max(n+f.clientX-L,H),B),h=Math.min(Math.max(s+f.clientY-M,b),D);c={offsetX:r,offsetY:h},t.value.style.transform=`translate(${g(r)}, ${g(h)})`},v=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",v)},E=()=>{e.value&&t.value&&e.value.addEventListener("mousedown",m)},a=()=>{e.value&&t.value&&e.value.removeEventListener("mousedown",m)};T(()=>{W(()=>{p.value?E():a()})}),U(()=>{a()})};export{z as u};