LocaleDropdown-393b7d0c.js 2.5 KB

1
  1. import{d as D,S as R,r as S,o as _,x as w,a as o,l as j,T as L,V as y,cJ as z,_ as C,dA as d,dB as P,aH as b,dC as A,dD as H,ac as O,bR as U,Y as T,w as p,f as k,c as M,v as X,y as $,t as B,F,j as J,__tla as N}from"./index-8dc1e40a.js";import{u as x,__tla as Y}from"./useIcon-a0e2d543.js";import{b as q,E as G,a as K,__tla as Q}from"./el-dropdown-item-d3525f0b.js";let V,E,W=Promise.all([(()=>{try{return N}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return Q}catch{}})()]).then(async()=>{let i,v;i="var(--el-color-black)",E=C(D({name:"ThemeSwitch",__name:"ThemeSwitch",setup(l){const{getPrefixCls:s}=y(),c=s("theme-switch"),a=x({icon:"emojione-monotone:sun",color:"#fde047"}),t=x({icon:"emojione-monotone:crescent-moon",color:"#fde047"}),m=R(),n=S(m.getIsDark),e=r=>{m.setIsDark(r)};return(r,u)=>{const g=z;return _(),w(g,{modelValue:o(n),"onUpdate:modelValue":u[0]||(u[0]=f=>j(n)?n.value=f:null),"active-color":i,"active-icon":o(a),"border-color":i,class:L(o(c)),"inactive-color":i,"inactive-icon":o(t),"inline-prompt":"",onChange:e},null,8,["modelValue","active-icon","class","inactive-icon"])}}}),[["__scopeId","data-v-78cd11f1"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/layout/components/ThemeSwitch/src/ThemeSwitch.vue"]]),v=()=>({changeLocale:async l=>{const s=d.global,c=await P(Object.assign({"../../locales/en.ts":()=>b(()=>import("./en-706ee4dd.js"),[]),"../../locales/zh-CN.ts":()=>b(()=>import("./zh-CN-b8ee8e05.js"),[])}),`../../locales/${l}.ts`);s.setLocaleMessage(l,c.default),(a=>{const t=A();d.mode==="legacy"?d.global.locale=a:d.global.locale.value=a,t.setCurrentLocale({lang:a}),H(a)})(l)}}),V=C(D({name:"LocaleDropdown",__name:"LocaleDropdown",props:{color:O.string.def("")},setup(l){const{getPrefixCls:s}=y(),c=s("locale-dropdown"),a=U(),t=T(()=>a.getLocaleMap),m=T(()=>a.getCurrentLocale),n=e=>{if(e===o(m).lang)return;window.location.reload(),a.setCurrentLocale({lang:e});const{changeLocale:r}=v();r(e)};return(e,r)=>{const u=J,g=G,f=K,I=q;return _(),w(I,{class:L(o(c)),trigger:"click",onCommand:n},{dropdown:p(()=>[k(f,null,{default:p(()=>[(_(!0),M(F,null,X(o(t),h=>(_(),w(g,{key:h.lang,command:h.lang},{default:p(()=>[$(B(h.name),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:p(()=>[k(u,{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","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/layout/components/LocaleDropdown/src/LocaleDropdown.vue"]])});export{V as L,E as T,W as __tla};