Files
Nexus/web/app/assets/VDialog-P-nMQayc.js
T
2026-06-08 07:38:28 +08:00

1 line
1.5 KiB
JavaScript

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