UNPKG

p3x-redis-ui-material

Version:

💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity

1 lines • 2.8 kB
import{A as e,C as t,H as n,I as r,R as i,W as a,Y as o,_t as s,et as c,ht as l,nt as u,yt as d}from"./i18n.store-Bbsc3Bab.js";import{Ct as f,Mn as p,On as m,Pt as h,Rn as g,Vt as _,Yn as v,Z as y,a as b,ht as x,kn as S,mt as C,n as w}from"./_plugin-vue_export-helper-D1H5elb2.js";import{l as T,n as E,t as D}from"./VOverlay-CU45m6XG.js";import{_ as O}from"./transitions-Bp2Q4Qu5.js";var k=_({id:String,submenu:Boolean,...v(E({captureFocus:!0,closeDelay:250,closeOnContentClick:!0,locationStrategy:`connected`,location:void 0,openDelay:300,scrim:!1,scrollStrategy:`reposition`,transition:{component:O}}),[`absolute`])},`VMenu`),A=h()({name:`VMenu`,props:k(),emits:{"update:modelValue":e=>!0},setup(h,{slots:_}){let v=x(h,`modelValue`),{scopeId:E}=w(),{isRtl:O}=C(),k=c(),A=d(()=>h.id||`v-menu-${k}`),j=l(),M=r(T,null),N=s(new Set);o(T,{register(){N.value.add(k)},unregister(){N.value.delete(k)},closeParents(e){setTimeout(()=>{!N.value.size&&!h.persistent&&(e==null||j.value?.contentEl&&!g(e,j.value.contentEl))&&(v.value=!1,M?.closeParents())},40)}}),n(()=>M?.unregister()),a(()=>v.value=!1),u(v,e=>{e?M?.register():M?.unregister()},{immediate:!0});function P(e){M?.closeParents(e)}function F(e){if(!h.disabled)if(e.key===`Tab`||e.key===`Enter`&&!h.closeOnContentClick){if(e.key===`Enter`&&(e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLInputElement&&e.target.closest(`form`)))return;e.key===`Enter`&&e.preventDefault(),!p(S(j.value?.contentEl,!1),e.shiftKey?`prev`:`next`,e=>e.tabIndex>=0)&&!h.retainFocus&&(v.value=!1,j.value?.activatorEl?.focus())}else h.submenu&&e.key===(O.value?`ArrowRight`:`ArrowLeft`)&&(v.value=!1,j.value?.activatorEl?.focus())}function I(e){if(h.disabled)return;let t=j.value?.contentEl;t&&v.value?e.key===`ArrowDown`?(e.preventDefault(),e.stopImmediatePropagation(),m(t,`next`)):e.key===`ArrowUp`?(e.preventDefault(),e.stopImmediatePropagation(),m(t,`prev`)):h.submenu&&(e.key===(O.value?`ArrowRight`:`ArrowLeft`)?v.value=!1:e.key===(O.value?`ArrowLeft`:`ArrowRight`)&&(e.preventDefault(),m(t,`first`))):(h.submenu?e.key===(O.value?`ArrowLeft`:`ArrowRight`):[`ArrowDown`,`ArrowUp`].includes(e.key))&&(v.value=!0,e.preventDefault(),setTimeout(()=>setTimeout(()=>I(e))))}let L=t(()=>i({"aria-haspopup":`menu`,"aria-expanded":String(v.value),"aria-controls":A.value,"aria-owns":A.value,onKeydown:I},h.activatorProps));return f(()=>{let t=D.filterProps(h);return e(D,i({ref:j,id:A.value,class:[`v-menu`,h.class],style:h.style},t,{modelValue:v.value,"onUpdate:modelValue":e=>v.value=e,absolute:!0,activatorProps:L.value,location:h.location??(h.submenu?`end`:`bottom`),"onClick:outside":P,onKeydown:F},E),{activator:_.activator,default:(...t)=>e(y,{root:`VMenu`},{default:()=>[_.default?.(...t)]})})}),b({id:A,ΨopenChildren:N},j)}});export{k as n,A as t};