ray-template/js/example-CAiCgHRo.js

2 lines
3.6 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/docs-core-utils-rYjgZ2Ca.js","js/runtime-core.esm-bundler-BvnVMcQz.js","js/isSymbol-DERoyzaf.js","js/directives-QatNmAyh.js","js/rolldown-runtime-COiEfhsA.js","js/Card-CLV9EByv.js","js/toString-Ywh2uUvn.js","js/cache-CVJtZ2gM.js","js/utils-CwTyTwZZ.js","js/_toKey-G6omxrKT.js","js/preload-helper-B5zr4nmU.js","js/src-BpxRS8OH.js","js/routes-DGonZy5S.js","js/contract-BooJfFV6.js","css/directives-DylkS4p7.css","js/DemoPage-DXXea1cu.js","js/AppPageHeader-CD7pHE8U.js","css/AppPageHeader-Cmbeex-u.css","css/DemoPage-B2axJfLX.css","js/DemoResult-CvFDt4Kp.js","js/docs-browser-utils-BD8d6sWd.js","js/effect-dispose-DuGoWOEo.js","js/docs-storage-utils-Cb7sJ9JF.js","js/browser-CUOF-1mo.js","js/demo-LF3fdof1.js"])))=>i.map(i=>d[i]);
import{A as e,E as t,Gt as n,Jt as r,Kt as i,Mr as a,Qt as o,Yt as s,a as c,d as l,f as u,hn as d,i as f,k as p,mn as m,n as h,ot as g,pn as _,r as v,st as y,t as b}from"./directives-QatNmAyh.js";import{v as x,y as S}from"./runtime-core.esm-bundler-BvnVMcQz.js";import{cn as C}from"./Card-CLV9EByv.js";import"./src-BpxRS8OH.js";import{o as w,p as T}from"./cache-CVJtZ2gM.js";import{t as E}from"./example-focus-BDYDJaky.js";import{u as D}from"./contract-BooJfFV6.js";import{t as O}from"./preload-helper-B5zr4nmU.js";var k=new Set([`/dashboard`,`/tables`,`/form`,`/modal-demo`,`/echart`,`/flow`,`/segment`,`/iframe`,`/draggable-card`,`/svg-icons`,`/directive`,`/template-hooks`,`/web-hooks`,`/multi`,`/precision`,`/cache-demo`,`/axios`,`/qrcode`]);function A(e,t=``){return e.flatMap(e=>{let n=s(t,e.path);if(k.has(n))return[e];let r=A(e.children??[],n);return r.length?[{...e,children:r}]:[]})}var j=new URLSearchParams(location.search),M=j.get(`layout`)===`1`,N=[...A(n()),{path:`/docs-core-utils`,name:`DocsCoreUtils`,component:()=>O(()=>import(`./docs-core-utils-rYjgZ2Ca.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{i18nKey:`menu.DocsCoreUtils`,order:8}},{path:`/docs-browser-utils`,name:`DocsBrowserUtils`,component:()=>O(()=>import(`./docs-browser-utils-BD8d6sWd.js`),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,21,15,16,17,18,19])),meta:{i18nKey:`menu.DocsBrowserUtils`,order:9}},{path:`/docs-storage-utils`,name:`DocsStorageUtils`,component:()=>O(()=>import(`./docs-storage-utils-Cb7sJ9JF.js`),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])),meta:{i18nKey:`menu.DocsStorageUtils`,order:10}}],P=S({name:`DocumentationExample`,setup(){let{t:e}=m(),{getAppTheme:t,getLocaleLanguage:n,getThemeStyle:r}=u();return g({dark:()=>t.value,locale:()=>n.value,chartTheme:()=>T.echartTheme??`ray-${r.value}`,translate:e,iconUrl:(e,t)=>`${D[e.split(`/`)[0]]}#${t}-${e}`,columnStorage:y(window.sessionStorage,`ray-doc-examples`),reportError:e=>window.$message?.error(e),reportSuccess:e=>window.$message?.success(e)}),()=>x(c,null,{default:()=>[x(f,null,null),x(v,null,null),x(o,null,null)]})}});async function F(){w();{let{enableApiMock:e}=await O(async()=>{let{enableApiMock:e}=await import(`./browser-CUOF-1mo.js`);return{enableApiMock:e}},__vite__mapDeps([23,11,4,2,1,7,12,13,10,24]));await e()}let n=C(P);n.use(a()),await d(n),h(),b(n);let{updateLocale:o}=n.runWithContext(l),{darkTheme:s,lightTheme:c}=n.runWithContext(_);o(j.get(`lang`)===`en`?`en-US`:`zh-CN`),j.get(`theme`)===`dark`?s():c(),t.removeRoute(`RLogin`),t.removeRoute(`RLayout`),i(N);let u=[...r(N),...p()];if(M)t.addRoute({path:`/`,component:e,children:u});else for(let e of u)t.addRoute(e);n.use(t),await t.isReady();let f=j.get(`focus`);f&&n.provide(E,{path:t.currentRoute.value.path,names:new Set(f.split(`,`))}),n.mount(`#app`)}F();