cabloy 5.1.48 → 5.1.49
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.
- package/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/zova/env/.env.cabloyBasicWeb +2 -0
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +7 -7
- package/zova/src/suite/a-home/modules/home-indexweb/src/.metadata/index.ts +9 -3
- package/zova/src/suite/a-home/modules/home-indexweb/src/.metadata/page/home.ts +7 -0
- package/zova/src/suite/a-home/modules/home-indexweb/src/page/home/controller.tsx +5 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/model/menu.ts +6 -2
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.header.tsx +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tabs.tsx +1 -10
- package/zova/src/suite/a-home/modules/home-layoutweb/src/model/menu.ts +6 -2
- package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/bean/sys.router.ts +10 -11
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/monkeySys.ts +10 -5
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/types/router.ts +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/types/utils.ts +3 -2
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.1.49
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Add typed locale parameters for the home page.
|
|
8
|
+
- Support route parameters in router navigation.
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
- Resolve localized menu page paths.
|
|
13
|
+
|
|
14
|
+
### Improvements
|
|
15
|
+
|
|
16
|
+
- Update `render.tabs.tsx`.
|
|
17
|
+
|
|
3
18
|
## 5.1.48
|
|
4
19
|
|
|
5
20
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.92",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"zova-core": "^5.1.48",
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
49
|
+
"zova-suite-a-zova": "^5.1.91"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|
package/zova/pnpm-lock.yaml
CHANGED
|
@@ -131,7 +131,7 @@ importers:
|
|
|
131
131
|
specifier: workspace:^
|
|
132
132
|
version: link:packages-zova/zova
|
|
133
133
|
zova-jsx:
|
|
134
|
-
specifier: ^1.1.
|
|
134
|
+
specifier: ^1.1.54
|
|
135
135
|
version: link:packages-utils/zova-jsx
|
|
136
136
|
zova-module-a-api:
|
|
137
137
|
specifier: workspace:^
|
|
@@ -667,7 +667,7 @@ importers:
|
|
|
667
667
|
specifier: ^3.5.32
|
|
668
668
|
version: 3.5.34(typescript@5.9.3)
|
|
669
669
|
zova-core:
|
|
670
|
-
specifier: ^5.1.
|
|
670
|
+
specifier: ^5.1.48
|
|
671
671
|
version: link:../../packages-zova/zova-core
|
|
672
672
|
devDependencies:
|
|
673
673
|
clean-package:
|
|
@@ -808,10 +808,10 @@ importers:
|
|
|
808
808
|
packages-zova/zova:
|
|
809
809
|
dependencies:
|
|
810
810
|
zova-core:
|
|
811
|
-
specifier: ^5.1.
|
|
811
|
+
specifier: ^5.1.48
|
|
812
812
|
version: link:../zova-core
|
|
813
813
|
zova-suite-a-zova:
|
|
814
|
-
specifier: ^5.1.
|
|
814
|
+
specifier: ^5.1.90
|
|
815
815
|
version: link:../../src/suite-vendor/a-zova
|
|
816
816
|
devDependencies:
|
|
817
817
|
clean-package:
|
|
@@ -939,7 +939,7 @@ importers:
|
|
|
939
939
|
specifier: ^5.1.18
|
|
940
940
|
version: link:modules/a-app
|
|
941
941
|
zova-module-a-bean:
|
|
942
|
-
specifier: ^5.1.
|
|
942
|
+
specifier: ^5.1.25
|
|
943
943
|
version: link:modules/a-bean
|
|
944
944
|
zova-module-a-behavior:
|
|
945
945
|
specifier: ^5.1.19
|
|
@@ -1005,7 +1005,7 @@ importers:
|
|
|
1005
1005
|
specifier: ^5.1.23
|
|
1006
1006
|
version: link:modules/a-zod
|
|
1007
1007
|
zova-module-a-zova:
|
|
1008
|
-
specifier: ^5.1.
|
|
1008
|
+
specifier: ^5.1.60
|
|
1009
1009
|
version: link:modules/a-zova
|
|
1010
1010
|
|
|
1011
1011
|
src/suite-vendor/a-zova/modules/a-api:
|
|
@@ -1344,7 +1344,7 @@ importers:
|
|
|
1344
1344
|
specifier: ^3.7.2
|
|
1345
1345
|
version: 3.7.2
|
|
1346
1346
|
zova-jsx:
|
|
1347
|
-
specifier: ^1.1.
|
|
1347
|
+
specifier: ^1.1.54
|
|
1348
1348
|
version: link:../../../../../packages-utils/zova-jsx
|
|
1349
1349
|
devDependencies:
|
|
1350
1350
|
'@cabloy/cli':
|
|
@@ -26,12 +26,13 @@ declare module 'zova' {
|
|
|
26
26
|
/** controller: end */
|
|
27
27
|
/** pages: begin */
|
|
28
28
|
export * from './page/home.js';
|
|
29
|
+
import { NSControllerPageHome } from './page/home.js';
|
|
29
30
|
export * from '../routes.js';
|
|
30
31
|
import { TypePagePathSchema } from 'zova-module-a-router';
|
|
31
32
|
import 'zova';
|
|
32
33
|
declare module 'zova-module-a-router' {
|
|
33
34
|
export interface IPagePathRecord {
|
|
34
|
-
'/home/indexweb/home/:locale?': TypePagePathSchema<
|
|
35
|
+
'/home/indexweb/home/:locale?': TypePagePathSchema<NSControllerPageHome.ParamsInput,undefined>;
|
|
35
36
|
}
|
|
36
37
|
export interface IPageNameRecord {
|
|
37
38
|
'home-indexweb:home': undefined;
|
|
@@ -41,10 +42,15 @@ export const pagePathSchemas = {
|
|
|
41
42
|
|
|
42
43
|
};
|
|
43
44
|
export const pageNameSchemas = {
|
|
44
|
-
|
|
45
|
+
'home-indexweb:home': {
|
|
46
|
+
params: NSControllerPageHome.paramsSchema,
|
|
47
|
+
|
|
48
|
+
},
|
|
45
49
|
};
|
|
46
50
|
declare module 'zova-module-home-indexweb' {
|
|
47
|
-
|
|
51
|
+
export interface ControllerPageHome {
|
|
52
|
+
$params: NSControllerPageHome.ParamsOutput;
|
|
53
|
+
}
|
|
48
54
|
}
|
|
49
55
|
/** pages: end */
|
|
50
56
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { createZovaComponentPage } from 'zova';
|
|
2
3
|
|
|
3
4
|
import { ControllerPageHome } from '../../page/home/controller.jsx';
|
|
5
|
+
import { ControllerPageHomeSchemaParams } from '../../page/home/controller.jsx';
|
|
6
|
+
export namespace NSControllerPageHome {
|
|
7
|
+
export const paramsSchema = ControllerPageHomeSchemaParams;
|
|
8
|
+
export type ParamsInput = z.input<typeof ControllerPageHomeSchemaParams>;
|
|
9
|
+
export type ParamsOutput = z.output<typeof ControllerPageHomeSchemaParams>;
|
|
10
|
+
}
|
|
4
11
|
|
|
5
12
|
export const ZPageHome = createZovaComponentPage(ControllerPageHome, undefined, undefined);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { BeanControllerPageBase } from 'zova';
|
|
2
3
|
import { Controller } from 'zova-module-a-bean';
|
|
3
4
|
|
|
5
|
+
export const ControllerPageHomeSchemaParams = z.object({
|
|
6
|
+
locale: z.string().optional(),
|
|
7
|
+
});
|
|
8
|
+
|
|
4
9
|
@Controller()
|
|
5
10
|
export class ControllerPageHome extends BeanControllerPageBase {
|
|
6
11
|
public message: string;
|
|
@@ -49,8 +49,12 @@ export class ModelMenu extends BeanModelBase {
|
|
|
49
49
|
});
|
|
50
50
|
const menus = data.menus
|
|
51
51
|
?.map(item => {
|
|
52
|
-
if (item.
|
|
53
|
-
|
|
52
|
+
if (item.external || !item.link) return item;
|
|
53
|
+
if (this.$router.isRouterName(item.link)) {
|
|
54
|
+
const link = this.$router.resolveName(item.link as never, item.meta as never);
|
|
55
|
+
return { ...item, link };
|
|
56
|
+
} else if (item.meta?.params || item.meta?.query) {
|
|
57
|
+
const link = this.$router.getPagePath(item.link as never, item.meta as never);
|
|
54
58
|
return { ...item, link };
|
|
55
59
|
}
|
|
56
60
|
return item;
|
package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tabs.tsx
CHANGED
|
@@ -146,16 +146,7 @@ export class RenderTabs extends BeanRenderBase {
|
|
|
146
146
|
if (item.external || !item.link) return false;
|
|
147
147
|
const currentRoute = this.$currentRoute;
|
|
148
148
|
if (!currentRoute) return false;
|
|
149
|
-
|
|
150
|
-
? this.$router.resolveName(
|
|
151
|
-
item.link as never,
|
|
152
|
-
{
|
|
153
|
-
params: item.meta?.params,
|
|
154
|
-
query: item.meta?.query,
|
|
155
|
-
} as never,
|
|
156
|
-
)
|
|
157
|
-
: this.$router.resolvePath(item.link as never, item.meta?.query as never);
|
|
158
|
-
return currentRoute.fullPath === fullPath;
|
|
149
|
+
return currentRoute.fullPath === item.link;
|
|
159
150
|
}
|
|
160
151
|
|
|
161
152
|
private _getMenuItemKey(item: TypeMenuItem): string {
|
|
@@ -49,8 +49,12 @@ export class ModelMenu extends BeanModelBase {
|
|
|
49
49
|
});
|
|
50
50
|
const menus = data.menus
|
|
51
51
|
?.map(item => {
|
|
52
|
-
if (item.
|
|
53
|
-
|
|
52
|
+
if (item.external || !item.link) return item;
|
|
53
|
+
if (this.$router.isRouterName(item.link)) {
|
|
54
|
+
const link = this.$router.resolveName(item.link as never, item.meta as never);
|
|
55
|
+
return { ...item, link };
|
|
56
|
+
} else if (item.meta?.params || item.meta?.query) {
|
|
57
|
+
const link = this.$router.getPagePath(item.link as never, item.meta as never);
|
|
54
58
|
return { ...item, link };
|
|
55
59
|
}
|
|
56
60
|
return item;
|
|
@@ -96,10 +96,16 @@ export class SysRouter extends BeanBase {
|
|
|
96
96
|
options?: IPagePathRecord[K],
|
|
97
97
|
absolute?: boolean,
|
|
98
98
|
) {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const query = options?.query;
|
|
100
|
+
let params = options?.params;
|
|
101
|
+
if (cast(params)?.locale === true) {
|
|
102
|
+
const locale =
|
|
103
|
+
this.app.meta.locale.current === this.sys.config.locale.default
|
|
104
|
+
? undefined
|
|
105
|
+
: this.app.meta.locale.current;
|
|
106
|
+
params = Object.assign({}, params, { locale });
|
|
107
|
+
}
|
|
108
|
+
const pagePath = combineParamsAndQuery(path, { params, query });
|
|
103
109
|
return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;
|
|
104
110
|
}
|
|
105
111
|
|
|
@@ -208,13 +214,6 @@ export class SysRouter extends BeanBase {
|
|
|
208
214
|
});
|
|
209
215
|
}
|
|
210
216
|
|
|
211
|
-
resolvePath<K extends keyof IPagePathRecord>(path: K, query?: IPagePathRecord[K]): string {
|
|
212
|
-
return this._resolveNameOrPath(query, query => {
|
|
213
|
-
const route = this.router.resolve({ path, query });
|
|
214
|
-
return route.fullPath;
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
|
|
218
217
|
private _resolveNameOrPath(query, fn) {
|
|
219
218
|
const query1 = {};
|
|
220
219
|
const query2: any = [];
|
|
@@ -2,7 +2,6 @@ import type { IModule } from '@cabloy/module-info';
|
|
|
2
2
|
import type { IMonkeyModuleSys, IMonkeySysApplicationInitialize, ZovaApplication } from 'zova';
|
|
3
3
|
import type { ErrorSSR } from 'zova-module-a-ssr';
|
|
4
4
|
|
|
5
|
-
import { combineQueries } from '@cabloy/utils';
|
|
6
5
|
import { BeanSimple, cast, isHttpUrl } from 'zova';
|
|
7
6
|
|
|
8
7
|
import type { SysRouter } from './bean/sys.router.js';
|
|
@@ -62,8 +61,14 @@ export class MonkeySys
|
|
|
62
61
|
query[app.sys.env.ROUTER_KEY_RETURNTO] = returnTo;
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
//
|
|
66
|
-
pagePath =
|
|
64
|
+
// combineParamsAndQuery
|
|
65
|
+
pagePath = app.meta.$router.getPagePath(
|
|
66
|
+
pagePath as never,
|
|
67
|
+
{
|
|
68
|
+
params: options?.params,
|
|
69
|
+
query,
|
|
70
|
+
} as never,
|
|
71
|
+
);
|
|
67
72
|
// redirect
|
|
68
73
|
if (process.env.SERVER || options?.forceRedirect) {
|
|
69
74
|
return app.$redirect(pagePath);
|
|
@@ -75,8 +80,8 @@ export class MonkeySys
|
|
|
75
80
|
return app.meta.$router[options?.replace ? 'replace' : 'push'](pagePath);
|
|
76
81
|
}
|
|
77
82
|
};
|
|
78
|
-
app.$gotoHome = () => {
|
|
79
|
-
return app.$gotoPage(app.sys.env.ROUTER_PAGE_HOME);
|
|
83
|
+
app.$gotoHome = (options?: IGotoPageOptions) => {
|
|
84
|
+
return app.$gotoPage(app.sys.env.ROUTER_PAGE_HOME, options);
|
|
80
85
|
};
|
|
81
86
|
app.$gotoLogin = (returnTo?: string, cause?: string) => {
|
|
82
87
|
if (!returnTo && cast(app.meta.$router.currentRoute)?.path === app.sys.env.ROUTER_PAGE_LOGIN)
|
|
@@ -50,7 +50,7 @@ declare module 'zova' {
|
|
|
50
50
|
export interface ZovaApplication {
|
|
51
51
|
$redirect(pagePath: string, status?: 301 | 302): never;
|
|
52
52
|
$gotoPage(pagePath: string, options?: IGotoPageOptions): TypeGotoPageResult;
|
|
53
|
-
$gotoHome(): TypeGotoPageResult;
|
|
53
|
+
$gotoHome(options?: IGotoPageOptions): TypeGotoPageResult;
|
|
54
54
|
$gotoLogin(returnTo?: string, cause?: string): TypeGotoPageResult;
|
|
55
55
|
$gotoReturnTo(returnTo?: string): TypeGotoPageResult;
|
|
56
56
|
$getReturnTo(returnTo?: string): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IParamsAndQuery } from '@cabloy/utils';
|
|
2
|
+
|
|
1
3
|
export const SymbolRouterHistory = Symbol('SymbolRouterHistory');
|
|
2
4
|
|
|
3
|
-
export interface IGotoPageOptions {
|
|
4
|
-
query?: object;
|
|
5
|
+
export interface IGotoPageOptions extends IParamsAndQuery {
|
|
5
6
|
returnTo?: string | boolean;
|
|
6
7
|
forceRedirect?: boolean;
|
|
7
8
|
replace?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.91",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"zova-module-a-meta": "^5.1.15",
|
|
24
24
|
"zova-module-a-model": "^5.1.23",
|
|
25
25
|
"zova-module-a-openapi": "^5.1.30",
|
|
26
|
-
"zova-module-a-router": "^5.1.
|
|
26
|
+
"zova-module-a-router": "^5.1.22",
|
|
27
27
|
"zova-module-a-routerstack": "^5.1.20",
|
|
28
28
|
"zova-module-a-routertabs": "^5.1.24",
|
|
29
29
|
"zova-module-a-ssr": "^5.1.18",
|