cabloy 5.1.47 → 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 +25 -0
- package/package.json +1 -1
- package/vona/src/suite/a-demo/modules/demo-basic/src/bean/ssrMenuGroup.demo.ts +1 -1
- package/zova/env/.env.cabloyBasicWeb +2 -0
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +1 -1
- package/zova/packages-zova/zova-core/src/core/component/module.ts +24 -8
- package/zova/packages-zova/zova-core/src/core/sys/module.ts +41 -17
- package/zova/packages-zova/zova-core/src/core/sys/sys.ts +4 -3
- 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-bean/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-bean/src/monkeySys.ts +6 -2
- package/zova/src/suite-vendor/a-zova/modules/a-bean/src/service/onion_.ts +10 -5
- 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/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
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
|
+
|
|
18
|
+
## 5.1.48
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- Prevent crashes caused by disposed modules during SSR history navigation.
|
|
23
|
+
|
|
24
|
+
### Improvements
|
|
25
|
+
|
|
26
|
+
- Update the `ssrMenuGroup` demo.
|
|
27
|
+
|
|
3
28
|
## 5.1.47
|
|
4
29
|
|
|
5
30
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-jsx",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.54",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "Zova JSX",
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@cabloy/word-utils": "^2.1.14",
|
|
51
51
|
"typestyle": "^2.4.0",
|
|
52
52
|
"vue": "^3.5.32",
|
|
53
|
-
"zova-core": "^5.1.
|
|
53
|
+
"zova-core": "^5.1.48"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"clean-package": "^2.2.0",
|
|
@@ -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": [
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"postpack": "clean-package restore"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"zova-core": "^5.1.
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
48
|
+
"zova-core": "^5.1.48",
|
|
49
|
+
"zova-suite-a-zova": "^5.1.91"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
IMonkeyApp,
|
|
12
12
|
IMonkeyController,
|
|
13
13
|
IMonkeyModule,
|
|
14
|
+
PluginZovaModulesMeta,
|
|
14
15
|
TypeMonkeyName,
|
|
15
16
|
} from '../../types/index.ts';
|
|
16
17
|
|
|
@@ -23,6 +24,14 @@ export class AppModule extends BeanSimple {
|
|
|
23
24
|
private mainInstances: Record<string, IModuleMain> = {};
|
|
24
25
|
private monkeyInstances: Record<string, IMonkeyModule & IMonkeyApp & IMonkeyController> = {};
|
|
25
26
|
|
|
27
|
+
private _ensureModulesMeta(): PluginZovaModulesMeta {
|
|
28
|
+
const modulesMeta = this.sys.meta.module.getModulesMeta();
|
|
29
|
+
if (!modulesMeta) {
|
|
30
|
+
throw new Error('module registry has been disposed');
|
|
31
|
+
}
|
|
32
|
+
return modulesMeta;
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
/** @internal */
|
|
27
36
|
public async initialize() {
|
|
28
37
|
await this._requireAllSpecifics('preload');
|
|
@@ -34,6 +43,7 @@ export class AppModule extends BeanSimple {
|
|
|
34
43
|
get(moduleName: string, forceLoad?: boolean): IModule | undefined;
|
|
35
44
|
get(moduleName: IModuleInfo, forceLoad?: boolean): IModule | undefined;
|
|
36
45
|
get(moduleName: string | IModuleInfo, forceLoad?: boolean): IModule | undefined {
|
|
46
|
+
if (!this.sys.meta.module.getModulesMeta()) return undefined;
|
|
37
47
|
// module info
|
|
38
48
|
if (!moduleName) return undefined;
|
|
39
49
|
const moduleInfo =
|
|
@@ -67,8 +77,9 @@ export class AppModule extends BeanSimple {
|
|
|
67
77
|
// should not try check get directly
|
|
68
78
|
// const module = this.getOnly(relativeName);
|
|
69
79
|
// if (module) return module;
|
|
80
|
+
const modulesMeta = this._ensureModulesMeta();
|
|
70
81
|
// module
|
|
71
|
-
const moduleRepo =
|
|
82
|
+
const moduleRepo = modulesMeta.modules[relativeName];
|
|
72
83
|
if (!moduleRepo) throw new Error(`module not exists: ${relativeName}`);
|
|
73
84
|
// install
|
|
74
85
|
await this._install(relativeName, moduleRepo);
|
|
@@ -84,15 +95,16 @@ export class AppModule extends BeanSimple {
|
|
|
84
95
|
}
|
|
85
96
|
|
|
86
97
|
private async _requireAllSpecifics(capabilityName: 'preload' | 'monkey' | 'sync') {
|
|
87
|
-
const
|
|
88
|
-
|
|
98
|
+
const modulesMeta = this._ensureModulesMeta();
|
|
99
|
+
const moduleNames = modulesMeta.moduleNames.filter(moduleName => {
|
|
100
|
+
const module = modulesMeta.modules[moduleName];
|
|
89
101
|
return module.info.capabilities?.[capabilityName];
|
|
90
102
|
});
|
|
91
103
|
// if (moduleNames.length > 0) {
|
|
92
104
|
// this.sys.meta.logger.child('module', 'default').debug(`app modules: ${capabilityName}: ${moduleNames.join(',')}`);
|
|
93
105
|
// }
|
|
94
106
|
for (const moduleName of moduleNames) {
|
|
95
|
-
const module =
|
|
107
|
+
const module = modulesMeta.modules[moduleName];
|
|
96
108
|
await this._install(moduleName, module);
|
|
97
109
|
}
|
|
98
110
|
}
|
|
@@ -167,6 +179,8 @@ export class AppModule extends BeanSimple {
|
|
|
167
179
|
moduleTarget?: IModule,
|
|
168
180
|
...monkeyData: any[]
|
|
169
181
|
) {
|
|
182
|
+
const modulesMeta = this.sys.meta.module.getModulesMeta();
|
|
183
|
+
if (!modulesMeta) return;
|
|
170
184
|
// self: main
|
|
171
185
|
if (moduleTarget) {
|
|
172
186
|
const mainInstance = this.mainInstances[moduleTarget.info.relativeName];
|
|
@@ -178,8 +192,8 @@ export class AppModule extends BeanSimple {
|
|
|
178
192
|
}
|
|
179
193
|
}
|
|
180
194
|
// module monkey
|
|
181
|
-
await forEach(
|
|
182
|
-
const moduleMonkey: IModule =
|
|
195
|
+
await forEach(modulesMeta.moduleNames, order, async key => {
|
|
196
|
+
const moduleMonkey: IModule = modulesMeta.modules[key];
|
|
183
197
|
if (moduleMonkey.info.capabilities?.monkey) {
|
|
184
198
|
const monkeyInstance = this.monkeyInstances[key];
|
|
185
199
|
if (monkeyInstance && monkeyInstance[monkeyName]) {
|
|
@@ -217,6 +231,8 @@ export class AppModule extends BeanSimple {
|
|
|
217
231
|
moduleTarget?: IModule,
|
|
218
232
|
...monkeyData: any[]
|
|
219
233
|
) {
|
|
234
|
+
const modulesMeta = this.sys.meta.module.getModulesMeta();
|
|
235
|
+
if (!modulesMeta) return;
|
|
220
236
|
// self: main
|
|
221
237
|
if (moduleTarget) {
|
|
222
238
|
const mainInstance = this.mainInstances[moduleTarget.info.relativeName];
|
|
@@ -228,8 +244,8 @@ export class AppModule extends BeanSimple {
|
|
|
228
244
|
}
|
|
229
245
|
}
|
|
230
246
|
// module monkey
|
|
231
|
-
forEachSync(
|
|
232
|
-
const moduleMonkey: IModule =
|
|
247
|
+
forEachSync(modulesMeta.moduleNames, order, key => {
|
|
248
|
+
const moduleMonkey: IModule = modulesMeta.modules[key];
|
|
233
249
|
if (moduleMonkey.info.capabilities?.monkey) {
|
|
234
250
|
const monkeyInstance = this.monkeyInstances[key];
|
|
235
251
|
if (monkeyInstance && monkeyInstance[monkeyName]) {
|
|
@@ -20,7 +20,7 @@ import { StateLock } from '../../utils/stateLock.ts';
|
|
|
20
20
|
import { deepExtend } from '../sys/util.ts';
|
|
21
21
|
|
|
22
22
|
export class SysModule extends BeanSimple {
|
|
23
|
-
public modulesMeta: PluginZovaModulesMeta;
|
|
23
|
+
public modulesMeta: PluginZovaModulesMeta | undefined;
|
|
24
24
|
private modules: Record<string, IModule> = shallowReactive({});
|
|
25
25
|
private mainInstances: Record<string, IModuleMainSys> = {};
|
|
26
26
|
private monkeyInstances: Record<string, IMonkeyModuleSys & IMonkeySys> = {};
|
|
@@ -39,13 +39,26 @@ export class SysModule extends BeanSimple {
|
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
41
41
|
public dispose() {
|
|
42
|
-
this.modulesMeta = undefined
|
|
42
|
+
this.modulesMeta = undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public getModulesMeta(): PluginZovaModulesMeta | undefined {
|
|
46
|
+
return this.modulesMeta;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private _ensureModulesMeta(): PluginZovaModulesMeta {
|
|
50
|
+
const modulesMeta = this.modulesMeta;
|
|
51
|
+
if (!modulesMeta) {
|
|
52
|
+
throw new Error('module registry has been disposed');
|
|
53
|
+
}
|
|
54
|
+
return modulesMeta;
|
|
43
55
|
}
|
|
44
56
|
|
|
45
57
|
get<K extends TypeBeanScopeRecordKeys>(moduleName: K): IModule | undefined;
|
|
46
58
|
get(moduleName: string): IModule | undefined;
|
|
47
59
|
get(moduleName: IModuleInfo): IModule | undefined;
|
|
48
60
|
get(moduleName: string | IModuleInfo): IModule | undefined {
|
|
61
|
+
if (!this.modulesMeta) return undefined;
|
|
49
62
|
// module info
|
|
50
63
|
if (!moduleName) return undefined;
|
|
51
64
|
const moduleInfo =
|
|
@@ -75,8 +88,9 @@ export class SysModule extends BeanSimple {
|
|
|
75
88
|
// should not try check get directly
|
|
76
89
|
// const module = this.getOnly(relativeName);
|
|
77
90
|
// if (module) return module;
|
|
91
|
+
const modulesMeta = this._ensureModulesMeta();
|
|
78
92
|
// module
|
|
79
|
-
const moduleRepo =
|
|
93
|
+
const moduleRepo = modulesMeta.modules[relativeName];
|
|
80
94
|
if (!moduleRepo) throw new Error(`module not exists: ${relativeName}`);
|
|
81
95
|
// install
|
|
82
96
|
await this._install(relativeName, moduleRepo);
|
|
@@ -88,19 +102,22 @@ export class SysModule extends BeanSimple {
|
|
|
88
102
|
exists(moduleName: string): boolean;
|
|
89
103
|
exists(moduleName: IModuleInfo): boolean;
|
|
90
104
|
exists(moduleName: string | IModuleInfo): boolean {
|
|
105
|
+
const modulesMeta = this.modulesMeta;
|
|
106
|
+
if (!modulesMeta) return false;
|
|
91
107
|
// module info
|
|
92
108
|
if (!moduleName) return false;
|
|
93
109
|
const moduleInfo =
|
|
94
110
|
typeof moduleName === 'string' ? ModuleInfo.parseInfo(moduleName) : moduleName;
|
|
95
111
|
if (!moduleInfo) throw new Error(`invalid module name: ${moduleName}`);
|
|
96
|
-
const moduleRepo =
|
|
112
|
+
const moduleRepo = modulesMeta.modules[moduleInfo.relativeName];
|
|
97
113
|
return !!moduleRepo;
|
|
98
114
|
}
|
|
99
115
|
|
|
100
116
|
private async _loadAllMonkeysAndSyncsAndPreloads() {
|
|
117
|
+
const modulesMeta = this._ensureModulesMeta();
|
|
101
118
|
const moduleNames: string[] = [];
|
|
102
|
-
for (const moduleName of
|
|
103
|
-
const module =
|
|
119
|
+
for (const moduleName of modulesMeta.moduleNames) {
|
|
120
|
+
const module = modulesMeta.modules[moduleName];
|
|
104
121
|
const info = module.info;
|
|
105
122
|
const shouldLoad =
|
|
106
123
|
process.env.SERVER ||
|
|
@@ -119,10 +136,11 @@ export class SysModule extends BeanSimple {
|
|
|
119
136
|
|
|
120
137
|
public async loadModules(moduleNames: string[]) {
|
|
121
138
|
if (moduleNames.length === 0) return;
|
|
139
|
+
const modulesMeta = this._ensureModulesMeta();
|
|
122
140
|
const promises: Promise<IModuleResource>[] = [];
|
|
123
141
|
const moduleNamesLoading: string[] = [];
|
|
124
142
|
for (const moduleName of moduleNames) {
|
|
125
|
-
const module =
|
|
143
|
+
const module = modulesMeta.modules[moduleName];
|
|
126
144
|
if (!module) throw new Error(`module not found: ${moduleName}`);
|
|
127
145
|
const moduleResource = module.resource as any;
|
|
128
146
|
if (typeof moduleResource === 'function') {
|
|
@@ -137,13 +155,14 @@ export class SysModule extends BeanSimple {
|
|
|
137
155
|
const modulesResource = await Promise.all(promises);
|
|
138
156
|
for (let i = 0; i < modulesResource.length; i++) {
|
|
139
157
|
const moduleName = moduleNamesLoading[i];
|
|
140
|
-
|
|
158
|
+
modulesMeta.modules[moduleName].resource = modulesResource[i];
|
|
141
159
|
}
|
|
142
160
|
}
|
|
143
161
|
|
|
144
162
|
private async _requireAllSpecifics(capabilityName: 'preload' | 'monkey' | 'sync') {
|
|
145
|
-
const
|
|
146
|
-
|
|
163
|
+
const modulesMeta = this._ensureModulesMeta();
|
|
164
|
+
const moduleNames = modulesMeta.moduleNames.filter(moduleName => {
|
|
165
|
+
const module = modulesMeta.modules[moduleName];
|
|
147
166
|
return module.info.capabilities?.[capabilityName];
|
|
148
167
|
});
|
|
149
168
|
if (moduleNames.length > 0) {
|
|
@@ -152,14 +171,15 @@ export class SysModule extends BeanSimple {
|
|
|
152
171
|
.debug(`modules ${capabilityName}: ${moduleNames.join(',')}`);
|
|
153
172
|
}
|
|
154
173
|
for (const moduleName of moduleNames) {
|
|
155
|
-
const module =
|
|
174
|
+
const module = modulesMeta.modules[moduleName];
|
|
156
175
|
await this._install(moduleName, module);
|
|
157
176
|
}
|
|
158
177
|
}
|
|
159
178
|
|
|
160
179
|
private async _requireAllOthers() {
|
|
161
|
-
|
|
162
|
-
|
|
180
|
+
const modulesMeta = this._ensureModulesMeta();
|
|
181
|
+
for (const moduleName of modulesMeta.moduleNames) {
|
|
182
|
+
const module = modulesMeta.modules[moduleName];
|
|
163
183
|
const info = module.info;
|
|
164
184
|
const shouldInstall =
|
|
165
185
|
!info.capabilities?.monkey && !info.capabilities?.sync && !info.capabilities?.preload;
|
|
@@ -273,6 +293,8 @@ export class SysModule extends BeanSimple {
|
|
|
273
293
|
moduleTarget?: IModule,
|
|
274
294
|
...monkeyData: any[]
|
|
275
295
|
) {
|
|
296
|
+
const modulesMeta = this.modulesMeta;
|
|
297
|
+
if (!modulesMeta) return;
|
|
276
298
|
// self: main
|
|
277
299
|
if (moduleTarget) {
|
|
278
300
|
const mainInstance = this.mainInstances[moduleTarget.info.relativeName];
|
|
@@ -281,8 +303,8 @@ export class SysModule extends BeanSimple {
|
|
|
281
303
|
}
|
|
282
304
|
}
|
|
283
305
|
// module monkey
|
|
284
|
-
await forEach(
|
|
285
|
-
const moduleMonkey: IModule =
|
|
306
|
+
await forEach(modulesMeta.moduleNames, order, async key => {
|
|
307
|
+
const moduleMonkey: IModule = modulesMeta.modules[key];
|
|
286
308
|
if (moduleMonkey.info.capabilities?.monkey) {
|
|
287
309
|
const monkeyInstance = this.monkeyInstances[key];
|
|
288
310
|
if (monkeyInstance && monkeyInstance[monkeyName]) {
|
|
@@ -316,6 +338,8 @@ export class SysModule extends BeanSimple {
|
|
|
316
338
|
moduleTarget?: IModule,
|
|
317
339
|
...monkeyData: any[]
|
|
318
340
|
) {
|
|
341
|
+
const modulesMeta = this.modulesMeta;
|
|
342
|
+
if (!modulesMeta) return;
|
|
319
343
|
// self: main
|
|
320
344
|
if (moduleTarget) {
|
|
321
345
|
const mainInstance = this.mainInstances[moduleTarget.info.relativeName];
|
|
@@ -324,8 +348,8 @@ export class SysModule extends BeanSimple {
|
|
|
324
348
|
}
|
|
325
349
|
}
|
|
326
350
|
// module monkey
|
|
327
|
-
forEachSync(
|
|
328
|
-
const moduleMonkey: IModule =
|
|
351
|
+
forEachSync(modulesMeta.moduleNames, order, key => {
|
|
352
|
+
const moduleMonkey: IModule = modulesMeta.modules[key];
|
|
329
353
|
if (moduleMonkey.info.capabilities?.monkey) {
|
|
330
354
|
const monkeyInstance = this.monkeyInstances[key];
|
|
331
355
|
if (monkeyInstance && monkeyInstance[monkeyName]) {
|
|
@@ -96,11 +96,12 @@ export class ZovaSys {
|
|
|
96
96
|
viteHot.on('vite:beforeFullReload', hook);
|
|
97
97
|
}
|
|
98
98
|
if (process.env.CLIENT && typeof window !== 'undefined') {
|
|
99
|
-
const hook = () => {
|
|
99
|
+
const hook = (event: PageTransitionEvent) => {
|
|
100
|
+
if (event.persisted) return;
|
|
100
101
|
this.close();
|
|
101
|
-
window.removeEventListener('
|
|
102
|
+
window.removeEventListener('pagehide', hook);
|
|
102
103
|
};
|
|
103
|
-
window.addEventListener('
|
|
104
|
+
window.addEventListener('pagehide', hook);
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
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;
|
|
@@ -4,9 +4,13 @@ import { BeanSimple } from 'zova';
|
|
|
4
4
|
|
|
5
5
|
export class MonkeySys extends BeanSimple implements IMonkeySysInitialize {
|
|
6
6
|
async sysInitialize() {
|
|
7
|
+
const modulesMeta = this.sys.meta.module.getModulesMeta();
|
|
8
|
+
if (!modulesMeta) {
|
|
9
|
+
throw new Error('module registry has been disposed');
|
|
10
|
+
}
|
|
7
11
|
let beansPreload: string[] = [];
|
|
8
|
-
for (const moduleName in
|
|
9
|
-
const module =
|
|
12
|
+
for (const moduleName in modulesMeta.modules) {
|
|
13
|
+
const module = modulesMeta.modules[moduleName];
|
|
10
14
|
if (!module.info.onionsMeta?.beansPreload) continue;
|
|
11
15
|
beansPreload = beansPreload.concat(module.info.onionsMeta?.beansPreload);
|
|
12
16
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ISwapDepsItem } from '@cabloy/deps';
|
|
2
2
|
import type { OnionSceneMeta } from '@cabloy/module-info';
|
|
3
|
+
import type { PluginZovaModulesMeta } from 'zova';
|
|
3
4
|
import type { Next } from 'zova';
|
|
4
5
|
|
|
5
6
|
import { compose as _compose } from '@cabloy/compose';
|
|
@@ -39,19 +40,23 @@ export class ServiceOnion<OPTIONS, ONIONNAME extends string> extends BeanSimple
|
|
|
39
40
|
if (process.env.DEV && this.bean.containerType !== 'sys') {
|
|
40
41
|
throw new Error('should in sys container');
|
|
41
42
|
}
|
|
43
|
+
const modulesMeta = this.sys.meta.module.getModulesMeta();
|
|
44
|
+
if (!modulesMeta) {
|
|
45
|
+
throw new Error('module registry has been disposed');
|
|
46
|
+
}
|
|
42
47
|
this.sysOnion = sysOnion;
|
|
43
48
|
this.sceneName = sceneName;
|
|
44
|
-
this.sceneMeta = getOnionScenesMeta(
|
|
49
|
+
this.sceneMeta = getOnionScenesMeta(modulesMeta.modules)[this.sceneName];
|
|
45
50
|
if (this.sceneMeta.optionsPackage) {
|
|
46
|
-
this._initOnionsAll();
|
|
51
|
+
this._initOnionsAll(modulesMeta);
|
|
47
52
|
this._swapOnions(this.onionsAll);
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
|
|
51
|
-
private _initOnionsAll() {
|
|
56
|
+
private _initOnionsAll(modulesMeta: PluginZovaModulesMeta) {
|
|
52
57
|
this.onionsAll = [];
|
|
53
|
-
for (const moduleName in
|
|
54
|
-
const module =
|
|
58
|
+
for (const moduleName in modulesMeta.modules) {
|
|
59
|
+
const module = modulesMeta.modules[moduleName];
|
|
55
60
|
const nodeItems = module.info.onionsMeta?.onionsConfig?.[this.sceneName];
|
|
56
61
|
if (!nodeItems) continue;
|
|
57
62
|
for (const itemName in nodeItems) {
|
|
@@ -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-module-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.60",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"keywords": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@cabloy/word-utils": "^2.1.14",
|
|
44
44
|
"defu": "^6.1.7",
|
|
45
45
|
"luxon": "^3.7.2",
|
|
46
|
-
"zova-jsx": "^1.1.
|
|
46
|
+
"zova-jsx": "^1.1.54"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@cabloy/cli": "^3.1.14",
|
|
@@ -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",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"zova-module-a-api": "^5.1.15",
|
|
12
12
|
"zova-module-a-app": "^5.1.18",
|
|
13
|
-
"zova-module-a-bean": "^5.1.
|
|
13
|
+
"zova-module-a-bean": "^5.1.25",
|
|
14
14
|
"zova-module-a-behavior": "^5.1.19",
|
|
15
15
|
"zova-module-a-behaviors": "^5.1.15",
|
|
16
16
|
"zova-module-a-boundary": "^5.1.15",
|
|
@@ -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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"zova-module-a-style": "^5.1.25",
|
|
33
33
|
"zova-module-a-table": "^5.1.27",
|
|
34
34
|
"zova-module-a-zod": "^5.1.23",
|
|
35
|
-
"zova-module-a-zova": "^5.1.
|
|
35
|
+
"zova-module-a-zova": "^5.1.60"
|
|
36
36
|
},
|
|
37
37
|
"title": "a-zova"
|
|
38
38
|
}
|