index.a696a3d7.js 4.7 KB

1
  1. var I=Object.defineProperty;var D=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var P=(s,r,a)=>r in s?I(s,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[r]=a,B=(s,r)=>{for(var a in r||(r={}))L.call(r,a)&&P(s,a,r[a]);if(D)for(var a of D(r))F.call(r,a)&&P(s,a,r[a]);return s};var T=(s,r,a)=>new Promise((d,m)=>{var n=o=>{try{f(a.next(o))}catch(l){m(l)}},p=o=>{try{f(a.throw(o))}catch(l){m(l)}},f=o=>o.done?d(o.value):Promise.resolve(o.value).then(n,p);f((a=a.apply(s,r)).next())});import{q as O,s as R,v as z,x as A,y as N,z as j,r as H,I as K,A as $,B as W,C as U,D as x,E as X,F as Y,G as q,H as S,b as u,J as G,d as J,K as Q,L as Z,M as V,N as ee,o as v,c as C,w as c,O as ae,P as _,a as b,t as k,Q as se,R as te,S as oe,T as le,U as E,W as re,X as M,Y as ne,Z as ie,$ as de,n as ce,a0 as ue,a1 as fe,_ as ge}from"./index.6c36cb53.js";const me=O(B({fullscreen:Boolean,retainFocus:{type:Boolean,default:!0},scrollable:Boolean},R({origin:"center center",scrollStrategy:"block",transition:{component:z},zIndex:2400})),"VDialog"),pe=A()({name:"VDialog",props:me(),emits:{"update:modelValue":s=>!0},setup(s,r){let{slots:a}=r;const d=N(s,"modelValue"),{scopeId:m}=j(),n=H();function p(o){var i,t;const l=o.relatedTarget,e=o.target;if(l!==e&&((i=n.value)==null?void 0:i.contentEl)&&((t=n.value)==null?void 0:t.globalTop)&&![document,n.value.contentEl].includes(e)&&!n.value.contentEl.contains(e)){const g=q(n.value.contentEl);if(!g.length)return;const y=g[0],h=g[g.length-1];l===y?h.focus():y.focus()}}K&&$(()=>d.value&&s.retainFocus,o=>{o?document.addEventListener("focusin",p):document.removeEventListener("focusin",p)},{immediate:!0}),$(d,o=>T(this,null,function*(){var l,e;yield W(),o?(l=n.value.contentEl)==null||l.focus({preventScroll:!0}):(e=n.value.activatorEl)==null||e.focus({preventScroll:!0})}));const f=U(()=>x({"aria-haspopup":"dialog","aria-expanded":String(d.value)},s.activatorProps));return X(()=>{const o=S.filterProps(s);return u(S,x({ref:n,class:["v-dialog",{"v-dialog--fullscreen":s.fullscreen,"v-dialog--scrollable":s.scrollable},s.class],style:s.style},o,{modelValue:d.value,"onUpdate:modelValue":l=>d.value=l,"aria-modal":"true",activatorProps:f.value,role:"dialog"},m),{activator:a.activator,default:function(){for(var l=arguments.length,e=new Array(l),i=0;i<l;i++)e[i]=arguments[i];return u(G,{root:"VDialog"},{default:()=>{var t;return[(t=a.default)==null?void 0:t.call(a,...e)]}})}})}),Y({},n)}}),ve={class:"d-flex justify-space-between align-center w-100 py-1"},ye={class:"title_box"},he=["src"],Ve={class:"ml-2"},_e={key:1},be=J({__name:"index",props:{title:{default:"\u6807\u9898"},logo:{default:()=>Q()},cardClass:{default:"bg-background box-shadow"},cardTextClass:{default:"mx-1 px-2 bg-prominent rounded-t"},footerBtnList:{default:()=>[]},modelValue:{type:Boolean,default:!1},keys:{}},emits:["update:modelValue"],setup(s,{expose:r,emit:a}){const{dialog:d,dialogTitleEl:m,getMoveX:n,getMoveY:p,closeDialog:f}=Z(),o=e=>{a("update:modelValue",e)},l=Object.assign({Escape:()=>f()},s.keys);return Object.keys(l).forEach(e=>{const i=l[e];(["Escape","Enter"].includes(e)?V.registerWithHighPrior.bind(V):V.register.bind(V))({key:[],winKey:{keyCode:ee(e)},action:i,when(y){var h,w;return y.isRunCommand?!1:(w=(h=d.value)==null?void 0:h.modelValue)!=null?w:!1}})}),r({getMoveX:n,getMoveY:p}),(e,i)=>(v(),C(pe,{ref_key:"dialog",ref:d,"model-value":e.modelValue,contained:"",persistent:"","no-click-animation":"","retain-focus":""},{default:c(()=>[u(fe,{class:E(["w-100 h-100 rounded-0 bg-grey-lighten-3",e.cardClass])},{default:c(()=>[u(ae,{class:"pa-0",ref_key:"dialogTitleEl",ref:m},{default:c(()=>[_(e.$slots,"header",{},()=>[b("div",ve,[b("div",ye,[_(e.$slots,"header-icon",{},()=>[b("img",{src:e.logo,class:"ml-1",alt:"logo",width:"24",height:"24"},null,8,he)],!0),b("span",Ve,k(e.$t(e.title)),1)]),u(se,{size:"24px",class:"mr-2",variant:"plain",onClick:i[0]||(i[0]=te(t=>o(!1),["stop"]))},{default:c(()=>[u(oe,{size:"24px",icon:"cha"})]),_:1})])],!0)]),_:3},512),u(le,{class:E([e.cardTextClass,"py-0"])},{default:c(()=>[_(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"]),_(e.$slots,"actions",{},()=>[u(re,{class:"mx-1 mt-0 mb-1 py-0 px-2 d-flex justify-end bg-prominent"},{default:c(()=>[(v(!0),M(ue,null,ne(e.footerBtnList,(t,g)=>(v(),C(ie,{key:g+t.name,onClick:t.fun,isAction:"",primary:t.primary,disabled:t.disabled?t.disabled():!1,class:E(["ml-3 px-2",t.disabled&&t.disabled()?"disabled":""])},{default:c(()=>[t.labelProps?(v(),C(de,x({key:0},t.labelProps,{noTextCaption:""}),{default:c(()=>[ce(k(e.$t(t.name)),1)]),_:2},1040)):(v(),M("span",_e,k(e.$t(t.name)),1))]),_:2},1032,["onClick","primary","disabled","class"]))),128))]),_:1})],!0)]),_:3},8,["class"])]),_:3},8,["model-value"]))}});const Ee=ge(be,[["__scopeId","data-v-9ede756b"]]);export{Ee as M};