1 |
- import{d as D,Y as V,r as j,o as _,v as w,a as o,O as z,Z as L,a0 as b,db as O,_ as y,dp as d,dq as R,N as C,dr as S,ds as A,ag as U,bA as q,K as k,w as p,f as T,c as H,q as M,n as N,t as X,F as $,j as F,__tla as K}from"./index-11e4820e.js";import{u as x,__tla as Y}from"./useIcon-b9c233e7.js";import{b as Z,E as B,a as G,__tla as J}from"./el-dropdown-item-61aee45e.js";let E,I,Q=Promise.all([(()=>{try{return K}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return J}catch{}})()]).then(async()=>{let i,v;i="var(--el-color-black)",I=y(D({name:"ThemeSwitch",__name:"ThemeSwitch",setup(l){const{getPrefixCls:s}=b(),t=s("theme-switch"),a=x({icon:"emojione-monotone:sun",color:"#fde047"}),c=x({icon:"emojione-monotone:crescent-moon",color:"#fde047"}),m=V(),n=j(m.getIsDark),e=r=>{m.setIsDark(r)};return(r,u)=>{const g=O;return _(),w(g,{modelValue:o(n),"onUpdate:modelValue":u[0]||(u[0]=f=>z(n)?n.value=f:null),"active-color":i,"active-icon":o(a),"border-color":i,class:L(o(t)),"inactive-color":i,"inactive-icon":o(c),"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,t=await R(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,t.default),(a=>{const c=S();d.mode==="legacy"?d.global.locale=a:d.global.locale.value=a,c.setCurrentLocale({lang:a}),A(a)})(l)}}),E=y(D({name:"LocaleDropdown",__name:"LocaleDropdown",props:{color:U.string.def("")},setup(l){const{getPrefixCls:s}=b(),t=s("locale-dropdown"),a=q(),c=k(()=>a.getLocaleMap),m=k(()=>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=F,g=B,f=G,P=Z;return _(),w(P,{class:L(o(t)),trigger:"click",onCommand:n},{dropdown:p(()=>[T(f,null,{default:p(()=>[(_(!0),H($,null,M(o(c),h=>(_(),w(g,{key:h.lang,command:h.lang},{default:p(()=>[N(X(h.name),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:p(()=>[T(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{E as L,I as T,Q as __tla};
|