Files
Nexus/web/app/assets/VDialog-BclMUB-b.js
T
2026-06-08 07:24:32 +08:00

1 line
1.5 KiB
JavaScript

import{Mr as e,S as t,Vr as n,X as r,_n as i,b as a,br as o,fn as s,ft as c,ln as l,mr as u,qn as d,x as f,xn as p,y as m,yr as h}from"./index-Br7lTitF.js";var g=p({fullscreen:Boolean,scrollable:Boolean,...d(f({captureFocus:!0,origin:`center center`,scrollStrategy:`block`,transition:{component:r},zIndex:2400,retainFocus:!0}),[`disableInitialFocus`])},`VDialog`),_=i()({name:`VDialog`,props:g(),emits:{"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(r,{emit:i,slots:d}){let f=l(r,`modelValue`),{scopeId:p}=t(),g=n();function _(){i(`afterEnter`),(r.scrim||r.retainFocus)&&g.value?.contentEl&&!g.value.contentEl.contains(document.activeElement)&&g.value.contentEl.focus({preventScroll:!0})}function v(){i(`afterLeave`)}return e(f,async e=>{e||(await o(),g.value.activatorEl?.focus({preventScroll:!0}))}),s(()=>{let e=a.filterProps(r),t=h({"aria-haspopup":`dialog`},r.activatorProps),n=h({tabindex:-1},r.contentProps);return u(a,h({ref:g,class:[`v-dialog`,{"v-dialog--fullscreen":r.fullscreen,"v-dialog--scrollable":r.scrollable},r.class],style:r.style},e,{modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,"aria-modal":`true`,activatorProps:t,contentProps:n,height:r.fullscreen?void 0:r.height,width:r.fullscreen?void 0:r.width,maxHeight:r.fullscreen?void 0:r.maxHeight,maxWidth:r.fullscreen?void 0:r.maxWidth,role:`dialog`,onAfterEnter:_,onAfterLeave:v},p),{activator:d.activator,default:(...e)=>u(c,{root:`VDialog`},{default:()=>[d.default?.(...e)]})})}),m({},g)}});export{_ as t};