Files
qhmes/web-dist/js/index-JFkBmvER.js
2026-06-16 18:19:57 +08:00

2 lines
3.8 KiB
Java

import{P as W}from"./index-Ckh_BVlA.js";import{e as X,y as M,z as C,A as Y,K as A,X as D,O as S,C as q,E as z}from"./vue-vendor-DNhG1Cve.js";import{au as H}from"./index-X7Y8jykP.js";import"./useMenuSetting-BwQ9LkAm.js";import"./useFullContent-B3OUGaJG.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./useContentHeight-vWUZcXk1.js";import"./onMountedOrActivated-DhSdLlqP.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./useContentViewHeight-Cja8zrBg.js";import"./usePageContext-9jIr04Op.js";import"./injectionKey-DPVn4AgL.js";import"./ArrowLeftOutlined-B3JgaWh-.js";import"./ArrowRightOutlined-CZG1QCpB.js";import"./index-lcIOKfa7.js";import"./dropdown-jkliuVyN.js";import"./index-B4gPlWQt.js";import"./eagerComputed-BTlOruLW.js";import"./transButton-B2CWzlQO.js";import"./operationUnit-vCu2co3e.js";const l={event:"mousedown",transition:400},b={beforeMount:(e,t)=>{if(t.value===!1)return;const o=e.getAttribute("ripple-background");K(Object.keys(t.modifiers),l);const s=o||b.background,n=b.zIndex;e.addEventListener(l.event,d=>{I({event:d,el:e,background:s,zIndex:n})})},updated(e,t){var s,n;if(!t.value){(s=e==null?void 0:e.clearRipple)==null||s.call(e);return}const o=e.getAttribute("ripple-background");(n=e==null?void 0:e.setBackground)==null||n.call(e,o)}};function I({event:e,el:t,zIndex:o,background:s}){var w,R;const n=parseInt(getComputedStyle(t).borderWidth.replace("px","")),d=e.clientX||e.touches[0].clientX,f=e.clientY||e.touches[0].clientY,g=t.getBoundingClientRect(),{left:L,top:T}=g,{offsetWidth:x,offsetHeight:y}=t,{transition:N}=l,m=d-L,u=f-T,_=Math.max(m,x-m),E=Math.max(u,y-u),k=window.getComputedStyle(t),h=Math.sqrt(_*_+E*E),$=n>0?n:0,a=document.createElement("div"),r=document.createElement("div");a.className="ripple",Object.assign((w=a.style)!=null?w:{},{marginTop:"0px",marginLeft:"0px",width:"1px",height:"1px",transition:`all ${N}ms cubic-bezier(0.4, 0, 0.2, 1)`,borderRadius:"50%",pointerEvents:"none",position:"relative",zIndex:o!=null?o:"9999",backgroundColor:s!=null?s:"rgba(0, 0, 0, 0.12)"}),r.className="ripple-container",Object.assign((R=r.style)!=null?R:{},{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"),r.appendChild(a),t.appendChild(r),Object.assign(a.style,{marginTop:`${u}px`,marginLeft:`${m}px`});const{borderTopLeftRadius:B,borderTopRightRadius:O,borderBottomLeftRadius:P,borderBottomRightRadius:j}=k;Object.assign(r.style,{width:`${x}px`,height:`${y}px`,direction:"ltr",borderTopLeftRadius:B,borderTopRightRadius:O,borderBottomLeftRadius:P,borderBottomRightRadius:j}),setTimeout(()=>{var c;const i=`${h*2}px`;Object.assign((c=a.style)!=null?c:{},{width:i,height:i,marginLeft:`${m-h}px`,marginTop:`${u-h}px`})},0);function p(){setTimeout(()=>{a.style.backgroundColor="rgba(0, 0, 0, 0)"},250),setTimeout(()=>{var i;(i=r==null?void 0:r.parentNode)==null||i.removeChild(r)},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:"")},l.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 K(e,t){e.forEach(o=>{isNaN(Number(o))?t.event=o:t.transition=o})}const V=X({components:{PageWrapper:W},directives:{Ripple:b}}),F={class:"demo-box"};function G(e,t,o,s,n,d){const f=A("PageWrapper"),g=D("ripple");return C(),M(f,{title:"Ripple示例"},{default:Y(()=>[S((C(),q("div",F,[...t[0]||(t[0]=[z(" content ",-1)])])),[[g]])]),_:1})}const ht=H(V,[["render",G],["__scopeId","data-v-f59f0874"]]);export{ht as default};