import{P as W}from"./index.566277e5.js";import{aP as M,a as X,aQ as Y,bK as z,o as L,aR as A,p as D,w as S,h as q,q as F}from"./index.0d073eaa.js";import"./index.e9a84cba.js";import"./index.0972fd96.js";import"./useSize.bb4e5ce5.js";import"./eagerComputed.156e81ff.js";import"./useWindowSizeFn.ef20ece8.js";import"./useContentViewHeight.01b9d1c6.js";import"./ArrowLeftOutlined.90d2e05e.js";import"./index.8680e4c4.js";import"./transButton.8c1b1a4f.js";const m={event:"mousedown",transition:400},x={beforeMount:(e,t)=>{if(t.value===!1)return;const o=e.getAttribute("ripple-background");I(Object.keys(t.modifiers),m);const n=o||x.background,r=x.zIndex;e.addEventListener(m.event,d=>{H({event:d,el:e,background:n,zIndex:r})})},updated(e,t){var n,r;if(!t.value){(n=e==null?void 0:e.clearRipple)==null||n.call(e);return}const o=e.getAttribute("ripple-background");(r=e==null?void 0:e.setBackground)==null||r.call(e,o)}};function H({event:e,el:t,zIndex:o,background:n}){var R,E;const r=parseInt(getComputedStyle(t).borderWidth.replace("px","")),d=e.clientX||e.touches[0].clientX,f=e.clientY||e.touches[0].clientY,h=t.getBoundingClientRect(),{left:C,top:T}=h,{offsetWidth:b,offsetHeight:_}=t,{transition:k}=m,l=d-C,u=f-T,y=Math.max(l,b-l),w=Math.max(u,_-u),B=window.getComputedStyle(t),g=Math.sqrt(y*y+w*w),$=r>0?r:0,a=document.createElement("div"),s=document.createElement("div");a.className="ripple",Object.assign((R=a.style)!=null?R:{},{marginTop:"0px",marginLeft:"0px",width:"1px",height:"1px",transition:`all ${k}ms cubic-bezier(0.4, 0, 0.2, 1)`,borderRadius:"50%",pointerEvents:"none",position:"relative",zIndex:o!=null?o:"9999",backgroundColor:n!=null?n:"rgba(0, 0, 0, 0.12)"}),s.className="ripple-container",Object.assign((E=s.style)!=null?E:{},{position:"absolute",left:`${0-$}px`,top:`${0-$}px`,height:"0",width:"0",pointerEvents:"none",overflow:"hidden"});const v=t.style.position.length>0?t.style.position:getComputedStyle(t).position;v!=="relative"&&(t.style.position="relative"),s.appendChild(a),t.appendChild(s),Object.assign(a.style,{marginTop:`${u}px`,marginLeft:`${l}px`});const{borderTopLeftRadius:N,borderTopRightRadius:P,borderBottomLeftRadius:j,borderBottomRightRadius:O}=B;Object.assign(s.style,{width:`${b}px`,height:`${_}px`,direction:"ltr",borderTopLeftRadius:N,borderTopRightRadius:P,borderBottomLeftRadius:j,borderBottomRightRadius:O}),setTimeout(()=>{var c;const i=`${g*2}px`;Object.assign((c=a.style)!=null?c:{},{width:i,height:i,marginLeft:`${l-g}px`,marginTop:`${u-g}px`})},0);function p(){setTimeout(()=>{a.style.backgroundColor="rgba(0, 0, 0, 0)"},250),setTimeout(()=>{var i;(i=s==null?void 0:s.parentNode)==null||i.removeChild(s)},850),t.removeEventListener("mouseup",p,!1),t.removeEventListener("mouseleave",p,!1),t.removeEventListener("dragstart",p,!1),setTimeout(()=>{let i=!0;for(let c=0;c<t.childNodes.length;c++)t.childNodes[c].className==="ripple-container"&&(i=!1);i&&(t.style.position=v!=="static"?v:"")},m.transition+260)}e.type==="mousedown"?(t.addEventListener("mouseup",p,!1),t.addEventListener("mouseleave",p,!1),t.addEventListener("dragstart",p,!1)):p(),t.setBackground=i=>{!i||(a.style.backgroundColor=i)}}function I(e,t){e.forEach(o=>{isNaN(Number(o))?t.event=o:t.transition=o})}const K=X({components:{PageWrapper:W},directives:{Ripple:x}}),Q={class:"demo-box"},V=F("content"),G=[V];function J(e,t,o,n,r,d){const f=Y("PageWrapper"),h=z("ripple");return L(),A(f,{title:"Ripple\u793A\u4F8B"},{default:D(()=>[S((L(),q("div",Q,G)),[[h]])]),_:1})}var ct=M(K,[["render",J],["__scopeId","data-v-42c234a1"]]);export{ct as default};
