zova-module-a-router 5.1.30 → 5.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,8 @@ export declare class SysRouter extends BeanBase {
22
22
  getRealRouteName(name?: string | symbol | null): string | undefined;
23
23
  isRouterName(name?: string | null | undefined): boolean;
24
24
  resolveName<K extends keyof IPageNameRecord>(name: K, options?: IPageNameRecord[K]): string;
25
+ getAliasPath<K extends keyof IPageNameRecord>(name: K, options?: IPageNameRecord[K], absolute?: boolean): string | undefined;
26
+ private _normalizePageParams;
25
27
  private _resolveNameOrPath;
26
28
  private _loadConfigRoutes;
27
29
  private _loadLegacyRoutes;
@@ -1 +1 @@
1
- {"version":3,"file":"sys.router.d.ts","sourceRoot":"","sources":["../../src/bean/sys.router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,6BAA6B,EAC7B,oCAAoC,EACpC,4BAA4B,EAC5B,MAAM,EACN,aAAa,EACd,MAAM,oBAAoB,CAAC;AAW5B,OAAO,EAAE,QAAQ,EAAoB,MAAM,MAAM,CAAC;AAIlD,OAAO,EAEL,qBAAqB,EACrB,eAAe,EACf,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,WAAW,SAAU,SAAQ,MAAM;CAAG;AAE5C,qBACa,SAAU,SAAQ,QAAQ;IACrC,OAAO,CAAC,aAAa,CAAS;IAE9B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM;cAId,QAAQ;IASjB,YAAY,CAAC,OAAO,CAAC,EAAE,aAAa;IAoCpC,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB;IAK9D,WAAW,CAAC,CAAC,SAAS,MAAM,eAAe,EAChD,IAAI,EAAE,CAAC,EACP,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAC5B,QAAQ,CAAC,EAAE,OAAO;I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,SAAS,MAAM,eAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,MAAM;IAS3F,YAAY,CAAC,CAAC,SAAS,MAAM,eAAe,EAC1C,IAAI,EAAE,CAAC,EACP,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAC5B,QAAQ,CAAC,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS;IAoBrB,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,kBAAkB;IA2B1B,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,cAAc;CA4EvB"}
package/dist/index.js CHANGED
@@ -122,15 +122,8 @@ var SysRouter = (_dec$5 = Sys(), _dec2$5 = BeanInfo({ module: "a-router" }), _de
122
122
  }
123
123
  getPagePath(path, options, absolute) {
124
124
  const query = options?.query;
125
- let params = options?.params;
126
- const paramsLocale = cast(params)?.locale;
127
- if (paramsLocale !== void 0) {
128
- const localeCurrent = paramsLocale === true ? this.app.meta.locale.current : paramsLocale;
129
- const locale = localeCurrent === this.sys.config.locale.default ? void 0 : localeCurrent;
130
- params = Object.assign({}, params, { locale });
131
- }
132
125
  const pagePath = combineParamsAndQuery(path, {
133
- params,
126
+ params: this._normalizePageParams(options?.params),
134
127
  query
135
128
  });
136
129
  return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;
@@ -220,6 +213,28 @@ var SysRouter = (_dec$5 = Sys(), _dec2$5 = BeanInfo({ module: "a-router" }), _de
220
213
  }).fullPath;
221
214
  });
222
215
  }
