LocaleDropdown-9d0c37cd.js 2.5 KB

1
  1. import{d as b,b as P,r as V,o as u,k as w,a as o,R as j,a1 as L,a3 as D,d2 as O,_ as y,di as d,dj as S,Q as C,dk as R,dl as A,ai as M,bf as $,e as k,w as p,i as x,c as F,C as N,l as Q,t as U,F as q,n as B,__tla as G}from"./index-3ec1f57f.js";import{u as T,__tla as H}from"./useIcon-3d50765b.js";import{b as J,E as K,a as W,__tla as X}from"./el-dropdown-item-671765ca.js";let z,E,Y=Promise.all([(()=>{try{return G}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{let i,v;i="var(--el-color-black)",E=y(b({name:"ThemeSwitch",__name:"ThemeSwitch",setup(l){const{getPrefixCls:s}=D(),c=s("theme-switch"),a=T({icon:"emojione-monotone:sun",color:"#fde047"}),n=T({icon:"emojione-monotone:crescent-moon",color:"#fde047"}),m=P(),t=V(m.getIsDark),e=r=>{m.setIsDark(r)};return(r,_)=>{const g=O;return u(),w(g,{modelValue:o(t),"onUpdate:modelValue":_[0]||(_[0]=f=>j(t)?t.value=f:null),"active-color":i,"active-icon":o(a),"border-color":i,class:L(o(c)),"inactive-color":i,"inactive-icon":o(n),"inline-prompt":"",onChange:e},null,8,["modelValue","active-icon","class","inactive-icon"])}}}),[["__scopeId","data-v-78cd11f1"],["__file","D:/zx/mall-newfeifan-zx-business/src/layout/components/ThemeSwitch/src/ThemeSwitch.vue"]]),v=()=>({changeLocale:async l=>{const s=d.global,c=await S(Object.assign({"../../locales/en.ts":()=>C(()=>import("./en-706ee4dd.js"),[]),"../../locales/zh-CN.ts":()=>C(()=>import("./zh-CN-3441a76e.js"),[])}),`../../locales/${l}.ts`);s.setLocaleMessage(l,c.default),(a=>{const n=R();d.mode==="legacy"?d.global.locale=a:d.global.locale.value=a,n.setCurrentLocale({lang:a}),A(a)})(l)}}),z=y(b({name:"LocaleDropdown",__name:"LocaleDropdown",props:{color:M.string.def("")},setup(l){const{getPrefixCls:s}=D(),c=s("locale-dropdown"),a=$(),n=k(()=>a.getLocaleMap),m=k(()=>a.getCurrentLocale),t=e=>{if(e===o(m).lang)return;window.location.reload(),a.setCurrentLocale({lang:e});const{changeLocale:r}=v();r(e)};return(e,r)=>{const _=B,g=K,f=W,I=J;return u(),w(I,{class:L(o(c)),trigger:"click",onCommand:t},{dropdown:p(()=>[x(f,null,{default:p(()=>[(u(!0),F(q,null,N(o(n),h=>(u(),w(g,{key:h.lang,command:h.lang},{default:p(()=>[Q(U(h.name),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:p(()=>[x(_,{class:L([e.$attrs.class,"cursor-pointer !p-0"]),color:l.color,size:18,icon:"ion:language-sharp"},null,8,["class","color"])]),_:1},8,["class"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/layout/components/LocaleDropdown/src/LocaleDropdown.vue"]])});export{z as L,E as T,Y as __tla};