216
+ getAliasPath(name, options, absolute) {
217
+ if (!this.sys.config.routes.name[name]?.alias) return;
218
+ const params = this._normalizePageParams(cast(options)?.params);
219
+ const query = cast(options)?.query;
220
+ const aliasName = `$alias:${name}`;
221
+ const routeAlias = this._resolveNameOrPath(query, (query) => {
222
+ return this.router.resolve({
223
+ name: this.router.hasRoute(aliasName) ? aliasName : name,
224
+ params,
225
+ query
226
+ }).fullPath;
227
+ });
228
+ const pagePath = routeAlias.startsWith("/__alias__") ? routeAlias.substring(10) || "/" : routeAlias;
229
+ return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;
230
+ }
231
+ _normalizePageParams(params) {
232
+ const paramsLocale = cast(params)?.locale;
233
+ if (paramsLocale === void 0) return params;
234
+ const localeCurrent = paramsLocale === true ? this.app.meta.locale.current : paramsLocale;
235
+ const locale = localeCurrent === this.sys.config.locale.default ? void 0 : localeCurrent;
236
+ return Object.assign({}, params, { locale });
237
+ }
223
238
  _resolveNameOrPath(query, fn) {
224
239
  const query1 = {};
225
240
  const query2 = [];
@@ -274,11 +289,14 @@ var SysRouter = (_dec$5 = Sys(), _dec2$5 = BeanInfo({ module: "a-router" }), _de
274
289
  else name = `${module.info.relativeName}:${String(route.name)}`;
275
290
  const configRoute = name ? this.sys.config.routes.name[name] : this.sys.config.routes.path[path];
276
291
  if (configRoute) route = deepExtend({}, route, configRoute);
277
- if (name && configRoute?.alias) this.router.addRoute({
278
- name: `$alias:${name}`,
279
- path: `/__alias__${configRoute?.alias}`,
280
- redirect: ""
281
- });
292
+ if (name && configRoute?.alias) {
293
+ const alias = Array.isArray(configRoute.alias) ? configRoute.alias[0] : configRoute.alias;
294
+ this.router.addRoute({
295
+ name: `$alias:${name}`,
296
+ path: `/__alias__${alias}`,
297
+ redirect: ""
298
+ });
299
+ }
282
300
  if (!name) name = `$:${path}`;
283
301
  const meta = route.meta;
284
302
  const component = route.component;
@@ -457,13 +475,12 @@ var ServiceRouterGuards = (_dec$2 = Service(), _dec2$2 = BeanInfo({ module: "a-r
457
475
  const resLoadModule = await this._forceLoadModule(router, match?.name, match?.path);
458
476
  if (resLoadModule && resLoadModule !== true) return resLoadModule;
459
477
  if (resLoadModule === false) return to.fullPath;
460
- if (router.getRealRouteName(match?.name)) {
461
- const routeAlias = router.resolveName(`$alias:${match?.name}`, {
462
- params: to.params,
463
- query: to.query
464
- });
465
- return (routeAlias.startsWith("/__alias__") ? routeAlias.substring(10) : routeAlias) || "/";
466
- } else return {
478
+ const name = router.getRealRouteName(match?.name);
479
+ if (name) return router.getAliasPath(name, {
480
+ params: to.params,
481
+ query: to.query
482
+ }) || "/";
483
+ else return {
467
484
  path: Array.isArray(alias) ? alias[0] : alias,
468
485
  params: to.params,
469
486
  query: to.query
@@ -572,13 +589,26 @@ var Monkey = class extends BeanSimple {
572
589
  constructor(...args) {
573
590
  super(...args);
574
591
  this._beanRouter = void 0;
592
+ this._sysRouter = void 0;
575
593
  this.serviceRouterGuards = void 0;
576
594
  }
595
+ async _getSysRouter() {
596
+ if (!this._sysRouter) this._sysRouter = await this.sys.bean._getBean("a-router.sys.router", false);
597
+ return this._sysRouter;
598
+ }
577
599
  async getBeanRouter() {
578
600
  if (!this._beanRouter) this._beanRouter = this.app.meta.$router = await this.bean._getBean("a-router.bean.router", true, true);
579
601
  return this._beanRouter;
580
602
  }
581
603
  async appInitialize() {
604
+ const ssrState = this.ctx.meta.$ssr.state;
605
+ if (process.env.SERVER && (ssrState.ssrProfile === void 0 || ssrState.ssrProfileOptions === void 0)) {
606
+ const pagePathFull = this.app.$getCurrentPagePath();
607
+ if (pagePathFull) {
608
+ const route = await (await this._getSysRouter()).resolveRoute(pagePathFull, true, false);
609
+ if (route) this.ctx.meta.$ssr._setProfile(route.meta.ssrProfile, route.meta.ssrProfileOptions);
610
+ }
611
+ }
582
612
  this.serviceRouterGuards = await this.bean._newBean(ServiceRouterGuards, false);
583
613
  if (process.env.CLIENT) this._ssrErrorHandler();
584
614
  }
@@ -712,7 +742,7 @@ var MonkeySys = class extends BeanSimple {
712
742
  this._moduleSelf = moduleSelf;
713
743
  }
714
744
  async getSysRouter() {
715
- if (!this._sysRouter) this._sysRouter = await this.bean._getBean("a-router.sys.router", false);
745
+ if (!this._sysRouter) this._sysRouter = await this.sys.bean._getBean("a-router.sys.router", false);
716
746
  return this._sysRouter;
717
747
  }
718
748
  async moduleLoading(module) {
@@ -736,16 +766,31 @@ var MonkeySys = class extends BeanSimple {
736
766
  error.message = process.env.SERVER ? error.url : error.pagePath;
737
767
  throw error;
738
768
  };
739
- app.$gotoPage = (pagePath, options) => {
740
- const query = options?.query ?? {};
769
+ app.$getPagePath = (pagePath, options) => {
770
+ const query = { ...options?.query };
741
771
  if (options?.returnTo) {
742
- const returnTo = typeof options?.returnTo === "string" ? options?.returnTo : app.$getCurrentPagePath();
772
+ const returnTo = typeof options.returnTo === "string" ? options.returnTo : app.$getCurrentPagePath();
743
773
  if (returnTo !== app.$getPagePathHome()) query[app.sys.env.ROUTER_KEY_RETURNTO] = returnTo;
744
774
  }
745
- pagePath = app.meta.$router.getPagePath(pagePath, {
775
+ return app.meta.$router.getPagePath(pagePath, {
746
776
  params: options?.params,
747
777
  query
748
778
  });
779
+ };
780
+ app.$getPagePathLogin = (returnTo, cause) => {
781
+ const query = {};
782
+ if (cause) query.cause = cause;
783
+ const returnTo2 = returnTo === app.sys.env.ROUTER_PAGE_LOGIN ? void 0 : returnTo;
784
+ return app.$getPagePath(app.sys.env.ROUTER_PAGE_LOGIN, {
785
+ query,
786
+ returnTo: returnTo2
787
+ });
788
+ };
789
+ app.$getPagePathAccessDenied = () => {
790
+ return app.$getPagePath("/home/base/errorAccessDenied");
791
+ };
792
+ app.$gotoPage = (pagePath, options) => {
793
+ pagePath = app.$getPagePath(pagePath, options);
749
794
  if (process.env.SERVER || options?.forceRedirect) return app.$redirect(pagePath);
750
795
  if (isHttpUrl(pagePath)) window.location[options?.replace ? "replace" : "assign"](pagePath);
751
796
  else return app.meta.$router[options?.replace ? "replace" : "push"](pagePath);
@@ -759,16 +804,12 @@ var MonkeySys = class extends BeanSimple {
759
804
  };
760
805
  app.$gotoLogin = (returnTo, cause) => {
761
806
  if (!returnTo && cast(app.meta.$router.currentRoute)?.path === app.sys.env.ROUTER_PAGE_LOGIN) return;
762
- const query = {};
763
- if (cause) query.cause = cause;
764
- const returnTo2 = returnTo === app.sys.env.ROUTER_PAGE_LOGIN ? void 0 : returnTo ?? true;
765
- return app.$gotoPage(app.sys.env.ROUTER_PAGE_LOGIN, {
766
- query,
767
- returnTo: returnTo2
768
- });
807
+ const returnTo2 = returnTo ?? app.$getCurrentPagePath();
808
+ const pagePath = app.$getPagePathLogin(returnTo2, cause);
809
+ return app.$gotoPage(pagePath);
769
810
  };
770
811
  app.$gotoAccessDenied = () => {
771
- const pagePath = "/home/base/errorAccessDenied";
812
+ const pagePath = app.$getPagePathAccessDenied();
772
813
  if (cast(app.meta.$router.currentRoute)?.path === pagePath) return;
773
814
  return app.$gotoPage(pagePath, { replace: true });
774
815
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["RouterView","h","KeepAlive","Transition","BeanControllerBase","cast","pageRouteKey","routerViewKey","BeanRouterViewBase","__init__","bean","_setBean","$router","addRouterView","__dispose__","removeRouterView","backRoute","_route","forwardRoute","setPageMeta","_pageMeta","prepareRouteMeta","Error","getKeepAliveInclude","render","slots","default","component","routeMeta","route","vnode","Component","key","componentKey","zovaHostProviders","include","_createVNode","RouterView","h","cast","Controller","pageRouteKey","BeanRouterViewBase","ControllerRouterViewEmpty","_dec","_dec2","__z_BeanInfo","module","_class","__init__","render","slots","default","component","vnode","Component","zovaHostProviders","route","_createVNode"],"sources":["../src/model/pageData.ts","../src/lib/const.ts","../src/lib/utils.ts","../src/types/utils.ts","../src/bean/sys.router.ts","../src/bean/bean.router.ts","../src/bean/bean.routerGuardsBase.ts","../src/types/router.ts","../src/service/routerGuards.ts","../src/lib/routerViewBase.tsx","../src/component/routerViewEmpty/controller.tsx","../src/.metadata/component/routerViewEmpty.ts","../src/config/config.ts","../src/monkey.ts","../src/monkeySys.ts","../src/.metadata/index.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanModelBase, Model } from 'zova-module-a-model';\nexport let ModelPageData = (_dec = Model(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class ModelPageData extends BeanModelBase {\n constructor(...args) {\n super(...args);\n this._pageDataInner = void 0;\n this.current = void 0;\n }\n async __init__() {\n if (process.env.SERVER) {\n const pagePath = this.$ssr.state.pagePath;\n if (pagePath) {\n this._pageDataInner = this.getPageData(pagePath);\n this._pageDataInner = this.$ssr.state.pageData;\n this.current = this._pageDataInner;\n }\n } else {\n if (this.$ssr.isRuntimeSsrPreHydration) {\n this.current = this.$ssr.state.pageData;\n } else {\n const route = this.$pageRoute;\n this.current = route ? this.getPageData(route.path) : undefined;\n }\n }\n }\n getPageData(pagePath) {\n return this.$useStateMem({\n queryKey: ['pageData', pagePath]\n });\n }\n}) || _class) || _class);","export const pageRouteKey = '$$pageRoute';\nexport const routerViewKey = '$$routerView';","import { routerViewLocationKey } from '@cabloy/vue-router';\nimport { inject } from 'vue';\nimport { pageRouteKey } from './const.js';\nexport function getRouteMatched(route) {\n let match = route.matched.find(item => item.aliasOf);\n if (match) {\n match = match.aliasOf;\n } else {\n match = route.matched[route.matched.length - 1];\n }\n return match;\n}\nexport function getRealRouteName(name) {\n if (!name) return undefined;\n name = String(name);\n if (name.startsWith('$:')) return undefined;\n return name;\n}\nexport function isRouterName(name) {\n return !!name && name.includes(':') && !name.includes('/');\n}\nexport function getPageRoute(ctx) {\n const route = ctx.bean._getBeanFromHost({\n name: pageRouteKey\n });\n return route;\n}\nexport function getCurrentRoute(ctx) {\n const route = ctx.util.instanceScope(() => {\n return inject(routerViewLocationKey);\n });\n return route;\n}\nexport const scrollBehavior = (to, _from, savedPosition) => {\n if (savedPosition) {\n return new Promise(resolve => {\n setTimeout(() => {\n // savedPosition = Object.assign({}, savedPosition, { behavior: 'smooth' });\n resolve(savedPosition);\n }, 100);\n });\n } else if (to.hash) {\n return new Promise(resolve => {\n setTimeout(() => {\n // resolve({ el: to.hash, behavior: 'smooth' });\n resolve({\n el: to.hash\n });\n }, 200);\n });\n } else {\n return {\n left: 0,\n top: 0\n };\n }\n};","export const SymbolRouterHistory = Symbol('SymbolRouterHistory');","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport * as ModuleInfo from '@cabloy/module-info';\nimport { combineParamsAndQuery } from '@cabloy/utils';\nimport { createMemoryHistory, createRouter, createWebHashHistory, createWebHistory } from '@cabloy/vue-router';\nimport { BeanBase, cast, deepExtend } from 'zova';\nimport { Sys } from 'zova-module-a-bean';\nimport { getCurrentRoute, getRealRouteName, getRouteMatched, isRouterName } from '../lib/utils.js';\nimport { SymbolRouterHistory } from '../types/utils.js';\nexport let SysRouter = (_dec = Sys(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class SysRouter extends BeanBase {\n constructor(...args) {\n super(...args);\n this._vueRouterSys = void 0;\n }\n get router() {\n return this._vueRouterSys;\n }\n __get__(prop) {\n return this._vueRouterSys && this._vueRouterSys[prop];\n }\n async __init__() {\n // create router\n this._vueRouterSys = this.createRouter();\n // config.routes\n this._loadConfigRoutes();\n // legacy routes\n this._loadLegacyRoutes();\n }\n createRouter(options) {\n options = Object.assign({}, options);\n // matcher\n if (!options.matcher) {\n options.matcher = this._vueRouterSys?.matcher;\n }\n // routes\n if (!options.routes) {\n if (!this._vueRouterSys) {\n options.routes = [];\n }\n }\n // scrollBehavior\n if (!options.scrollBehavior) {\n options.scrollBehavior = this.scope.config.scrollBehavior;\n }\n // history\n if (!options.history) {\n const createHistory = process.env.SERVER ? createMemoryHistory : this.sys.env.ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory;\n const routeBase = process.env.SERVER || this.sys.env.ROUTER_MODE === 'history' ? this.sys.env.APP_PUBLIC_PATH : undefined;\n options.history = createHistory(routeBase);\n }\n // create\n const router = createRouter(options);\n cast(router).__hasDevtools = true;\n router[SymbolRouterHistory] = options.history;\n return router;\n }\n createAsyncComponent(component) {\n if (typeof component !== 'string') return component;\n return this.sys.meta.component.createAsyncComponent(component);\n }\n getPagePath(path, options, absolute) {\n const query = options?.query;\n let params = options?.params;\n const paramsLocale = cast(params)?.locale;\n if (paramsLocale !== undefined) {\n const localeCurrent = paramsLocale === true ? this.app.meta.locale.current : paramsLocale;\n const locale = localeCurrent === this.sys.config.locale.default ? undefined : localeCurrent;\n params = Object.assign({}, params, {\n locale\n });\n }\n const pagePath = combineParamsAndQuery(path, {\n params,\n query\n });\n return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;\n }\n async resolveRoute(url, check404, checkAliasOf) {\n const pagePath = this.sys.util.getPagePathFromAbsoluteUrl(url);\n let route = await this.ensureRoute(pagePath);\n if (check404 && route.name === '$:/:catchAll(.*)*') return;\n // aliasOf\n if (checkAliasOf) {\n const matchItem = route.matched.find(item => item.aliasOf);\n if (matchItem) {\n route = matchItem.aliasOf;\n }\n // 404\n if (check404 && route.name === '$:/:catchAll(.*)*') return;\n }\n // ok\n return route;\n }\n checkPathValid(to) {\n const _name = to && typeof to === 'object' ? to.name : undefined;\n const _path = to && typeof to === 'object' ? to.name ?? to.path : to;\n // legacy\n if (this._findLegacyRoute(_name, _path)) return true;\n // general check\n if (!_path) return true;\n const moduleName = ModuleInfo.parseName(_path);\n if (!moduleName) return true;\n return this.sys.meta.module.exists(moduleName);\n }\n checkActiveOfFullPath(fullPath, currentRoute) {\n if (!currentRoute) {\n currentRoute = getCurrentRoute(this.ctx)?.value;\n }\n if (!currentRoute) return false;\n if (currentRoute.fullPath === fullPath) return true;\n if (!currentRoute.matched || currentRoute.matched.length === 0) return false;\n return currentRoute.matched.some(routeAlias => {\n const fullPathAlias = this.getPagePath(routeAlias.path, {\n params: currentRoute.params,\n query: currentRoute.query\n });\n return fullPathAlias === fullPath;\n });\n }\n async ensureRoute(pagePath) {\n // try to resolve, support alias route\n let route = this._vueRouterSys.resolve(pagePath);\n if (route && route.name !== '$:/:catchAll(.*)*') return route;\n // try to load module\n const moduleName = ModuleInfo.parseName(pagePath);\n if (moduleName) {\n if (this.sys.meta.module.exists(moduleName)) {\n const module = this.sys.meta.module.get(moduleName);\n if (!module) {\n await this.sys.meta.module.use(moduleName);\n // try to resolve again\n route = this._vueRouterSys.resolve(pagePath);\n }\n }\n }\n return route;\n }\n\n /** @internal */\n _registerRoutes(module) {\n if (!module.resource.routes) return;\n for (const route of module.resource.routes) {\n this._registerRoute(route, module);\n }\n }\n\n /** @internal */\n _findConfigRoute(name, path) {\n name = this.getRealRouteName(name);\n return name ? this.sys.config.routes.name[name] : this.sys.config.routes.path[path];\n }\n\n /** @internal */\n _findLegacyRoute(name, path) {\n const legacyRoutes = cast(this.sys.meta).legacyRoutes;\n if (!legacyRoutes) return;\n name = this.getRealRouteName(name);\n return legacyRoutes.find(item => {\n return name ? item.name === name : item.path === path;\n });\n }\n getRouteMatched(route) {\n return getRouteMatched(route);\n }\n getRealRouteName(name) {\n return getRealRouteName(name);\n }\n isRouterName(name) {\n return isRouterName(name);\n }\n resolveName(name, options) {\n const params = cast(options)?.params;\n const query = cast(options)?.query;\n return this._resolveNameOrPath(query, query => {\n const route = this.router.resolve({\n name,\n params,\n query\n });\n return route.fullPath;\n });\n }\n _resolveNameOrPath(query, fn) {\n const query1 = {};\n const query2 = [];\n if (query) {\n for (const key in query) {\n const value = query[key];\n if (value && typeof value === 'object') {\n query2.push([key, value]);\n } else {\n query1[key] = value;\n }\n }\n }\n // resolve\n const fullPath = fn(query1);\n // query2\n const query2str = query2.map(([key, value]) => {\n return `${encodeURIComponent(key)}=${encodeURIComponent(JSON.stringify(value))}`;\n }).join('&');\n // join\n if (!query2str) return fullPath;\n const join = Object.keys(query1).length > 0 ? '&' : '?';\n return `${fullPath}${join}${query2str}`;\n }\n _loadConfigRoutes() {\n const routesPath = this.sys.config.routes.path;\n for (const key in routesPath) {\n const route = routesPath[key];\n if (!route) continue;\n this._loadConfigRoute({\n ...route,\n path: key,\n name: `$:${key}`\n });\n }\n const routesName = this.sys.config.routes.name;\n for (const key in routesName) {\n const route = routesName[key];\n if (!route) continue;\n this._loadConfigRoute({\n ...route,\n path: route.path || route.alias,\n name: key\n });\n }\n }\n _loadLegacyRoutes() {\n const legacyRoutes = cast(this.sys.meta).legacyRoutes;\n if (!legacyRoutes) return;\n for (const route of legacyRoutes) {\n this._registerRoute(route);\n }\n }\n _loadConfigRoute(route) {\n this.router.addRoute(route);\n }\n _registerRoute(route, module) {\n // path\n let path;\n if (route.path !== undefined) {\n if (!module || route.meta?.absolute === true) {\n path = route.path;\n } else {\n path = route.path ? `/${module.info.pid}/${module.info.name}/${route.path}` : `/${module.info.pid}/${module.info.name}`;\n }\n }\n // name\n let name;\n if (route.name) {\n if (!module || route.meta?.absolute === true) {\n name = String(route.name);\n } else {\n name = `${module.info.relativeName}:${String(route.name)}`;\n }\n }\n // config route\n const configRoute = name ? this.sys.config.routes.name[name] : this.sys.config.routes.path[path];\n if (configRoute) {\n route = deepExtend({}, route, configRoute);\n }\n // name alias\n if (name && configRoute?.alias) {\n // add extra route\n this.router.addRoute({\n name: `$alias:${name}`,\n path: `/__alias__${configRoute?.alias}`,\n redirect: ''\n });\n }\n // name\n if (!name) {\n name = `$:${path}`;\n }\n // meta\n const meta = route.meta;\n // component\n const component = route.component;\n // layout / routeData\n let layout = meta?.layout;\n let routeData;\n let routeNameParent;\n if (layout === false) {\n routeData = {\n ...route,\n name,\n path,\n component,\n meta\n };\n } else {\n if (layout === undefined || layout === 'default') {\n layout = this.sys.config.layout.component.default;\n } else if (layout === 'empty') {\n layout = this.sys.config.layout.component.empty;\n }\n routeNameParent = `$:${name}`;\n routeData = {\n name: routeNameParent,\n path,\n component: this.createAsyncComponent(layout),\n children: [{\n ...route,\n name,\n path: '',\n component,\n meta\n }]\n };\n }\n // force delete\n if (this.router.hasRoute(routeNameParent)) {\n this.router.removeRoute(routeNameParent);\n }\n if (this.router.hasRoute(name)) {\n this.router.removeRoute(name);\n }\n // add\n this.router.addRoute(routeData);\n }\n}) || _class) || _class);","var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, Use } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\nimport { ModelPageData } from '../model/pageData.js';\nimport { SysRouter } from './sys.router.js';\nexport let BeanRouter = (_dec = Bean(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec3 = Use(), _dec4 = Reflect.metadata(\"design:type\", typeof SysRouter === \"undefined\" ? Object : SysRouter), _dec5 = Use(), _dec6 = Reflect.metadata(\"design:type\", typeof ModelPageData === \"undefined\" ? Object : ModelPageData), _dec(_class = _dec2(_class = (_class2 = class BeanRouter extends BeanBase {\n constructor(...args) {\n super(...args);\n this._vueRouterApp = void 0;\n this._eventRouterGuards = [];\n this._routerViews = [];\n _initializerDefineProperty(this, \"$$sysRouter\", _descriptor, this);\n _initializerDefineProperty(this, \"$$modelPageData\", _descriptor2, this);\n }\n // for prepare pageData on server\n\n get router() {\n return this._vueRouterApp;\n }\n __dispose__() {\n for (const fn of this._eventRouterGuards) {\n fn();\n }\n }\n __get__(prop) {\n // SymbolRouter first\n const value = this._vueRouterApp?.[prop];\n if (value !== undefined) return value;\n return this.$$sysRouter?.[prop];\n }\n async __init__(mainRouter) {\n // create router\n this._vueRouterApp = this.$$sysRouter.createRouter();\n if (!mainRouter) {\n // emit event\n await this.app.meta.event.emit('a-router:routerGuards', this);\n }\n }\n addRouterView(routerView) {\n this._routerViews.push(routerView);\n }\n removeRouterView(routerView) {\n const index = this._routerViews.findIndex(item => item === routerView);\n if (index > -1) {\n this._routerViews.splice(index, 1);\n }\n }\n afterEachBackRoute(route) {\n for (const routerView of this._routerViews) {\n const res = routerView.backRoute(route);\n if (res) break;\n }\n }\n afterEachForwardRoute(route) {\n for (const routerView of this._routerViews) {\n const res = routerView.forwardRoute(route);\n if (res) break;\n }\n }\n beforeEach(guard) {\n const fn = this._vueRouterApp.beforeEach(guard);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n beforeResolve(guard) {\n const fn = this._vueRouterApp.beforeResolve(guard);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n afterEach(guard) {\n const fn = this._vueRouterApp.afterEach(guard);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n onError(handler) {\n const fn = this._vueRouterApp.onError(handler);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n setPageMeta(route, pageMeta) {\n for (const routerView of this._routerViews) {\n routerView.setPageMeta(route, pageMeta);\n }\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"$$sysRouter\", [_dec3, _dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"$$modelPageData\", [_dec5, _dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2)) || _class) || _class);","var _dec, _dec2, _dec3, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, Virtual } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\nexport let BeanRouterGuardsBase = (_dec = Bean(), _dec2 = Virtual(), _dec3 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = _dec3(_class = class BeanRouterGuardsBase extends BeanBase {\n constructor(...args) {\n super(...args);\n this._eventRouterGuards = void 0;\n }\n async __init__() {\n this._eventRouterGuards = this.app.meta.event.on('a-router:routerGuards', async (router, next) => {\n this.onRouterGuards(router);\n return await next();\n });\n }\n __dispose__() {\n this.dispose();\n }\n dispose() {\n if (this._eventRouterGuards) {\n this._eventRouterGuards();\n }\n }\n onRouterGuards(_router) {}\n}) || _class) || _class) || _class);","import 'vue-router';\nexport let NavigationType = /*#__PURE__*/function (NavigationType) {\n NavigationType[\"pop\"] = \"pop\";\n NavigationType[\"push\"] = \"push\";\n return NavigationType;\n}({});\nexport let NavigationDirection = /*#__PURE__*/function (NavigationDirection) {\n NavigationDirection[\"back\"] = \"back\";\n NavigationDirection[\"forward\"] = \"forward\";\n NavigationDirection[\"unknown\"] = \"\";\n return NavigationDirection;\n}({});","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport * as ModuleInfo from '@cabloy/module-info';\nimport { Service } from 'zova-module-a-bean';\nimport { BeanRouterGuardsBase } from '../bean/bean.routerGuardsBase.js';\nimport { NavigationDirection, NavigationType } from '../types/router.js';\nexport let ServiceRouterGuards = (_dec = Service(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class ServiceRouterGuards extends BeanRouterGuardsBase {\n onRouterGuards(router) {\n const self = this;\n router.beforeEach(async to => {\n // match path\n let match = to.matched.find(item => item.aliasOf);\n if (match) {\n match = match.aliasOf;\n } else {\n match = to.matched[to.matched.length - 1];\n // prepareCheck\n if (!(await this._prepareCheck(match?.path, to.path))) {\n // redirect again\n return to.fullPath;\n }\n // legacy\n const legacyRoute = router._findLegacyRoute(match?.name, match?.path);\n if (legacyRoute) return;\n // alias\n const configRoute = router._findConfigRoute(match?.name, match?.path);\n const alias = configRoute?.alias;\n if (alias) {\n // force load module\n const resLoadModule = await this._forceLoadModule(router, match?.name, match?.path);\n if (resLoadModule && resLoadModule !== true) return resLoadModule;\n if (resLoadModule === false) return to.fullPath;\n if (router.getRealRouteName(match?.name)) {\n const routeAlias = router.resolveName(`$alias:${match?.name}`, {\n params: to.params,\n query: to.query\n });\n const fullPath = routeAlias.startsWith('/__alias__') ? routeAlias.substring('/__alias__'.length) : routeAlias;\n return fullPath || '/';\n } else {\n return {\n path: Array.isArray(alias) ? alias[0] : alias,\n params: to.params,\n query: to.query\n };\n }\n }\n }\n // force load module\n const resLoadModule = await this._forceLoadModule(router, match?.name, match?.path);\n if (resLoadModule === true) return;\n if (resLoadModule) return resLoadModule;\n // redirect again\n return to.fullPath;\n });\n router.afterEach(function (to, from, error) {\n if (error) return;\n const info = arguments[3];\n // from\n if (from.fullPath !== to.fullPath) {\n self._afterEachFrom(router, from, info);\n }\n // to\n router.afterEachForwardRoute(to);\n });\n }\n _afterEachFrom(router, from, info) {\n if (!info) return;\n const needBack = info.type === NavigationType.pop && info.direction === NavigationDirection.back || info.type === NavigationType.push && info.replace;\n if (!needBack) return;\n router.afterEachBackRoute(from);\n }\n\n // if 404 then check if module loaded\n async _prepareCheck(pathMatched, pathTo) {\n if (pathMatched === '/:catchAll(.*)*') {\n const moduleInfo = ModuleInfo.parseInfo(ModuleInfo.parseName(pathTo));\n if (moduleInfo && this.app.meta.module.exists(moduleInfo.relativeName) && !this.app.meta.module.get(moduleInfo.relativeName, false)) {\n // use module\n await this.app.meta.module.use(moduleInfo.relativeName);\n // redirect again\n return false;\n }\n }\n return true;\n }\n async _forceLoadModule(router, name, path) {\n const nameOrPath = router.getRealRouteName(name) || path;\n // module info\n const moduleInfo = ModuleInfo.parseInfo(ModuleInfo.parseName(nameOrPath));\n if (!moduleInfo) {\n // donothing\n return true;\n }\n const moduleName = moduleInfo.relativeName;\n // check if exists\n if (!this.app.meta.module.exists(moduleName)) return '/404';\n // check if loaded\n const module = this.app.meta.module.get(moduleName, false);\n if (module) return true;\n // use module\n await this.app.meta.module.use(moduleName);\n // means need load\n return false;\n }\n}) || _class) || _class);","import type { RouteLocationNormalizedLoadedGeneric } from '@cabloy/vue-router';\n\nimport { RouterView } from '@cabloy/vue-router';\nimport { h, KeepAlive, Transition } from 'vue';\nimport { BeanControllerBase, cast } from 'zova';\n\nimport type { IPageMeta } from '../types/pageMeta.js';\nimport type { IRouterViewSlotParams, IRouteViewRouteMeta } from '../types/routerView.js';\n\nimport { pageRouteKey, routerViewKey } from './const.js';\n\nexport interface IRouterViewPropsBase {}\n\nexport class BeanRouterViewBase extends BeanControllerBase implements IRouterViewPropsBase {\n protected async __init__() {\n this.bean._setBean(routerViewKey, this);\n this.$router.addRouterView(this);\n }\n\n protected __dispose__() {\n this.$router.removeRouterView(this);\n }\n\n public backRoute(_route: RouteLocationNormalizedLoadedGeneric) {\n return false;\n }\n\n public forwardRoute(_route: RouteLocationNormalizedLoadedGeneric) {\n return false;\n }\n\n public setPageMeta(_route: RouteLocationNormalizedLoadedGeneric, _pageMeta: IPageMeta) {}\n\n protected prepareRouteMeta(_route: RouteLocationNormalizedLoadedGeneric): IRouteViewRouteMeta {\n throw new Error('Not Implemented');\n }\n\n protected getKeepAliveInclude(): string[] | undefined {\n throw new Error('Not Implemented');\n }\n\n protected render() {\n const slots = {\n default: (component: IRouterViewSlotParams) => {\n const routeMeta = this.prepareRouteMeta(component.route);\n return h(Transition, null, {\n default: () => {\n const vnode = h(component.Component as any, {\n key: routeMeta.componentKey,\n });\n cast(vnode).zovaHostProviders = { [pageRouteKey]: component.route };\n return [\n h(\n KeepAlive,\n {\n include: this.getKeepAliveInclude(),\n },\n [vnode],\n ),\n ];\n },\n });\n },\n };\n return <RouterView v-slots={slots}></RouterView>;\n }\n}\n","import { RouterView } from '@cabloy/vue-router';\nimport { h } from 'vue';\nimport { cast } from 'zova';\nimport { Controller } from 'zova-module-a-bean';\n\nimport { pageRouteKey } from '../../lib/const.js';\nimport { BeanRouterViewBase } from '../../lib/routerViewBase.js';\n\n@Controller()\nexport class ControllerRouterViewEmpty extends BeanRouterViewBase {\n protected async __init__() {}\n\n protected render() {\n const slots = {\n default: component => {\n const vnode = h(component.Component);\n cast(vnode).zovaHostProviders = { [pageRouteKey]: component.route };\n return vnode;\n },\n };\n return <RouterView v-slots={slots}></RouterView>;\n }\n}\n","import { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\nimport { ControllerRouterViewEmpty } from '../../component/routerViewEmpty/controller.jsx';\nexport const ZRouterViewEmpty = defineComponent(_props => {\n useController(ControllerRouterViewEmpty, undefined, undefined);\n return () => {};\n}, prepareComponentOptions());","import { scrollBehavior } from '../lib/utils.js';\nexport const config = _sys => {\n return {\n scrollBehavior\n };\n};","import * as ModuleInfo from '@cabloy/module-info';\nimport { shallowReactive } from 'vue';\nimport { BeanControllerPageBase, BeanSimple, cast, useComputed } from 'zova';\nimport { routerViewKey } from './lib/const.js';\nimport { getCurrentRoute, getPageRoute, getRealRouteName, getRouteMatched } from './lib/utils.js';\nimport { ServiceRouterGuards } from './service/routerGuards.js';\nimport { SymbolRouterHistory } from './types/utils.js';\nexport class Monkey extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._beanRouter = void 0;\n this.serviceRouterGuards = void 0;\n }\n async getBeanRouter() {\n if (!this._beanRouter) {\n // markReactive: true\n this._beanRouter = this.app.meta.$router = await this.bean._getBean('a-router.bean.router', true, true);\n }\n return this._beanRouter;\n }\n async appInitialize() {\n // router\n this.serviceRouterGuards = await this.bean._newBean(ServiceRouterGuards, false);\n // ssr errorHandler\n if (process.env.CLIENT) {\n this._ssrErrorHandler();\n }\n }\n async appInitialized() {\n const beanRouter = await this.getBeanRouter();\n // emit event\n await this.app.meta.event.emit('a-router:routerGuards', beanRouter);\n }\n appClose() {\n if (this.serviceRouterGuards) {\n this.serviceRouterGuards.dispose();\n }\n }\n async appReady() {\n const beanRouter = await this.getBeanRouter();\n // pagePath\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n const pagePathFull = this.ctx.meta.$ssr.state.pagePathFull;\n if (pagePathFull) {\n const routerHistory = beanRouter.router[SymbolRouterHistory];\n routerHistory.push(pagePathFull);\n }\n }\n // use router\n this.app.vue.use(beanRouter);\n // ssr\n if (process.env.SERVER) {\n // push\n const pagePath = this.app.$getCurrentPagePath();\n beanRouter.push(pagePath);\n await beanRouter.isReady();\n } else if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n await beanRouter.isReady();\n }\n }\n async beanInit(bean, beanInstance) {\n bean.defineProperty(beanInstance, '$router', {\n enumerable: false,\n configurable: true,\n get() {\n return bean._getBeanFromHost('a-router.bean.router');\n }\n });\n bean.defineProperty(beanInstance, '$routerView', {\n enumerable: false,\n configurable: true,\n get() {\n return bean._getBeanFromHost({\n name: routerViewKey\n });\n }\n });\n bean.defineProperty(beanInstance, '$pageRoute', {\n enumerable: false,\n configurable: true,\n get() {\n return useComputed(() => {\n return getPageRoute(cast(bean).ctx);\n });\n }\n });\n bean.defineProperty(beanInstance, '$currentRoute', {\n enumerable: false,\n configurable: true,\n get() {\n return useComputed(() => {\n return getCurrentRoute(cast(bean).ctx);\n });\n }\n });\n }\n controllerDataPrepare(controllerData, ctx) {\n controllerData.context.route = getPageRoute(ctx);\n }\n controllerDataInit(controllerData, controller) {\n // only for controller page\n if (!(controller instanceof BeanControllerPageBase)) return;\n const route = controllerData.context.route;\n this._initControllerRoute(route, controller);\n }\n controllerDataUpdate(controller) {\n // only for controller page\n if (!(controller instanceof BeanControllerPageBase)) return;\n const route = getPageRoute(cast(cast(controller).ctx));\n this._initControllerRoute(route, controller);\n }\n _initControllerRoute(route, controller) {\n if (!route) return;\n const routeMatched = getRouteMatched(route);\n if (!routeMatched) return;\n // check if the same\n if (controller.$routeMatched && !this._checkIfRouteSame(routeMatched, controller.$routeMatched)) return;\n // check if changed\n const changed = !controller.$route || controller.$route.fullPath !== route.fullPath;\n if (!changed) return;\n controller.$route = route;\n controller.$routeMatched = routeMatched;\n // update $params/$query\n const routeName = getRealRouteName(routeMatched.name);\n const schemaKey = routeName || String(routeMatched.path);\n let schemas;\n const moduleInfo = ModuleInfo.parseInfo(ModuleInfo.parseName(schemaKey));\n if (!moduleInfo) {\n // do nothing\n return;\n }\n if (!this.app.meta.module.exists(moduleInfo.relativeName)) {\n // do nothing\n return;\n }\n const module = this.app.meta.module.get(moduleInfo.relativeName);\n if (routeName) {\n schemas = module.resource.pageNameSchemas?.[schemaKey];\n } else {\n schemas = module.resource.pagePathSchemas?.[schemaKey];\n }\n if (schemas?.params) {\n const params = schemas.params.parse(route.params);\n if (!controller.$params) {\n controller.$params = process.env.SERVER ? params : shallowReactive(params);\n } else {\n // hold the same $params ref\n Object.assign(controller.$params, params);\n }\n }\n if (schemas?.query) {\n const query = schemas.query.parse(route.query);\n if (!controller.$query) {\n controller.$query = process.env.SERVER ? query : shallowReactive(query);\n } else {\n // hold the same $query ref\n Object.assign(controller.$query, query);\n }\n }\n }\n _checkIfRouteSame(route1, route2) {\n return route1.name && route1.name === route2.name || route1.path === route2.path;\n }\n _ssrErrorHandler() {\n if (!process.env.CLIENT) return;\n this.app.meta.event.on('app:errorHandler', (data, next) => {\n const err = next();\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultClient(err, data);\n });\n }\n _errorHandlerDefaultClient(err, _data) {\n if (!process.env.CLIENT) return err;\n // client\n if ([301, 302].includes(Number(err.code))) {\n this.app.$gotoPage(err.pagePath);\n return undefined;\n }\n // COMPONENT_UNMOUNTED\n if (err.code === 600) {\n // do nothing\n return undefined;\n }\n // 401\n if (err.code === 401) {\n this.app.$gotoLogin();\n return undefined;\n }\n // not handled\n return err;\n }\n}","import { BeanSimple, cast, isHttpUrl } from 'zova';\nexport class MonkeySys extends BeanSimple {\n constructor(moduleSelf) {\n super();\n this._moduleSelf = void 0;\n this._sysRouter = void 0;\n this._moduleSelf = moduleSelf;\n }\n async getSysRouter() {\n if (!this._sysRouter) {\n this._sysRouter = await this.bean._getBean('a-router.sys.router', false);\n }\n return this._sysRouter;\n }\n async moduleLoading(module) {\n if (this._moduleSelf === module) return;\n if (!module.resource.routes) return;\n const sysRouter = await this.getSysRouter();\n sysRouter._registerRoutes(module);\n }\n async moduleLoaded(_module) {}\n async configLoaded(_module, _config) {}\n sysApplicationInitialize(app) {\n app.$redirect = (pagePath, status) => {\n const error = new Error();\n error.code = status ?? 302;\n if (isHttpUrl(pagePath)) {\n error.pagePath = pagePath;\n error.url = pagePath;\n } else {\n error.pagePath = pagePath;\n error.url = app.sys.util.getAbsoluteUrlFromPagePath(pagePath, true);\n }\n error.message = process.env.SERVER ? error.url : error.pagePath;\n throw error;\n };\n app.$gotoPage = (pagePath, options) => {\n const query = options?.query ?? {};\n // returnTo\n if (options?.returnTo) {\n const returnTo = typeof options?.returnTo === 'string' ? options?.returnTo : app.$getCurrentPagePath();\n if (returnTo !== app.$getPagePathHome()) {\n query[app.sys.env.ROUTER_KEY_RETURNTO] = returnTo;\n }\n }\n // combineParamsAndQuery\n pagePath = app.meta.$router.getPagePath(pagePath, {\n params: options?.params,\n query\n });\n // redirect\n if (process.env.SERVER || options?.forceRedirect) {\n return app.$redirect(pagePath);\n }\n // replace\n if (isHttpUrl(pagePath)) {\n window.location[options?.replace ? 'replace' : 'assign'](pagePath);\n } else {\n return app.meta.$router[options?.replace ? 'replace' : 'push'](pagePath);\n }\n };\n app.$gotoHome = options => {\n const pagePath = app.$getPagePathHome(options);\n return app.$gotoPage(pagePath, {\n ...options,\n params: undefined\n });\n };\n app.$gotoLogin = (returnTo, cause) => {\n if (!returnTo && cast(app.meta.$router.currentRoute)?.path === app.sys.env.ROUTER_PAGE_LOGIN) {\n return;\n }\n const query = {};\n if (cause) {\n query.cause = cause;\n }\n const returnTo2 = returnTo === app.sys.env.ROUTER_PAGE_LOGIN ? undefined : returnTo ?? true;\n return app.$gotoPage(app.sys.env.ROUTER_PAGE_LOGIN, {\n query,\n returnTo: returnTo2\n });\n };\n app.$gotoAccessDenied = () => {\n const pagePath = '/home/base/errorAccessDenied';\n if (cast(app.meta.$router.currentRoute)?.path === pagePath) return;\n return app.$gotoPage(pagePath, {\n replace: true\n });\n };\n app.$gotoReturnTo = returnTo => {\n const pagePath = app.$getReturnTo(returnTo);\n return app.$gotoPage(pagePath, {\n replace: true\n });\n };\n app.$getReturnTo = returnTo => {\n // not use ??\n const pagePath = returnTo || cast(app.meta.$router.currentRoute)?.query?.[app.sys.env.ROUTER_KEY_RETURNTO] || app.$getPagePathHome();\n return pagePath;\n };\n app.$getCurrentPagePath = () => {\n if (process.env.SERVER) {\n return app.ctx.meta.$ssr.state.pagePathFull ?? app.sys.util.getPagePathFromAbsoluteUrl(app.ctx.meta.$ssr.context.req.url);\n }\n return cast(app.meta.$router.currentRoute)?.fullPath;\n };\n app.$getPagePathHome = options => {\n let params = options?.params;\n if (params?.locale === undefined) {\n params = Object.assign({}, params, {\n locale: true\n });\n }\n // not handle options?.query\n return app.meta.$router.getPagePath(app.sys.env.ROUTER_PAGE_HOME, {\n params\n });\n };\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/pageData.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\nimport { ModelPageData } from '../model/pageData.js';\nimport 'zova';\n/** model: end */\n/** sys: begin */\nexport * from '../bean/sys.router.js';\nimport 'zova';\n/** sys: end */\n/** sys: begin */\nimport { SysRouter } from '../bean/sys.router.js';\nimport 'zova';\n/** sys: end */\n/** bean: begin */\nexport * from '../bean/bean.router.js';\nexport * from '../bean/bean.routerGuardsBase.js';\nimport 'zova';\n/** bean: end */\n/** bean: begin */\nimport { BeanRouter } from '../bean/bean.router.js';\nimport 'zova';\n/** bean: end */\n/** service: begin */\nexport * from '../service/routerGuards.js';\nimport 'zova-module-a-bean';\n/** service: end */\n/** service: begin */\nimport { ServiceRouterGuards } from '../service/routerGuards.js';\nimport 'zova';\n/** service: end */\n/** controller: begin */\nexport * from '../component/routerViewEmpty/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** controller: begin */\nimport { ControllerRouterViewEmpty } from '../component/routerViewEmpty/controller.jsx';\nimport 'zova';\n/** controller: end */\n\n/** components: begin */\nexport * from './component/routerViewEmpty.js';\nimport { ZRouterViewEmpty } from './component/routerViewEmpty.js';\nexport const components = {\n 'routerViewEmpty': ZRouterViewEmpty\n};\nimport 'zova';\n/** components: end */\n/** config: begin */\nexport * from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleARouter = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class ScopeModuleARouter extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;;;;;AAAA,IAAI,QAAM,SAAO;AAGjB,IAAW,iBAAiB,SAAO,MAAM,GAAG,UAAQ,SAAa,EAC/D,QAAQ,WACV,CAAC,GAAG,OAAK,WAAS,QAAM,WAAS,MAAM,sBAAsB,cAAc;CACzE,YAAY,GAAG,MAAM;EACnB,MAAM,GAAG,IAAI;EACb,KAAK,iBAAiB,KAAK;EAC3B,KAAK,UAAU,KAAK;CACtB;CACA,MAAM,WAAW;EACf,IAAI,QAAQ,IAAI,QAAQ;GACtB,MAAM,WAAW,KAAK,KAAK,MAAM;GACjC,IAAI,UAAU;IACZ,KAAK,iBAAiB,KAAK,YAAY,QAAQ;IAC/C,KAAK,iBAAiB,KAAK,KAAK,MAAM;IACtC,KAAK,UAAU,KAAK;GACtB;EACF,OACE,IAAI,KAAK,KAAK,0BACZ,KAAK,UAAU,KAAK,KAAK,MAAM;OAC1B;GACL,MAAM,QAAQ,KAAK;GACnB,KAAK,UAAU,QAAQ,K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AS,MAAM,SAAS,MAAM,2BAA2B,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK"}
1
+ {"version":3,"file":"index.js","names":["RouterView","h","KeepAlive","Transition","BeanControllerBase","cast","pageRouteKey","routerViewKey","BeanRouterViewBase","__init__","bean","_setBean","$router","addRouterView","__dispose__","removeRouterView","backRoute","_route","forwardRoute","setPageMeta","_pageMeta","prepareRouteMeta","Error","getKeepAliveInclude","render","slots","default","component","routeMeta","route","vnode","Component","key","componentKey","zovaHostProviders","include","_createVNode","RouterView","h","cast","Controller","pageRouteKey","BeanRouterViewBase","ControllerRouterViewEmpty","_dec","_dec2","__z_BeanInfo","module","_class","__init__","render","slots","default","component","vnode","Component","zovaHostProviders","route","_createVNode"],"sources":["../src/model/pageData.ts","../src/lib/const.ts","../src/lib/utils.ts","../src/types/utils.ts","../src/bean/sys.router.ts","../src/bean/bean.router.ts","../src/bean/bean.routerGuardsBase.ts","../src/types/router.ts","../src/service/routerGuards.ts","../src/lib/routerViewBase.tsx","../src/component/routerViewEmpty/controller.tsx","../src/.metadata/component/routerViewEmpty.ts","../src/config/config.ts","../src/monkey.ts","../src/monkeySys.ts","../src/.metadata/index.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanModelBase, Model } from 'zova-module-a-model';\nexport let ModelPageData = (_dec = Model(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class ModelPageData extends BeanModelBase {\n constructor(...args) {\n super(...args);\n this._pageDataInner = void 0;\n this.current = void 0;\n }\n async __init__() {\n if (process.env.SERVER) {\n const pagePath = this.$ssr.state.pagePath;\n if (pagePath) {\n this._pageDataInner = this.getPageData(pagePath);\n this._pageDataInner = this.$ssr.state.pageData;\n this.current = this._pageDataInner;\n }\n } else {\n if (this.$ssr.isRuntimeSsrPreHydration) {\n this.current = this.$ssr.state.pageData;\n } else {\n const route = this.$pageRoute;\n this.current = route ? this.getPageData(route.path) : undefined;\n }\n }\n }\n getPageData(pagePath) {\n return this.$useStateMem({\n queryKey: ['pageData', pagePath]\n });\n }\n}) || _class) || _class);","export const pageRouteKey = '$$pageRoute';\nexport const routerViewKey = '$$routerView';","import { routerViewLocationKey } from '@cabloy/vue-router';\nimport { inject } from 'vue';\nimport { pageRouteKey } from './const.js';\nexport function getRouteMatched(route) {\n let match = route.matched.find(item => item.aliasOf);\n if (match) {\n match = match.aliasOf;\n } else {\n match = route.matched[route.matched.length - 1];\n }\n return match;\n}\nexport function getRealRouteName(name) {\n if (!name) return undefined;\n name = String(name);\n if (name.startsWith('$:')) return undefined;\n return name;\n}\nexport function isRouterName(name) {\n return !!name && name.includes(':') && !name.includes('/');\n}\nexport function getPageRoute(ctx) {\n const route = ctx.bean._getBeanFromHost({\n name: pageRouteKey\n });\n return route;\n}\nexport function getCurrentRoute(ctx) {\n const route = ctx.util.instanceScope(() => {\n return inject(routerViewLocationKey);\n });\n return route;\n}\nexport const scrollBehavior = (to, _from, savedPosition) => {\n if (savedPosition) {\n return new Promise(resolve => {\n setTimeout(() => {\n // savedPosition = Object.assign({}, savedPosition, { behavior: 'smooth' });\n resolve(savedPosition);\n }, 100);\n });\n } else if (to.hash) {\n return new Promise(resolve => {\n setTimeout(() => {\n // resolve({ el: to.hash, behavior: 'smooth' });\n resolve({\n el: to.hash\n });\n }, 200);\n });\n } else {\n return {\n left: 0,\n top: 0\n };\n }\n};","export const SymbolRouterHistory = Symbol('SymbolRouterHistory');","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport * as ModuleInfo from '@cabloy/module-info';\nimport { combineParamsAndQuery } from '@cabloy/utils';\nimport { createMemoryHistory, createRouter, createWebHashHistory, createWebHistory } from '@cabloy/vue-router';\nimport { BeanBase, cast, deepExtend } from 'zova';\nimport { Sys } from 'zova-module-a-bean';\nimport { getCurrentRoute, getRealRouteName, getRouteMatched, isRouterName } from '../lib/utils.js';\nimport { SymbolRouterHistory } from '../types/utils.js';\nexport let SysRouter = (_dec = Sys(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class SysRouter extends BeanBase {\n constructor(...args) {\n super(...args);\n this._vueRouterSys = void 0;\n }\n get router() {\n return this._vueRouterSys;\n }\n __get__(prop) {\n return this._vueRouterSys && this._vueRouterSys[prop];\n }\n async __init__() {\n // create router\n this._vueRouterSys = this.createRouter();\n // config.routes\n this._loadConfigRoutes();\n // legacy routes\n this._loadLegacyRoutes();\n }\n createRouter(options) {\n options = Object.assign({}, options);\n // matcher\n if (!options.matcher) {\n options.matcher = this._vueRouterSys?.matcher;\n }\n // routes\n if (!options.routes) {\n if (!this._vueRouterSys) {\n options.routes = [];\n }\n }\n // scrollBehavior\n if (!options.scrollBehavior) {\n options.scrollBehavior = this.scope.config.scrollBehavior;\n }\n // history\n if (!options.history) {\n const createHistory = process.env.SERVER ? createMemoryHistory : this.sys.env.ROUTER_MODE === 'history' ? createWebHistory : createWebHashHistory;\n const routeBase = process.env.SERVER || this.sys.env.ROUTER_MODE === 'history' ? this.sys.env.APP_PUBLIC_PATH : undefined;\n options.history = createHistory(routeBase);\n }\n // create\n const router = createRouter(options);\n cast(router).__hasDevtools = true;\n router[SymbolRouterHistory] = options.history;\n return router;\n }\n createAsyncComponent(component) {\n if (typeof component !== 'string') return component;\n return this.sys.meta.component.createAsyncComponent(component);\n }\n getPagePath(path, options, absolute) {\n const query = options?.query;\n const params = this._normalizePageParams(options?.params);\n const pagePath = combineParamsAndQuery(path, {\n params,\n query\n });\n return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;\n }\n async resolveRoute(url, check404, checkAliasOf) {\n const pagePath = this.sys.util.getPagePathFromAbsoluteUrl(url);\n let route = await this.ensureRoute(pagePath);\n if (check404 && route.name === '$:/:catchAll(.*)*') return;\n // aliasOf\n if (checkAliasOf) {\n const matchItem = route.matched.find(item => item.aliasOf);\n if (matchItem) {\n route = matchItem.aliasOf;\n }\n // 404\n if (check404 && route.name === '$:/:catchAll(.*)*') return;\n }\n // ok\n return route;\n }\n checkPathValid(to) {\n const _name = to && typeof to === 'object' ? to.name : undefined;\n const _path = to && typeof to === 'object' ? to.name ?? to.path : to;\n // legacy\n if (this._findLegacyRoute(_name, _path)) return true;\n // general check\n if (!_path) return true;\n const moduleName = ModuleInfo.parseName(_path);\n if (!moduleName) return true;\n return this.sys.meta.module.exists(moduleName);\n }\n checkActiveOfFullPath(fullPath, currentRoute) {\n if (!currentRoute) {\n currentRoute = getCurrentRoute(this.ctx)?.value;\n }\n if (!currentRoute) return false;\n if (currentRoute.fullPath === fullPath) return true;\n if (!currentRoute.matched || currentRoute.matched.length === 0) return false;\n return currentRoute.matched.some(routeAlias => {\n const fullPathAlias = this.getPagePath(routeAlias.path, {\n params: currentRoute.params,\n query: currentRoute.query\n });\n return fullPathAlias === fullPath;\n });\n }\n async ensureRoute(pagePath) {\n // try to resolve, support alias route\n let route = this._vueRouterSys.resolve(pagePath);\n if (route && route.name !== '$:/:catchAll(.*)*') return route;\n // try to load module\n const moduleName = ModuleInfo.parseName(pagePath);\n if (moduleName) {\n if (this.sys.meta.module.exists(moduleName)) {\n const module = this.sys.meta.module.get(moduleName);\n if (!module) {\n await this.sys.meta.module.use(moduleName);\n // try to resolve again\n route = this._vueRouterSys.resolve(pagePath);\n }\n }\n }\n return route;\n }\n\n /** @internal */\n _registerRoutes(module) {\n if (!module.resource.routes) return;\n for (const route of module.resource.routes) {\n this._registerRoute(route, module);\n }\n }\n\n /** @internal */\n _findConfigRoute(name, path) {\n name = this.getRealRouteName(name);\n return name ? this.sys.config.routes.name[name] : this.sys.config.routes.path[path];\n }\n\n /** @internal */\n _findLegacyRoute(name, path) {\n const legacyRoutes = cast(this.sys.meta).legacyRoutes;\n if (!legacyRoutes) return;\n name = this.getRealRouteName(name);\n return legacyRoutes.find(item => {\n return name ? item.name === name : item.path === path;\n });\n }\n getRouteMatched(route) {\n return getRouteMatched(route);\n }\n getRealRouteName(name) {\n return getRealRouteName(name);\n }\n isRouterName(name) {\n return isRouterName(name);\n }\n resolveName(name, options) {\n const params = cast(options)?.params;\n const query = cast(options)?.query;\n return this._resolveNameOrPath(query, query => {\n const route = this.router.resolve({\n name,\n params,\n query\n });\n return route.fullPath;\n });\n }\n getAliasPath(name, options, absolute) {\n const alias = this.sys.config.routes.name[name]?.alias;\n if (!alias) return;\n const params = this._normalizePageParams(cast(options)?.params);\n const query = cast(options)?.query;\n const aliasName = `$alias:${name}`;\n const routeAlias = this._resolveNameOrPath(query, query => {\n const route = this.router.resolve({\n name: this.router.hasRoute(aliasName) ? aliasName : name,\n params,\n query\n });\n return route.fullPath;\n });\n const pagePath = routeAlias.startsWith('/__alias__') ? routeAlias.substring('/__alias__'.length) || '/' : routeAlias;\n return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;\n }\n _normalizePageParams(params) {\n const paramsLocale = cast(params)?.locale;\n if (paramsLocale === undefined) return params;\n const localeCurrent = paramsLocale === true ? this.app.meta.locale.current : paramsLocale;\n const locale = localeCurrent === this.sys.config.locale.default ? undefined : localeCurrent;\n return Object.assign({}, params, {\n locale\n });\n }\n _resolveNameOrPath(query, fn) {\n const query1 = {};\n const query2 = [];\n if (query) {\n for (const key in query) {\n const value = query[key];\n if (value && typeof value === 'object') {\n query2.push([key, value]);\n } else {\n query1[key] = value;\n }\n }\n }\n // resolve\n const fullPath = fn(query1);\n // query2\n const query2str = query2.map(([key, value]) => {\n return `${encodeURIComponent(key)}=${encodeURIComponent(JSON.stringify(value))}`;\n }).join('&');\n // join\n if (!query2str) return fullPath;\n const join = Object.keys(query1).length > 0 ? '&' : '?';\n return `${fullPath}${join}${query2str}`;\n }\n _loadConfigRoutes() {\n const routesPath = this.sys.config.routes.path;\n for (const key in routesPath) {\n const route = routesPath[key];\n if (!route) continue;\n this._loadConfigRoute({\n ...route,\n path: key,\n name: `$:${key}`\n });\n }\n const routesName = this.sys.config.routes.name;\n for (const key in routesName) {\n const route = routesName[key];\n if (!route) continue;\n this._loadConfigRoute({\n ...route,\n path: route.path || route.alias,\n name: key\n });\n }\n }\n _loadLegacyRoutes() {\n const legacyRoutes = cast(this.sys.meta).legacyRoutes;\n if (!legacyRoutes) return;\n for (const route of legacyRoutes) {\n this._registerRoute(route);\n }\n }\n _loadConfigRoute(route) {\n this.router.addRoute(route);\n }\n _registerRoute(route, module) {\n // path\n let path;\n if (route.path !== undefined) {\n if (!module || route.meta?.absolute === true) {\n path = route.path;\n } else {\n path = route.path ? `/${module.info.pid}/${module.info.name}/${route.path}` : `/${module.info.pid}/${module.info.name}`;\n }\n }\n // name\n let name;\n if (route.name) {\n if (!module || route.meta?.absolute === true) {\n name = String(route.name);\n } else {\n name = `${module.info.relativeName}:${String(route.name)}`;\n }\n }\n // config route\n const configRoute = name ? this.sys.config.routes.name[name] : this.sys.config.routes.path[path];\n if (configRoute) {\n route = deepExtend({}, route, configRoute);\n }\n // name alias\n if (name && configRoute?.alias) {\n const alias = Array.isArray(configRoute.alias) ? configRoute.alias[0] : configRoute.alias;\n // add extra route\n this.router.addRoute({\n name: `$alias:${name}`,\n path: `/__alias__${alias}`,\n redirect: ''\n });\n }\n // name\n if (!name) {\n name = `$:${path}`;\n }\n // meta\n const meta = route.meta;\n // component\n const component = route.component;\n // layout / routeData\n let layout = meta?.layout;\n let routeData;\n let routeNameParent;\n if (layout === false) {\n routeData = {\n ...route,\n name,\n path,\n component,\n meta\n };\n } else {\n if (layout === undefined || layout === 'default') {\n layout = this.sys.config.layout.component.default;\n } else if (layout === 'empty') {\n layout = this.sys.config.layout.component.empty;\n }\n routeNameParent = `$:${name}`;\n routeData = {\n name: routeNameParent,\n path,\n component: this.createAsyncComponent(layout),\n children: [{\n ...route,\n name,\n path: '',\n component,\n meta\n }]\n };\n }\n // force delete\n if (this.router.hasRoute(routeNameParent)) {\n this.router.removeRoute(routeNameParent);\n }\n if (this.router.hasRoute(name)) {\n this.router.removeRoute(name);\n }\n // add\n this.router.addRoute(routeData);\n }\n}) || _class) || _class);","var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, Use } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\nimport { ModelPageData } from '../model/pageData.js';\nimport { SysRouter } from './sys.router.js';\nexport let BeanRouter = (_dec = Bean(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec3 = Use(), _dec4 = Reflect.metadata(\"design:type\", typeof SysRouter === \"undefined\" ? Object : SysRouter), _dec5 = Use(), _dec6 = Reflect.metadata(\"design:type\", typeof ModelPageData === \"undefined\" ? Object : ModelPageData), _dec(_class = _dec2(_class = (_class2 = class BeanRouter extends BeanBase {\n constructor(...args) {\n super(...args);\n this._vueRouterApp = void 0;\n this._eventRouterGuards = [];\n this._routerViews = [];\n _initializerDefineProperty(this, \"$$sysRouter\", _descriptor, this);\n _initializerDefineProperty(this, \"$$modelPageData\", _descriptor2, this);\n }\n // for prepare pageData on server\n\n get router() {\n return this._vueRouterApp;\n }\n __dispose__() {\n for (const fn of this._eventRouterGuards) {\n fn();\n }\n }\n __get__(prop) {\n // SymbolRouter first\n const value = this._vueRouterApp?.[prop];\n if (value !== undefined) return value;\n return this.$$sysRouter?.[prop];\n }\n async __init__(mainRouter) {\n // create router\n this._vueRouterApp = this.$$sysRouter.createRouter();\n if (!mainRouter) {\n // emit event\n await this.app.meta.event.emit('a-router:routerGuards', this);\n }\n }\n addRouterView(routerView) {\n this._routerViews.push(routerView);\n }\n removeRouterView(routerView) {\n const index = this._routerViews.findIndex(item => item === routerView);\n if (index > -1) {\n this._routerViews.splice(index, 1);\n }\n }\n afterEachBackRoute(route) {\n for (const routerView of this._routerViews) {\n const res = routerView.backRoute(route);\n if (res) break;\n }\n }\n afterEachForwardRoute(route) {\n for (const routerView of this._routerViews) {\n const res = routerView.forwardRoute(route);\n if (res) break;\n }\n }\n beforeEach(guard) {\n const fn = this._vueRouterApp.beforeEach(guard);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n beforeResolve(guard) {\n const fn = this._vueRouterApp.beforeResolve(guard);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n afterEach(guard) {\n const fn = this._vueRouterApp.afterEach(guard);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n onError(handler) {\n const fn = this._vueRouterApp.onError(handler);\n this._eventRouterGuards.push(fn);\n return fn;\n }\n setPageMeta(route, pageMeta) {\n for (const routerView of this._routerViews) {\n routerView.setPageMeta(route, pageMeta);\n }\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"$$sysRouter\", [_dec3, _dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"$$modelPageData\", [_dec5, _dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2)) || _class) || _class);","var _dec, _dec2, _dec3, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, Virtual } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\nexport let BeanRouterGuardsBase = (_dec = Bean(), _dec2 = Virtual(), _dec3 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = _dec3(_class = class BeanRouterGuardsBase extends BeanBase {\n constructor(...args) {\n super(...args);\n this._eventRouterGuards = void 0;\n }\n async __init__() {\n this._eventRouterGuards = this.app.meta.event.on('a-router:routerGuards', async (router, next) => {\n this.onRouterGuards(router);\n return await next();\n });\n }\n __dispose__() {\n this.dispose();\n }\n dispose() {\n if (this._eventRouterGuards) {\n this._eventRouterGuards();\n }\n }\n onRouterGuards(_router) {}\n}) || _class) || _class) || _class);","import 'vue-router';\nexport let NavigationType = /*#__PURE__*/function (NavigationType) {\n NavigationType[\"pop\"] = \"pop\";\n NavigationType[\"push\"] = \"push\";\n return NavigationType;\n}({});\nexport let NavigationDirection = /*#__PURE__*/function (NavigationDirection) {\n NavigationDirection[\"back\"] = \"back\";\n NavigationDirection[\"forward\"] = \"forward\";\n NavigationDirection[\"unknown\"] = \"\";\n return NavigationDirection;\n}({});","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport * as ModuleInfo from '@cabloy/module-info';\nimport { Service } from 'zova-module-a-bean';\nimport { BeanRouterGuardsBase } from '../bean/bean.routerGuardsBase.js';\nimport { NavigationDirection, NavigationType } from '../types/router.js';\nexport let ServiceRouterGuards = (_dec = Service(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class ServiceRouterGuards extends BeanRouterGuardsBase {\n onRouterGuards(router) {\n const self = this;\n router.beforeEach(async to => {\n // match path\n let match = to.matched.find(item => item.aliasOf);\n if (match) {\n match = match.aliasOf;\n } else {\n match = to.matched[to.matched.length - 1];\n // prepareCheck\n if (!(await this._prepareCheck(match?.path, to.path))) {\n // redirect again\n return to.fullPath;\n }\n // legacy\n const legacyRoute = router._findLegacyRoute(match?.name, match?.path);\n if (legacyRoute) return;\n // alias\n const configRoute = router._findConfigRoute(match?.name, match?.path);\n const alias = configRoute?.alias;\n if (alias) {\n // force load module\n const resLoadModule = await this._forceLoadModule(router, match?.name, match?.path);\n if (resLoadModule && resLoadModule !== true) return resLoadModule;\n if (resLoadModule === false) return to.fullPath;\n const name = router.getRealRouteName(match?.name);\n if (name) {\n const routeAlias = router.getAliasPath(name, {\n params: to.params,\n query: to.query\n });\n return routeAlias || '/';\n } else {\n return {\n path: Array.isArray(alias) ? alias[0] : alias,\n params: to.params,\n query: to.query\n };\n }\n }\n }\n // force load module\n const resLoadModule = await this._forceLoadModule(router, match?.name, match?.path);\n if (resLoadModule === true) return;\n if (resLoadModule) return resLoadModule;\n // redirect again\n return to.fullPath;\n });\n router.afterEach(function (to, from, error) {\n if (error) return;\n const info = arguments[3];\n // from\n if (from.fullPath !== to.fullPath) {\n self._afterEachFrom(router, from, info);\n }\n // to\n router.afterEachForwardRoute(to);\n });\n }\n _afterEachFrom(router, from, info) {\n if (!info) return;\n const needBack = info.type === NavigationType.pop && info.direction === NavigationDirection.back || info.type === NavigationType.push && info.replace;\n if (!needBack) return;\n router.afterEachBackRoute(from);\n }\n\n // if 404 then check if module loaded\n async _prepareCheck(pathMatched, pathTo) {\n if (pathMatched === '/:catchAll(.*)*') {\n const moduleInfo = ModuleInfo.parseInfo(ModuleInfo.parseName(pathTo));\n if (moduleInfo && this.app.meta.module.exists(moduleInfo.relativeName) && !this.app.meta.module.get(moduleInfo.relativeName, false)) {\n // use module\n await this.app.meta.module.use(moduleInfo.relativeName);\n // redirect again\n return false;\n }\n }\n return true;\n }\n async _forceLoadModule(router, name, path) {\n const nameOrPath = router.getRealRouteName(name) || path;\n // module info\n const moduleInfo = ModuleInfo.parseInfo(ModuleInfo.parseName(nameOrPath));\n if (!moduleInfo) {\n // donothing\n return true;\n }\n const moduleName = moduleInfo.relativeName;\n // check if exists\n if (!this.app.meta.module.exists(moduleName)) return '/404';\n // check if loaded\n const module = this.app.meta.module.get(moduleName, false);\n if (module) return true;\n // use module\n await this.app.meta.module.use(moduleName);\n // means need load\n return false;\n }\n}) || _class) || _class);","import type { RouteLocationNormalizedLoadedGeneric } from '@cabloy/vue-router';\n\nimport { RouterView } from '@cabloy/vue-router';\nimport { h, KeepAlive, Transition } from 'vue';\nimport { BeanControllerBase, cast } from 'zova';\n\nimport type { IPageMeta } from '../types/pageMeta.js';\nimport type { IRouterViewSlotParams, IRouteViewRouteMeta } from '../types/routerView.js';\n\nimport { pageRouteKey, routerViewKey } from './const.js';\n\nexport interface IRouterViewPropsBase {}\n\nexport class BeanRouterViewBase extends BeanControllerBase implements IRouterViewPropsBase {\n protected async __init__() {\n this.bean._setBean(routerViewKey, this);\n this.$router.addRouterView(this);\n }\n\n protected __dispose__() {\n this.$router.removeRouterView(this);\n }\n\n public backRoute(_route: RouteLocationNormalizedLoadedGeneric) {\n return false;\n }\n\n public forwardRoute(_route: RouteLocationNormalizedLoadedGeneric) {\n return false;\n }\n\n public setPageMeta(_route: RouteLocationNormalizedLoadedGeneric, _pageMeta: IPageMeta) {}\n\n protected prepareRouteMeta(_route: RouteLocationNormalizedLoadedGeneric): IRouteViewRouteMeta {\n throw new Error('Not Implemented');\n }\n\n protected getKeepAliveInclude(): string[] | undefined {\n throw new Error('Not Implemented');\n }\n\n protected render() {\n const slots = {\n default: (component: IRouterViewSlotParams) => {\n const routeMeta = this.prepareRouteMeta(component.route);\n return h(Transition, null, {\n default: () => {\n const vnode = h(component.Component as any, {\n key: routeMeta.componentKey,\n });\n cast(vnode).zovaHostProviders = { [pageRouteKey]: component.route };\n return [\n h(\n KeepAlive,\n {\n include: this.getKeepAliveInclude(),\n },\n [vnode],\n ),\n ];\n },\n });\n },\n };\n return <RouterView v-slots={slots}></RouterView>;\n }\n}\n","import { RouterView } from '@cabloy/vue-router';\nimport { h } from 'vue';\nimport { cast } from 'zova';\nimport { Controller } from 'zova-module-a-bean';\n\nimport { pageRouteKey } from '../../lib/const.js';\nimport { BeanRouterViewBase } from '../../lib/routerViewBase.js';\n\n@Controller()\nexport class ControllerRouterViewEmpty extends BeanRouterViewBase {\n protected async __init__() {}\n\n protected render() {\n const slots = {\n default: component => {\n const vnode = h(component.Component);\n cast(vnode).zovaHostProviders = { [pageRouteKey]: component.route };\n return vnode;\n },\n };\n return <RouterView v-slots={slots}></RouterView>;\n }\n}\n","import { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\nimport { ControllerRouterViewEmpty } from '../../component/routerViewEmpty/controller.jsx';\nexport const ZRouterViewEmpty = defineComponent(_props => {\n useController(ControllerRouterViewEmpty, undefined, undefined);\n return () => {};\n}, prepareComponentOptions());","import { scrollBehavior } from '../lib/utils.js';\nexport const config = _sys => {\n return {\n scrollBehavior\n };\n};","import * as ModuleInfo from '@cabloy/module-info';\nimport { shallowReactive } from 'vue';\nimport { BeanControllerPageBase, BeanSimple, cast, useComputed } from 'zova';\nimport { routerViewKey } from './lib/const.js';\nimport { getCurrentRoute, getPageRoute, getRealRouteName, getRouteMatched } from './lib/utils.js';\nimport { ServiceRouterGuards } from './service/routerGuards.js';\nimport { SymbolRouterHistory } from './types/utils.js';\nexport class Monkey extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._beanRouter = void 0;\n this._sysRouter = void 0;\n this.serviceRouterGuards = void 0;\n }\n async _getSysRouter() {\n if (!this._sysRouter) {\n this._sysRouter = await this.sys.bean._getBean('a-router.sys.router', false);\n }\n return this._sysRouter;\n }\n async getBeanRouter() {\n if (!this._beanRouter) {\n // markReactive: true\n this._beanRouter = this.app.meta.$router = await this.bean._getBean('a-router.bean.router', true, true);\n }\n return this._beanRouter;\n }\n async appInitialize() {\n const ssrState = this.ctx.meta.$ssr.state;\n if (process.env.SERVER && (ssrState.ssrProfile === undefined || ssrState.ssrProfileOptions === undefined)) {\n const pagePathFull = this.app.$getCurrentPagePath();\n if (pagePathFull) {\n const sysRouter = await this._getSysRouter();\n const route = await sysRouter.resolveRoute(pagePathFull, true, false);\n if (route) {\n this.ctx.meta.$ssr._setProfile(route.meta.ssrProfile, route.meta.ssrProfileOptions);\n }\n }\n }\n // router\n this.serviceRouterGuards = await this.bean._newBean(ServiceRouterGuards, false);\n // ssr errorHandler\n if (process.env.CLIENT) {\n this._ssrErrorHandler();\n }\n }\n async appInitialized() {\n const beanRouter = await this.getBeanRouter();\n // emit event\n await this.app.meta.event.emit('a-router:routerGuards', beanRouter);\n }\n appClose() {\n if (this.serviceRouterGuards) {\n this.serviceRouterGuards.dispose();\n }\n }\n async appReady() {\n const beanRouter = await this.getBeanRouter();\n // pagePath\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n const pagePathFull = this.ctx.meta.$ssr.state.pagePathFull;\n if (pagePathFull) {\n const routerHistory = beanRouter.router[SymbolRouterHistory];\n routerHistory.push(pagePathFull);\n }\n }\n // use router\n this.app.vue.use(beanRouter);\n // ssr\n if (process.env.SERVER) {\n // push\n const pagePath = this.app.$getCurrentPagePath();\n beanRouter.push(pagePath);\n await beanRouter.isReady();\n } else if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n await beanRouter.isReady();\n }\n }\n async beanInit(bean, beanInstance) {\n bean.defineProperty(beanInstance, '$router', {\n enumerable: false,\n configurable: true,\n get() {\n return bean._getBeanFromHost('a-router.bean.router');\n }\n });\n bean.defineProperty(beanInstance, '$routerView', {\n enumerable: false,\n configurable: true,\n get() {\n return bean._getBeanFromHost({\n name: routerViewKey\n });\n }\n });\n bean.defineProperty(beanInstance, '$pageRoute', {\n enumerable: false,\n configurable: true,\n get() {\n return useComputed(() => {\n return getPageRoute(cast(bean).ctx);\n });\n }\n });\n bean.defineProperty(beanInstance, '$currentRoute', {\n enumerable: false,\n configurable: true,\n get() {\n return useComputed(() => {\n return getCurrentRoute(cast(bean).ctx);\n });\n }\n });\n }\n controllerDataPrepare(controllerData, ctx) {\n controllerData.context.route = getPageRoute(ctx);\n }\n controllerDataInit(controllerData, controller) {\n // only for controller page\n if (!(controller instanceof BeanControllerPageBase)) return;\n const route = controllerData.context.route;\n this._initControllerRoute(route, controller);\n }\n controllerDataUpdate(controller) {\n // only for controller page\n if (!(controller instanceof BeanControllerPageBase)) return;\n const route = getPageRoute(cast(cast(controller).ctx));\n this._initControllerRoute(route, controller);\n }\n _initControllerRoute(route, controller) {\n if (!route) return;\n const routeMatched = getRouteMatched(route);\n if (!routeMatched) return;\n // check if the same\n if (controller.$routeMatched && !this._checkIfRouteSame(routeMatched, controller.$routeMatched)) return;\n // check if changed\n const changed = !controller.$route || controller.$route.fullPath !== route.fullPath;\n if (!changed) return;\n controller.$route = route;\n controller.$routeMatched = routeMatched;\n // update $params/$query\n const routeName = getRealRouteName(routeMatched.name);\n const schemaKey = routeName || String(routeMatched.path);\n let schemas;\n const moduleInfo = ModuleInfo.parseInfo(ModuleInfo.parseName(schemaKey));\n if (!moduleInfo) {\n // do nothing\n return;\n }\n if (!this.app.meta.module.exists(moduleInfo.relativeName)) {\n // do nothing\n return;\n }\n const module = this.app.meta.module.get(moduleInfo.relativeName);\n if (routeName) {\n schemas = module.resource.pageNameSchemas?.[schemaKey];\n } else {\n schemas = module.resource.pagePathSchemas?.[schemaKey];\n }\n if (schemas?.params) {\n const params = schemas.params.parse(route.params);\n if (!controller.$params) {\n controller.$params = process.env.SERVER ? params : shallowReactive(params);\n } else {\n // hold the same $params ref\n Object.assign(controller.$params, params);\n }\n }\n if (schemas?.query) {\n const query = schemas.query.parse(route.query);\n if (!controller.$query) {\n controller.$query = process.env.SERVER ? query : shallowReactive(query);\n } else {\n // hold the same $query ref\n Object.assign(controller.$query, query);\n }\n }\n }\n _checkIfRouteSame(route1, route2) {\n return route1.name && route1.name === route2.name || route1.path === route2.path;\n }\n _ssrErrorHandler() {\n if (!process.env.CLIENT) return;\n this.app.meta.event.on('app:errorHandler', (data, next) => {\n const err = next();\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultClient(err, data);\n });\n }\n _errorHandlerDefaultClient(err, _data) {\n if (!process.env.CLIENT) return err;\n // client\n if ([301, 302].includes(Number(err.code))) {\n this.app.$gotoPage(err.pagePath);\n return undefined;\n }\n // COMPONENT_UNMOUNTED\n if (err.code === 600) {\n // do nothing\n return undefined;\n }\n // 401\n if (err.code === 401) {\n this.app.$gotoLogin();\n return undefined;\n }\n // not handled\n return err;\n }\n}","import { BeanSimple, cast, isHttpUrl } from 'zova';\nexport class MonkeySys extends BeanSimple {\n constructor(moduleSelf) {\n super();\n this._moduleSelf = void 0;\n this._sysRouter = void 0;\n this._moduleSelf = moduleSelf;\n }\n async getSysRouter() {\n if (!this._sysRouter) {\n this._sysRouter = await this.sys.bean._getBean('a-router.sys.router', false);\n }\n return this._sysRouter;\n }\n async moduleLoading(module) {\n if (this._moduleSelf === module) return;\n if (!module.resource.routes) return;\n const sysRouter = await this.getSysRouter();\n sysRouter._registerRoutes(module);\n }\n async moduleLoaded(_module) {}\n async configLoaded(_module, _config) {}\n sysApplicationInitialize(app) {\n app.$redirect = (pagePath, status) => {\n const error = new Error();\n error.code = status ?? 302;\n if (isHttpUrl(pagePath)) {\n error.pagePath = pagePath;\n error.url = pagePath;\n } else {\n error.pagePath = pagePath;\n error.url = app.sys.util.getAbsoluteUrlFromPagePath(pagePath, true);\n }\n error.message = process.env.SERVER ? error.url : error.pagePath;\n throw error;\n };\n app.$getPagePath = (pagePath, options) => {\n const query = {\n ...options?.query\n };\n // returnTo\n if (options?.returnTo) {\n const returnTo = typeof options.returnTo === 'string' ? options.returnTo : app.$getCurrentPagePath();\n if (returnTo !== app.$getPagePathHome()) {\n query[app.sys.env.ROUTER_KEY_RETURNTO] = returnTo;\n }\n }\n return app.meta.$router.getPagePath(pagePath, {\n params: options?.params,\n query\n });\n };\n app.$getPagePathLogin = (returnTo, cause) => {\n const query = {};\n if (cause) {\n query.cause = cause;\n }\n const returnTo2 = returnTo === app.sys.env.ROUTER_PAGE_LOGIN ? undefined : returnTo;\n return app.$getPagePath(app.sys.env.ROUTER_PAGE_LOGIN, {\n query,\n returnTo: returnTo2\n });\n };\n app.$getPagePathAccessDenied = () => {\n return app.$getPagePath('/home/base/errorAccessDenied');\n };\n app.$gotoPage = (pagePath, options) => {\n pagePath = app.$getPagePath(pagePath, options);\n // redirect\n if (process.env.SERVER || options?.forceRedirect) {\n return app.$redirect(pagePath);\n }\n // replace\n if (isHttpUrl(pagePath)) {\n window.location[options?.replace ? 'replace' : 'assign'](pagePath);\n } else {\n return app.meta.$router[options?.replace ? 'replace' : 'push'](pagePath);\n }\n };\n app.$gotoHome = options => {\n const pagePath = app.$getPagePathHome(options);\n return app.$gotoPage(pagePath, {\n ...options,\n params: undefined\n });\n };\n app.$gotoLogin = (returnTo, cause) => {\n if (!returnTo && cast(app.meta.$router.currentRoute)?.path === app.sys.env.ROUTER_PAGE_LOGIN) {\n return;\n }\n const returnTo2 = returnTo ?? app.$getCurrentPagePath();\n const pagePath = app.$getPagePathLogin(returnTo2, cause);\n return app.$gotoPage(pagePath);\n };\n app.$gotoAccessDenied = () => {\n const pagePath = app.$getPagePathAccessDenied();\n if (cast(app.meta.$router.currentRoute)?.path === pagePath) return;\n return app.$gotoPage(pagePath, {\n replace: true\n });\n };\n app.$gotoReturnTo = returnTo => {\n const pagePath = app.$getReturnTo(returnTo);\n return app.$gotoPage(pagePath, {\n replace: true\n });\n };\n app.$getReturnTo = returnTo => {\n // not use ??\n const pagePath = returnTo || cast(app.meta.$router.currentRoute)?.query?.[app.sys.env.ROUTER_KEY_RETURNTO] || app.$getPagePathHome();\n return pagePath;\n };\n app.$getCurrentPagePath = () => {\n if (process.env.SERVER) {\n return app.ctx.meta.$ssr.state.pagePathFull ?? app.sys.util.getPagePathFromAbsoluteUrl(app.ctx.meta.$ssr.context.req.url);\n }\n return cast(app.meta.$router.currentRoute)?.fullPath;\n };\n app.$getPagePathHome = options => {\n let params = options?.params;\n if (params?.locale === undefined) {\n params = Object.assign({}, params, {\n locale: true\n });\n }\n // not handle options?.query\n return app.meta.$router.getPagePath(app.sys.env.ROUTER_PAGE_HOME, {\n params\n });\n };\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/pageData.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\nimport { ModelPageData } from '../model/pageData.js';\nimport 'zova';\n/** model: end */\n/** sys: begin */\nexport * from '../bean/sys.router.js';\nimport 'zova';\n/** sys: end */\n/** sys: begin */\nimport { SysRouter } from '../bean/sys.router.js';\nimport 'zova';\n/** sys: end */\n/** bean: begin */\nexport * from '../bean/bean.router.js';\nexport * from '../bean/bean.routerGuardsBase.js';\nimport 'zova';\n/** bean: end */\n/** bean: begin */\nimport { BeanRouter } from '../bean/bean.router.js';\nimport 'zova';\n/** bean: end */\n/** service: begin */\nexport * from '../service/routerGuards.js';\nimport 'zova-module-a-bean';\n/** service: end */\n/** service: begin */\nimport { ServiceRouterGuards } from '../service/routerGuards.js';\nimport 'zova';\n/** service: end */\n/** controller: begin */\nexport * from '../component/routerViewEmpty/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** controller: begin */\nimport { ControllerRouterViewEmpty } from '../component/routerViewEmpty/controller.jsx';\nimport 'zova';\n/** controller: end */\n\n/** components: begin */\nexport * from './component/routerViewEmpty.js';\nimport { ZRouterViewEmpty } from './component/routerViewEmpty.js';\nexport const components = {\n 'routerViewEmpty': ZRouterViewEmpty\n};\nimport 'zova';\n/** components: end */\n/** config: begin */\nexport * from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleARouter = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-router\"\n}), _dec(_class = _dec2(_class = class ScopeModuleARouter extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;;;;;AAAA,IAAI,QAAM,SA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AAY,KAAK,IAAI,KAAK,QAAQ,YAAY,CAAC,EAAE,QAAQ,IAAI,IAAI,IAAI,wBAAwB,IAAI,iBAAiB;EAErI;EACA,IAAI,4BAA4B;GAC9B,IAAI,QAAQ,IAAI,QACd,OAAO,IAAI,IAAI,KAAK,KAAK,MAAM,gBAAgB,IAAI,IAAI,KAAK,2BAA2B,IAAI,IAAI,KAAK,KAAK,QAAQ,IAAI,GAAG;GAE1H,OAAO,KAAK,IAAI,KAAK,QAAQ,YAAY,CAAC,EAAE;EAC9C;EACA,IAAI,oBAAmB,YAAW;GAChC,IAAI,SAAS,SAAS;GACtB,IAAI,QAAQ,WAAW,KAAA,GACrB,SAAS,OAAO,OAAO,CAAC,GAAG,QAAQ,EACjC,QAAQ,KACV,CAAC;GAGH,OAAO,IAAI,KAAK,QAAQ,YAAY,IAAI,IAAI,IAAI,kBAAkB,EAChE,OACF,CAAC;EACH;CACF;AACF;;;;;ACnIA,IAAI,MAAM,OAAO;AAgDjB,IAAa,aAAa,EACxB,mBAAmB,iBACrB;AAeA,IAAW,sBAAsB,OAAO,MAAM,GAAG,QAAQ,SAAa,EACpE,QAAQ,WACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,2BAA2B,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK"}
package/dist/monkey.d.ts CHANGED
@@ -4,7 +4,9 @@ import type { BeanRouter } from './bean/bean.router.js';
4
4
  import { ServiceRouterGuards } from './service/routerGuards.js';
5
5
  export declare class Monkey extends BeanSimple implements IMonkeyAppInitialize, IMonkeyAppInitialized, IMonkeyAppReady, IMonkeyAppClose, IMonkeyBeanInit, IMonkeyController {
6
6
  private _beanRouter;
7
+ private _sysRouter;
7
8
  serviceRouterGuards: ServiceRouterGuards;
9
+ private _getSysRouter;
8
10
  getBeanRouter(): Promise<BeanRouter>;
9
11
  appInitialize(): Promise<void>;
10
12
  appInitialized(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"monkey.d.ts","sourceRo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CAAY;gBAElB,UAAU,EAAE,OAAO;IAKzB,YAAY;IAOZ,aAAa,CAAC,MAAM,EAAE,OAAO;IAO7B,YAAY,CAAC,OAAO,EAAE,OAAO;IAC7B,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,KAAA;IAE5C,wBAAwB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;CAmGrD"}
1
+ {"version":3,"file":"monkeySys.d.ts","sourceRoot":"","sources":["../src/monkeySys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,+BAA+B,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAG/F,OAAO,EAAE,UAAU,EAAmB,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,qBAAa,SACX,SAAQ,UACR,YAAW,gBAAgB,EAAE,+BAA+B;IAE5D,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,UAAU,CAAY;gBAElB,UAAU,EAAE,OAAO;IAKzB,YAAY;IAOZ,aAAa,CAAC,MAAM,EAAE,OAAO;IAO7B,YAAY,CAAC,OAAO,EAAE,OAAO;IAC7B,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,KAAA;IAE5C,wBAAwB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;CAmHrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"routerGuards.d.ts","sourceRoot":"","sources":["../../src/service/routerGuards.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAGxE,qBACa,mBAAoB,SAAQ,oBAAoB;IAC3D,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU;IAiE3C,OAAO,CAAC,cAAc;YAcR,aAAa;YAiBb,gBAAgB;CAuB/B"}
1
+ {"version":3,"file":"routerGuards.d.ts","sourceRoot":"","sources":["../../src/service/routerGuards.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAGxE,qBACa,mBAAoB,SAAQ,oBAAoB;IAC3D,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU;IA+D3C,OAAO,CAAC,cAAc;YAcR,aAAa;YAiBb,gBAAgB;CAuB/B"}
@@ -3,7 +3,7 @@ import type { z } from 'zod';
3
3
  import type { ILayoutRecord, ILocaleRecord, TypeComponentLayoutRecord, ZovaApplication } from 'zova';
4
4
  import type { BeanRouter } from '../bean/bean.router.js';
5
5
  import type { BeanRouterViewBase } from '../lib/routerViewBase.js';
6
- import type { IGotoPageOptions } from './utils.js';
6
+ import type { IGetPagePathOptions, IGotoPageOptions } from './utils.js';
7
7
  import 'vue-router';
8
8
  export type Lazy<T> = () => Promise<T>;
9
9
  export type IModuleRouteComponent = RouteComponent | Lazy<RouteComponent>;
@@ -26,6 +26,9 @@ declare module '@cabloy/vue-router' {
26
26
  declare module 'zova' {
27
27
  interface ZovaApplication {
28
28
  $redirect(pagePath: string, status?: 301 | 302): never;
29
+ $getPagePath<K extends keyof IPagePathRecord>(pagePath: K, options?: IPagePathRecord[K] & IGetPagePathOptions): string;
30
+ $getPagePathLogin(returnTo?: string, cause?: string): string;
31
+ $getPagePathAccessDenied(): string;
29
32
  $gotoPage(pagePath: string, options?: IGotoPageOptions): TypeGotoPageResult;
30
33
  $gotoHome(options?: IGotoPageOptions): TypeGotoPageResult;
31
34
  $gotoLogin(returnTo?: string, cause?: string): TypeGotoPageResult;
@@ -86,8 +89,11 @@ export interface TypePageSchema {
86
89
  query: z.ZodTypeAny;
87
90
  }
88
91
  export type TypePageSchemas = Record<string, TypePageSchema>;
92
+ type TypePagePathParams<PARAMS> = PARAMS extends object ? {
93
+ [K in keyof PARAMS]: K extends 'locale' ? PARAMS[K] | true : PARAMS[K];
94
+ } : PARAMS;
89
95
  export interface TypePagePathSchema<PARAMS = unknown, QUERY = unknown> {
90
- params?: PARAMS;
96
+ params?: TypePagePathParams<PARAMS>;
91
97
  query?: QUERY;
92
98
  }
93
99
  export interface TypeErrorListener {
@@ -108,4 +114,5 @@ export interface NavigationInformation {
108
114
  delta: number;
109
115
  replace?: boolean;
110
116
  }
117
+ export {};
111
118
  //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/types/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,EAC7B,oCAAoC,EACpC,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,eAAe,EAChB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,YAAY,CAAC;AAEpB,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;AACvC,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,GAAG,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AC,CAAC,CAAC;CACvE,GACD,MAAM,CAAC;AAEX,MAAM,WAAW,kBAAkB,CAAC,MAAM,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO;IACnE,MAAM,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,6BAA6B,GAAG,GAAG,CAAC;CACrF;AAED,oBAAY,cAAc;IACxB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,KAAK;CACb;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -1,7 +1,9 @@
1
1
  import { IParamsAndQuery } from '@cabloy/utils';
2
2
  export declare const SymbolRouterHistory: unique symbol;
3
- export interface IGotoPageOptions extends IParamsAndQuery {
3
+ export interface IGetPagePathOptions extends IParamsAndQuery {
4
4
  returnTo?: string | boolean;
5
+ }
6
+ export interface IGotoPageOptions extends IGetPagePathOptions {
5
7
  forceRedirect?: boolean;
6
8
  replace?: boolean;
7
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AAEjE,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-module-a-router",
3
- "version": "5.1.30",
4
- "gitHead": "ac014afb592f05b3998ef9aaffc903e8c89ee607",
3
+ "version": "5.1.32",
4
+ "gitHead": "f431773baeff1b631f2ba56f657f0160e6dcbd5b",
5
5
  "description": "router",
6
6
  "keywords": [
7
7
  "Zova Module"
@@ -98,13 +98,7 @@ export class SysRouter extends BeanBase {
98
98
  absolute?: boolean,
99
99
  ) {
100
100
  const query = options?.query;
101
- let params = options?.params;
102
- const paramsLocale = cast(params)?.locale;
103
- if (paramsLocale !== undefined) {
104
- const localeCurrent = paramsLocale === true ? this.app.meta.locale.current : paramsLocale;
105
- const locale = localeCurrent === this.sys.config.locale.default ? undefined : localeCurrent;
106
- params = Object.assign({}, params, { locale });
107
- }
101
+ const params = this._normalizePageParams(options?.params);
108
102
  const pagePath = combineParamsAndQuery(path, { params, query });
109
103
  return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;
110
104
  }
@@ -236,6 +230,38 @@ export class SysRouter extends BeanBase {
236
230
  });
237
231
  }
238
232
 
233
+ getAliasPath<K extends keyof IPageNameRecord>(
234
+ name: K,
235
+ options?: IPageNameRecord[K],
236
+ absolute?: boolean,
237
+ ): string | undefined {
238
+ const alias = this.sys.config.routes.name[name]?.alias;
239
+ if (!alias) return;
240
+ const params = this._normalizePageParams(cast(options)?.params);
241
+ const query = cast(options)?.query;
242
+ const aliasName = `$alias:${name}` as never;
243
+ const routeAlias = this._resolveNameOrPath(query, query => {
244
+ const route = this.router.resolve({
245
+ name: this.router.hasRoute(aliasName) ? aliasName : name,
246
+ params,
247
+ query,
248
+ });
249
+ return route.fullPath;
250
+ });
251
+ const pagePath = routeAlias.startsWith('/__alias__')
252
+ ? routeAlias.substring('/__alias__'.length) || '/'
253
+ : routeAlias;
254
+ return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;
255
+ }
256
+
257
+ private _normalizePageParams(params) {
258
+ const paramsLocale = cast(params)?.locale;
259
+ if (paramsLocale === undefined) return params;
260
+ const localeCurrent = paramsLocale === true ? this.app.meta.locale.current : paramsLocale;
261
+ const locale = localeCurrent === this.sys.config.locale.default ? undefined : localeCurrent;
262
+ return Object.assign({}, params, { locale });
263
+ }
264
+
239
265
  private _resolveNameOrPath(query, fn) {
240
266
  const query1 = {};
241
267
  const query2: any = [];
@@ -320,10 +346,11 @@ export class SysRouter extends BeanBase {
320
346
  }
321
347
  // name alias
322
348
  if (name && configRoute?.alias) {
349
+ const alias = Array.isArray(configRoute.alias) ? configRoute.alias[0] : configRoute.alias;
323
350
  // add extra route
324
351
  this.router.addRoute({
325
352
  name: `$alias:${name}`,
326
- path: `/__alias__${configRoute?.alias}`,
353
+ path: `/__alias__${alias}`,
327
354
  redirect: '',
328
355
  });
329
356
  }
package/src/monkey.ts CHANGED
@@ -22,6 +22,7 @@ import { shallowReactive } from 'vue';
22
22
  import { BeanControllerPageBase, BeanSimple, cast, useComputed } from 'zova';
23
23
 
24
24
  import type { BeanRouter } from './bean/bean.router.js';
25
+ import type { SysRouter } from './bean/sys.router.js';
25
26
  import type { TypePageSchema } from './types/router.js';
26
27
 
27
28
  import { routerViewKey } from './lib/const.js';
@@ -40,8 +41,16 @@ export class Monkey
40
41
  IMonkeyController
41
42
  {
42
43
  private _beanRouter: BeanRouter;
44
+ private _sysRouter: SysRouter;
43
45
  serviceRouterGuards: ServiceRouterGuards;
44
46
 
47
+ private async _getSysRouter() {
48
+ if (!this._sysRouter) {
49
+ this._sysRouter = (await this.sys.bean._getBean('a-router.sys.router', false)) as SysRouter;
50
+ }
51
+ return this._sysRouter;
52
+ }
53
+
45
54
  async getBeanRouter() {
46
55
  if (!this._beanRouter) {
47
56
  // markReactive: true
@@ -55,6 +64,20 @@ export class Monkey
55
64
  }
56
65
 
57
66
  async appInitialize() {
67
+ const ssrState = this.ctx.meta.$ssr.state;
68
+ if (
69
+ process.env.SERVER &&
70
+ (ssrState.ssrProfile === undefined || ssrState.ssrProfileOptions === undefined)
71
+ ) {
72
+ const pagePathFull = this.app.$getCurrentPagePath();
73
+ if (pagePathFull) {
74
+ const sysRouter = await this._getSysRouter();
75
+ const route = await sysRouter.resolveRoute(pagePathFull, true, false);
76
+ if (route) {
77
+ this.ctx.meta.$ssr._setProfile(route.meta.ssrProfile, route.meta.ssrProfileOptions);
78
+ }
79
+ }
80
+ }
58
81
  // router
59
82
  this.serviceRouterGuards = await this.bean._newBean(ServiceRouterGuards, false);
60
83
  // ssr errorHandler
package/src/monkeySys.ts CHANGED
@@ -22,7 +22,7 @@ export class MonkeySys
22
22
 
23
23
  async getSysRouter() {
24
24
  if (!this._sysRouter) {
25
- this._sysRouter = (await this.bean._getBean('a-router.sys.router', false)) as SysRouter;
25
+ this._sysRouter = (await this.sys.bean._getBean('a-router.sys.router', false)) as SysRouter;
26
26
  }
27
27
  return this._sysRouter;
28
28
  }
@@ -51,24 +51,43 @@ export class MonkeySys
51
51
  error.message = process.env.SERVER ? error.url : error.pagePath;
52
52
  throw error;
53
53
  };
54
- app.$gotoPage = (pagePath: string, options?: IGotoPageOptions): TypeGotoPageResult => {
55
- const query = options?.query ?? {};
54
+ app.$getPagePath = (pagePath, options) => {
55
+ const query = { ...options?.query };
56
56
  // returnTo
57
57
  if (options?.returnTo) {
58
58
  const returnTo =
59
- typeof options?.returnTo === 'string' ? options?.returnTo : app.$getCurrentPagePath();
59
+ typeof options.returnTo === 'string' ? options.returnTo : app.$getCurrentPagePath();
60
60
  if (returnTo !== app.$getPagePathHome()) {
61
61
  query[app.sys.env.ROUTER_KEY_RETURNTO] = returnTo;
62
62
  }
63
63
  }
64
- // combineParamsAndQuery
65
- pagePath = app.meta.$router.getPagePath(
64
+ return app.meta.$router.getPagePath(
66
65
  pagePath as never,
67
66
  {
68
67
  params: options?.params,
69
68
  query,
70
69
  } as never,
71
70
  );
71
+ };
72
+ app.$getPagePathLogin = (returnTo?: string, cause?: string) => {
73
+ const query: any = {};
74
+ if (cause) {
75
+ query.cause = cause;
76
+ }
77
+ const returnTo2 = returnTo === app.sys.env.ROUTER_PAGE_LOGIN ? undefined : returnTo;
78
+ return app.$getPagePath(
79
+ app.sys.env.ROUTER_PAGE_LOGIN as never,
80
+ {
81
+ query,
82
+ returnTo: returnTo2,
83
+ } as never,
84
+ );
85
+ };
86
+ app.$getPagePathAccessDenied = () => {
87
+ return app.$getPagePath('/home/base/errorAccessDenied' as never);
88
+ };
89
+ app.$gotoPage = (pagePath: string, options?: IGotoPageOptions): TypeGotoPageResult => {
90
+ pagePath = app.$getPagePath(pagePath as never, options as never);
72
91
  // redirect
73
92
  if (process.env.SERVER || options?.forceRedirect) {
74
93
  return app.$redirect(pagePath);
@@ -91,15 +110,12 @@ export class MonkeySys
91
110
  ) {
92
111
  return;
93
112
  }
94
- const query: any = {};
95
- if (cause) {
96
- query.cause = cause;
97
- }
98
- const returnTo2 = returnTo === app.sys.env.ROUTER_PAGE_LOGIN ? undefined : (returnTo ?? true);
99
- return app.$gotoPage(app.sys.env.ROUTER_PAGE_LOGIN, { query, returnTo: returnTo2 });
113
+ const returnTo2 = returnTo ?? app.$getCurrentPagePath();
114
+ const pagePath = app.$getPagePathLogin(returnTo2, cause);
115
+ return app.$gotoPage(pagePath);
100
116
  };
101
117
  app.$gotoAccessDenied = () => {
102
- const pagePath = '/home/base/errorAccessDenied';
118
+ const pagePath = app.$getPagePathAccessDenied();
103
119
  if (cast(app.meta.$router.currentRoute)?.path === pagePath) return;
104
120
  return app.$gotoPage(pagePath, { replace: true });
105
121
  };
@@ -33,18 +33,16 @@ export class ServiceRouterGuards extends BeanRouterGuardsBase {
33
33
  const resLoadModule = await this._forceLoadModule(router, match?.name, match?.path);
34
34
  if (resLoadModule && resLoadModule !== true) return resLoadModule;
35
35
  if (resLoadModule === false) return to.fullPath;
36
- if (router.getRealRouteName(match?.name)) {
37
- const routeAlias = router.resolveName(
38
- `$alias:${match?.name as string}` as never,
36
+ const name = router.getRealRouteName(match?.name);
37
+ if (name) {
38
+ const routeAlias = router.getAliasPath(
39
+ name as never,
39
40
  {
40
41
  params: to.params,
41
42
  query: to.query,
42
- } as any,
43
+ } as never,
43
44
  );
44
- const fullPath = routeAlias.startsWith('/__alias__')
45
- ? routeAlias.substring('/__alias__'.length)
46
- : routeAlias;
47
- return fullPath || '/';
45
+ return routeAlias || '/';
48
46
  } else {
49
47
  return {
50
48
  path: Array.isArray(alias) ? alias[0] : alias,
@@ -17,7 +17,7 @@ import type {
17
17
 
18
18
  import type { BeanRouter } from '../bean/bean.router.js';
19
19
  import type { BeanRouterViewBase } from '../lib/routerViewBase.js';
20
- import type { IGotoPageOptions } from './utils.js';
20
+ import type { IGetPagePathOptions, IGotoPageOptions } from './utils.js';
21
21
  import 'vue-router';
22
22
 
23
23
  export type Lazy<T> = () => Promise<T>;
@@ -49,6 +49,12 @@ declare module '@cabloy/vue-router' {
49
49
  declare module 'zova' {
50
50
  export interface ZovaApplication {
51
51
  $redirect(pagePath: string, status?: 301 | 302): never;
52
+ $getPagePath<K extends keyof IPagePathRecord>(
53
+ pagePath: K,
54
+ options?: IPagePathRecord[K] & IGetPagePathOptions,
55
+ ): string;
56
+ $getPagePathLogin(returnTo?: string, cause?: string): string;
57
+ $getPagePathAccessDenied(): string;
52
58
  $gotoPage(pagePath: string, options?: IGotoPageOptions): TypeGotoPageResult;
53
59
  $gotoHome(options?: IGotoPageOptions): TypeGotoPageResult;
54
60
  $gotoLogin(returnTo?: string, cause?: string): TypeGotoPageResult;
@@ -122,8 +128,14 @@ export interface TypePageSchema {
122
128
  }
123
129
  export type TypePageSchemas = Record<string, TypePageSchema>;
124
130
 
131
+ type TypePagePathParams<PARAMS> = PARAMS extends object
132
+ ? {
133
+ [K in keyof PARAMS]: K extends 'locale' ? PARAMS[K] | true : PARAMS[K];
134
+ }
135
+ : PARAMS;
136
+
125
137
  export interface TypePagePathSchema<PARAMS = unknown, QUERY = unknown> {
126
- params?: PARAMS;
138
+ params?: TypePagePathParams<PARAMS>;
127
139
  query?: QUERY;
128
140
  }
129
141
 
@@ -2,8 +2,11 @@ import { IParamsAndQuery } from '@cabloy/utils';
2
2
 
3
3
  export const SymbolRouterHistory = Symbol('SymbolRouterHistory');
4
4
 
5
- export interface IGotoPageOptions extends IParamsAndQuery {
5
+ export interface IGetPagePathOptions extends IParamsAndQuery {
6
6
  returnTo?: string | boolean;
7
+ }
8
+
9
+ export interface IGotoPageOptions extends IGetPagePathOptions {
7
10
  forceRedirect?: boolean;
8
11
  replace?: boolean;
9
12
  }