cabloy 5.1.41 → 5.1.43
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 +32 -0
- package/package.json +4 -1
- package/scripts/init.ts +12 -10
- package/scripts/upgrade.ts +12 -13
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +82 -338
- package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/src/bean/ssrSite.admin.ts +2 -2
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/package.json +53 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/.metadata/index.ts +87 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/.metadata/this.ts +2 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/bean/ssrMenu.home.ts +26 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/bean/ssrSite.web.ts +26 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/config/locale/en-us.ts +3 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/config/locale/zh-cn.ts +3 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/src/index.ts +2 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/tsconfig.build.json +11 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/tsconfig.json +7 -0
- package/vona/src/suite/cabloy-basic/package.json +1 -0
- package/vona/src/suite/cabloy-basic/tsconfig.json +3 -0
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/types/ssrMenu.ts +0 -13
- package/vona/src/suite-vendor/a-cabloy/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-menu/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-menu/src/types/menu.ts +12 -2
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/env/.env +1 -1
- package/zova/env/.env.cabloyBasicWeb +1 -1
- package/zova/package.original.json +6 -1
- package/zova/pnpm-lock.yaml +42 -12
- package/zova/src/front/config/config/config.cabloyBasicAdmin.ts +14 -0
- package/zova/src/front/config/config/config.cabloyBasicWeb.ts +17 -0
- package/zova/src/front/config/config/config.ts +3 -3
- package/zova/src/suite/a-demo/modules/demo-basic/package.json +1 -14
- package/zova/src/suite/a-demo/modules/demo-basic/src/.metadata/index.ts +0 -50
- package/zova/src/suite/a-home/modules/home-base/src/.metadata/index.ts +17 -2
- package/zova/src/suite/a-home/modules/home-base/src/config/locale/en-us.ts +2 -0
- package/zova/src/suite/a-home/modules/home-base/src/config/locale/zh-cn.ts +2 -0
- package/zova/src/suite/a-home/modules/home-base/src/lib/utils.ts +13 -1
- package/zova/src/suite/a-home/modules/home-base/src/service/locale.ts +11 -0
- package/zova/src/suite/a-home/modules/home-base/src/service/routerGuards.ts +13 -0
- package/zova/src/suite/a-home/modules/{home-index → home-indexadmin}/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexadmin/src/.metadata/index.ts +75 -0
- package/zova/src/suite/a-home/modules/home-indexadmin/src/.metadata/page/dashboard.ts +9 -0
- package/zova/src/suite/a-home/modules/home-indexadmin/src/.metadata/this.ts +2 -0
- package/zova/src/suite/a-home/modules/home-indexadmin/src/page/dashboard/controller.tsx +23 -0
- package/zova/src/suite/a-home/modules/home-indexadmin/src/routes.ts +8 -0
- package/zova/src/suite/a-home/modules/home-indexweb/package.json +52 -0
- package/zova/src/suite/a-home/modules/{home-index → home-indexweb}/src/.metadata/index.ts +9 -9
- package/zova/src/suite/a-home/modules/home-indexweb/src/.metadata/this.ts +2 -0
- package/zova/src/suite/a-home/modules/home-indexweb/src/index.ts +1 -0
- package/zova/src/suite/a-home/modules/{home-index → home-indexweb}/src/page/home/controller.tsx +2 -0
- package/zova/src/suite/a-home/modules/home-indexweb/src/routes.ts +15 -0
- package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutadmin}/package.json +2 -2
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/.metadata/component/layoutAdmin.ts +44 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/.metadata/index.ts +249 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/.metadata/locales.ts +22 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/.metadata/this.ts +2 -0
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/controller.tsx +6 -3
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.content.tsx +14 -0
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.header.tsx +2 -2
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.locale.tsx +10 -19
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.sidebar.tsx +2 -2
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.tabs.tsx +33 -29
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.theme.tsx +19 -12
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.tsx +1 -1
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.user.tsx +3 -1
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/style.ts +1 -1
- package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutadmin}/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutadmin}/src/config/locale/zh-cn.ts +1 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/tsconfig.build.json +13 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/tsconfig.json +5 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/package.json +52 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/component/layoutWeb.ts +39 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/index.ts +200 -0
- package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutweb}/src/.metadata/locales.ts +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/this.ts +2 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/controller.tsx +112 -0
- package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutweb/src/component/layoutWeb}/render.content.tsx +2 -2
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.header.tsx +39 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.locale.tsx +50 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tabs.tsx +95 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.theme.tsx +98 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tsx +39 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/config/config.ts +20 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/config/locale/en-us.ts +10 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/config/locale/zh-cn.ts +10 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/index.ts +2 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/model/layout.ts +27 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/src/model/menu.ts +115 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/tsconfig.build.json +13 -0
- package/zova/src/suite/a-home/modules/home-layoutweb/tsconfig.json +5 -0
- package/zova/src/suite/a-home/modules/home-passport/src/model/passport.ts +1 -1
- package/zova/src/suite/a-home/package.json +4 -2
- package/zova/src/suite/a-demo/modules/demo-basic/src/bean/aop.home.tsx +0 -23
- package/zova/src/suite/a-demo/modules/demo-basic/src/bean/aop.home3.tsx +0 -14
- package/zova/src/suite/a-home/modules/home-index/src/.metadata/this.ts +0 -2
- package/zova/src/suite/a-home/modules/home-index/src/routes.ts +0 -8
- package/zova/src/suite/a-home/modules/home-layouttabs/src/.metadata/component/layoutTabs.ts +0 -44
- package/zova/src/suite/a-home/modules/home-layouttabs/src/.metadata/index.ts +0 -249
- package/zova/src/suite/a-home/modules/home-layouttabs/src/.metadata/this.ts +0 -2
- /package/zova/src/suite/a-home/modules/{home-index → home-indexadmin}/src/index.ts +0 -0
- /package/zova/src/suite/a-home/modules/{home-index → home-indexadmin}/tsconfig.build.json +0 -0
- /package/zova/src/suite/a-home/modules/{home-index → home-indexadmin}/tsconfig.json +0 -0
- /package/zova/src/suite/a-home/modules/{home-index → home-indexweb}/src/.metadata/page/home.ts +0 -0
- /package/zova/src/suite/a-home/modules/{home-layouttabs → home-indexweb}/tsconfig.build.json +0 -0
- /package/zova/src/suite/a-home/modules/{home-layouttabs → home-indexweb}/tsconfig.json +0 -0
- /package/zova/src/suite/a-home/modules/{home-layouttabs/src/component/layoutTabs → home-layoutadmin/src/component/layoutAdmin}/render.menu.tsx +0 -0
- /package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutadmin}/src/config/config.ts +0 -0
- /package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutadmin}/src/index.ts +0 -0
- /package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutadmin}/src/model/layout.ts +0 -0
- /package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutadmin}/src/model/menu.ts +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerLayoutWebProps } from '../../component/layoutWeb/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerLayoutWeb } from '../../component/layoutWeb/controller.jsx';
|
|
9
|
+
import { RenderLayoutWeb } from '../../component/layoutWeb/render.jsx';
|
|
10
|
+
export type ZLayoutWebProps = {
|
|
11
|
+
controllerRef?: (ref: ControllerLayoutWeb) => void;
|
|
12
|
+
} & ControllerLayoutWebProps;
|
|
13
|
+
|
|
14
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
15
|
+
ControllerLayoutWebProps,
|
|
16
|
+
keyof typeof ControllerLayoutWeb.$propsDefault
|
|
17
|
+
>;
|
|
18
|
+
declare module 'zova-module-home-layoutweb' {
|
|
19
|
+
export interface ControllerLayoutWeb {
|
|
20
|
+
$props: ControllerInnerProps;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
declare module 'zova-module-home-layoutweb' {
|
|
24
|
+
export interface RenderLayoutWeb extends ControllerLayoutWeb {}
|
|
25
|
+
export interface RenderContent extends ControllerLayoutWeb {}
|
|
26
|
+
export interface RenderHeader extends ControllerLayoutWeb {}
|
|
27
|
+
export interface RenderLocale extends ControllerLayoutWeb {}
|
|
28
|
+
export interface RenderTabs extends ControllerLayoutWeb {}
|
|
29
|
+
export interface RenderTheme extends ControllerLayoutWeb {}
|
|
30
|
+
}
|
|
31
|
+
export const ZLayoutWeb = defineComponent((_props: ZLayoutWebProps) => {
|
|
32
|
+
useController(ControllerLayoutWeb, RenderLayoutWeb, undefined);
|
|
33
|
+
return () => {};
|
|
34
|
+
}, prepareComponentOptions());
|
|
35
|
+
declare module 'zova-module-a-bean' {
|
|
36
|
+
export interface IVonaComponentRecord {
|
|
37
|
+
'home-layoutweb:layoutWeb': ControllerLayoutWebProps;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
/** model: begin */
|
|
3
|
+
export * from '../model/layout.js';
|
|
4
|
+
export * from '../model/menu.js';
|
|
5
|
+
import { IModelOptionsLayout } from '../model/layout.js';
|
|
6
|
+
import { IModelOptionsMenu } from '../model/menu.js';
|
|
7
|
+
import 'zova-module-a-model';
|
|
8
|
+
declare module 'zova-module-a-model' {
|
|
9
|
+
|
|
10
|
+
export interface IModelRecord {
|
|
11
|
+
'home-layoutweb:layout': IModelOptionsLayout;
|
|
12
|
+
'home-layoutweb:menu': IModelOptionsMenu;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
declare module 'zova-module-home-layoutweb' {
|
|
18
|
+
|
|
19
|
+
export interface ModelLayout {
|
|
20
|
+
/** @internal */
|
|
21
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ModelLayout {
|
|
25
|
+
get $beanFullName(): 'home-layoutweb.model.layout';
|
|
26
|
+
get $onionName(): 'home-layoutweb:layout';
|
|
27
|
+
get $onionOptions(): IModelOptionsLayout;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ModelMenu {
|
|
31
|
+
/** @internal */
|
|
32
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ModelMenu {
|
|
36
|
+
get $beanFullName(): 'home-layoutweb.model.menu';
|
|
37
|
+
get $onionName(): 'home-layoutweb:menu';
|
|
38
|
+
get $onionOptions(): IModelOptionsMenu;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** model: end */
|
|
42
|
+
/** model: begin */
|
|
43
|
+
import { ModelLayout } from '../model/layout.js';
|
|
44
|
+
import { ModelMenu } from '../model/menu.js';
|
|
45
|
+
import 'zova';
|
|
46
|
+
declare module 'zova' {
|
|
47
|
+
export interface IBeanRecordGeneral {
|
|
48
|
+
'home-layoutweb.model.layout': ModelLayout;
|
|
49
|
+
'home-layoutweb.model.menu': ModelMenu;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** model: end */
|
|
53
|
+
/** controller: begin */
|
|
54
|
+
export * from '../component/layoutWeb/controller.jsx';
|
|
55
|
+
|
|
56
|
+
import 'zova';
|
|
57
|
+
declare module 'zova' {
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
declare module 'zova-module-home-layoutweb' {
|
|
62
|
+
|
|
63
|
+
export interface ControllerLayoutWeb {
|
|
64
|
+
/** @internal */
|
|
65
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** controller: end */
|
|
69
|
+
/** controller: begin */
|
|
70
|
+
import { ControllerLayoutWeb } from '../component/layoutWeb/controller.jsx';
|
|
71
|
+
import 'zova';
|
|
72
|
+
declare module 'zova' {
|
|
73
|
+
export interface IBeanRecordLocal {
|
|
74
|
+
'home-layoutweb.controller.layoutWeb': ControllerLayoutWeb;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** controller: end */
|
|
78
|
+
|
|
79
|
+
/** components: begin */
|
|
80
|
+
export * from './component/layoutWeb.js';
|
|
81
|
+
import { ZLayoutWeb } from './component/layoutWeb.js';
|
|
82
|
+
export const components = {
|
|
83
|
+
'layoutWeb': ZLayoutWeb,
|
|
84
|
+
};
|
|
85
|
+
import 'zova';
|
|
86
|
+
declare module 'zova' {
|
|
87
|
+
export interface IComponentRecord {
|
|
88
|
+
'home-layoutweb:layoutWeb': ControllerLayoutWeb;
|
|
89
|
+
}
|
|
90
|
+
export interface IZovaComponentRecord {
|
|
91
|
+
'home-layoutweb:layoutWeb': typeof ZLayoutWeb;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** components: end */
|
|
95
|
+
/** render: begin */
|
|
96
|
+
export * from '../component/layoutWeb/render.content.jsx';
|
|
97
|
+
export * from '../component/layoutWeb/render.header.jsx';
|
|
98
|
+
export * from '../component/layoutWeb/render.locale.jsx';
|
|
99
|
+
export * from '../component/layoutWeb/render.tabs.jsx';
|
|
100
|
+
export * from '../component/layoutWeb/render.theme.jsx';
|
|
101
|
+
export * from '../component/layoutWeb/render.jsx';
|
|
102
|
+
|
|
103
|
+
import 'zova';
|
|
104
|
+
declare module 'zova' {
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
declare module 'zova-module-home-layoutweb' {
|
|
109
|
+
|
|
110
|
+
export interface RenderContent {
|
|
111
|
+
/** @internal */
|
|
112
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface RenderHeader {
|
|
116
|
+
/** @internal */
|
|
117
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface RenderLocale {
|
|
121
|
+
/** @internal */
|
|
122
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface RenderTabs {
|
|
126
|
+
/** @internal */
|
|
127
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface RenderTheme {
|
|
131
|
+
/** @internal */
|
|
132
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface RenderLayoutWeb {
|
|
136
|
+
/** @internal */
|
|
137
|
+
get scope(): ScopeModuleHomeLayoutweb;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/** render: end */
|
|
141
|
+
/** render: begin */
|
|
142
|
+
import { RenderContent } from '../component/layoutWeb/render.content.jsx';
|
|
143
|
+
import { RenderHeader } from '../component/layoutWeb/render.header.jsx';
|
|
144
|
+
import { RenderLocale } from '../component/layoutWeb/render.locale.jsx';
|
|
145
|
+
import { RenderTabs } from '../component/layoutWeb/render.tabs.jsx';
|
|
146
|
+
import { RenderTheme } from '../component/layoutWeb/render.theme.jsx';
|
|
147
|
+
import { RenderLayoutWeb } from '../component/layoutWeb/render.jsx';
|
|
148
|
+
import 'zova';
|
|
149
|
+
declare module 'zova' {
|
|
150
|
+
export interface IBeanRecordLocal {
|
|
151
|
+
'home-layoutweb.render.content': RenderContent;
|
|
152
|
+
'home-layoutweb.render.header': RenderHeader;
|
|
153
|
+
'home-layoutweb.render.locale': RenderLocale;
|
|
154
|
+
'home-layoutweb.render.tabs': RenderTabs;
|
|
155
|
+
'home-layoutweb.render.theme': RenderTheme;
|
|
156
|
+
'home-layoutweb.render.layoutWeb': RenderLayoutWeb;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/** render: end */
|
|
160
|
+
/** config: begin */
|
|
161
|
+
export * from '../config/config.js';
|
|
162
|
+
import { config } from '../config/config.js';
|
|
163
|
+
/** config: end */
|
|
164
|
+
/** locale: begin */
|
|
165
|
+
import { locales } from './locales.js';
|
|
166
|
+
/** locale: end */
|
|
167
|
+
/** scope: begin */
|
|
168
|
+
import { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig, TypeModuleLocales, TypeLocaleBase } from 'zova';
|
|
169
|
+
import { Scope } from 'zova-module-a-bean';
|
|
170
|
+
|
|
171
|
+
@Scope()
|
|
172
|
+
export class ScopeModuleHomeLayoutweb extends BeanScopeBase {}
|
|
173
|
+
|
|
174
|
+
export interface ScopeModuleHomeLayoutweb {
|
|
175
|
+
util: BeanScopeUtil;
|
|
176
|
+
config: TypeModuleConfig<typeof config>;
|
|
177
|
+
locale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
import 'zova';
|
|
181
|
+
declare module 'zova' {
|
|
182
|
+
export interface IBeanScopeRecord {
|
|
183
|
+
'home-layoutweb': ScopeModuleHomeLayoutweb;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface IBeanScopeConfig {
|
|
187
|
+
'home-layoutweb': ReturnType<typeof config>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface IBeanScopeLocale {
|
|
191
|
+
'home-layoutweb': (typeof locales)[TypeLocaleBase];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): `home-layoutweb::${K}` {
|
|
198
|
+
return `home-layoutweb::${key}`;
|
|
199
|
+
}
|
|
200
|
+
/** scope: end */
|
package/zova/src/suite/a-home/modules/{home-layouttabs → home-layoutweb}/src/.metadata/locales.ts
RENAMED
|
@@ -15,7 +15,7 @@ export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(
|
|
|
15
15
|
...args: any[]
|
|
16
16
|
) {
|
|
17
17
|
const app = useApp();
|
|
18
|
-
const str = `home-
|
|
18
|
+
const str = `home-layoutweb::${key}`;
|
|
19
19
|
return useComputed(() => {
|
|
20
20
|
return app.meta.text(str, ...args);
|
|
21
21
|
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { BeanControllerBase, Use, useComputed, UseScope } from 'zova';
|
|
2
|
+
import { Controller } from 'zova-module-a-bean';
|
|
3
|
+
import { $QueryAutoLoad } from 'zova-module-a-model';
|
|
4
|
+
import { ModelTabs, ModelTabsOptions, RouteTabInitial } from 'zova-module-a-routertabs';
|
|
5
|
+
import { ScopeModuleASsr } from 'zova-module-a-ssr';
|
|
6
|
+
import { IServiceSsrLayoutOptions, ServiceLocale, ServiceSsrLayout } from 'zova-module-home-base';
|
|
7
|
+
|
|
8
|
+
import { ModelLayout } from '../../model/layout.js';
|
|
9
|
+
import { ModelMenu } from '../../model/menu.js';
|
|
10
|
+
|
|
11
|
+
export interface ControllerLayoutWebProps {}
|
|
12
|
+
|
|
13
|
+
@Controller()
|
|
14
|
+
export class ControllerLayoutWeb extends BeanControllerBase {
|
|
15
|
+
static $propsDefault = {};
|
|
16
|
+
|
|
17
|
+
$$modelTabs: ModelTabs;
|
|
18
|
+
|
|
19
|
+
@Use()
|
|
20
|
+
$$modelMenu: ModelMenu;
|
|
21
|
+
|
|
22
|
+
@Use()
|
|
23
|
+
$$modelLayout: ModelLayout;
|
|
24
|
+
|
|
25
|
+
@UseScope()
|
|
26
|
+
$$scopeSsr: ScopeModuleASsr;
|
|
27
|
+
|
|
28
|
+
@Use({ init: { arg: { sidebarLeftOpenPC: false } as IServiceSsrLayoutOptions } })
|
|
29
|
+
$$serviceSsrLayout: ServiceSsrLayout;
|
|
30
|
+
|
|
31
|
+
@Use()
|
|
32
|
+
$$serviceLocale: ServiceLocale;
|
|
33
|
+
|
|
34
|
+
leftDrawerOpen: boolean;
|
|
35
|
+
leftDrawerOpenMobile: boolean = false;
|
|
36
|
+
belowBreakpoint: boolean;
|
|
37
|
+
|
|
38
|
+
protected async __init__() {
|
|
39
|
+
// belowBreakpoint
|
|
40
|
+
this.belowBreakpoint = useComputed(() => {
|
|
41
|
+
let width;
|
|
42
|
+
if (process.env.SERVER) {
|
|
43
|
+
width = 0;
|
|
44
|
+
} else {
|
|
45
|
+
width = document.documentElement.clientWidth;
|
|
46
|
+
}
|
|
47
|
+
return width <= this.sys.config.layout.sidebar.breakpoint;
|
|
48
|
+
});
|
|
49
|
+
// leftDrawerOpen
|
|
50
|
+
this.leftDrawerOpen = this.$customRef(() => {
|
|
51
|
+
const self = this;
|
|
52
|
+
return {
|
|
53
|
+
get() {
|
|
54
|
+
return self.belowBreakpoint
|
|
55
|
+
? self.leftDrawerOpenMobile
|
|
56
|
+
: self.$$modelLayout.leftDrawerOpenPC;
|
|
57
|
+
},
|
|
58
|
+
set(value) {
|
|
59
|
+
if (self.belowBreakpoint) {
|
|
60
|
+
self.leftDrawerOpenMobile = value;
|
|
61
|
+
} else {
|
|
62
|
+
self.$$modelLayout.leftDrawerOpenPC = value;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
// menu
|
|
68
|
+
await $QueryAutoLoad(() => this.$$modelMenu.retrieveMenus());
|
|
69
|
+
// tabs
|
|
70
|
+
await this._initTabs();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private async _initTabs() {
|
|
74
|
+
const configTabs = this.scope.config.tabs;
|
|
75
|
+
const tabsOptions: ModelTabsOptions = {
|
|
76
|
+
max: configTabs.max,
|
|
77
|
+
maxItems: configTabs.maxItems,
|
|
78
|
+
cache: configTabs.cache,
|
|
79
|
+
getInitialTabs: () => {
|
|
80
|
+
return this._getInitialTabs();
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
this.$$modelTabs = await this.bean._getBeanSelector(
|
|
84
|
+
'a-routertabs.model.tabs',
|
|
85
|
+
true,
|
|
86
|
+
configTabs.scene,
|
|
87
|
+
tabsOptions,
|
|
88
|
+
);
|
|
89
|
+
// watch menus
|
|
90
|
+
this.$watch(
|
|
91
|
+
() => {
|
|
92
|
+
return this.$$modelMenu.retrieveMenus().data;
|
|
93
|
+
},
|
|
94
|
+
() => {
|
|
95
|
+
this.$$modelTabs.updateAllTabInfos(this._getInitialTabs());
|
|
96
|
+
},
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private _getInitialTabs() {
|
|
101
|
+
return this.$$modelMenu.menuTree?.map(item => {
|
|
102
|
+
return {
|
|
103
|
+
tabKey: item.folder ? item.name : item.link,
|
|
104
|
+
info: item,
|
|
105
|
+
} as RouteTabInitial;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
toggleLeftDrawer() {
|
|
110
|
+
this.leftDrawerOpen = !this.leftDrawerOpen;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BeanRenderBase, Use } from 'zova';
|
|
2
2
|
import { Render } from 'zova-module-a-bean';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { RenderLayoutWeb } from './render.jsx';
|
|
5
5
|
|
|
6
6
|
@Render()
|
|
7
7
|
export class RenderContent extends BeanRenderBase {
|
|
8
8
|
@Use()
|
|
9
|
-
$$r:
|
|
9
|
+
$$r: RenderLayoutWeb;
|
|
10
10
|
|
|
11
11
|
public render() {
|
|
12
12
|
return this.$$r.$$renderTabs._renderRouterViewTabs();
|
package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.header.tsx
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BeanRenderBase, Use } from 'zova';
|
|
2
|
+
import { Render } from 'zova-module-a-bean';
|
|
3
|
+
import { ZIcon } from 'zova-module-a-icon';
|
|
4
|
+
|
|
5
|
+
import type { RenderLayoutWeb } from './render.jsx';
|
|
6
|
+
|
|
7
|
+
@Render()
|
|
8
|
+
export class RenderHeader extends BeanRenderBase {
|
|
9
|
+
@Use()
|
|
10
|
+
$$r: RenderLayoutWeb;
|
|
11
|
+
|
|
12
|
+
public render() {
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<div class="navbar bg-base-300 w-full">
|
|
16
|
+
<div class="flex-none">
|
|
17
|
+
<button
|
|
18
|
+
class="btn btn-square btn-ghost"
|
|
19
|
+
onClick={() => {
|
|
20
|
+
this.app.$gotoHome();
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<ZIcon name=":social:cabloy" width={24}></ZIcon>
|
|
24
|
+
</button>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="text-xl px-4">{this.sys.env.APP_TITLE}</div>
|
|
27
|
+
<div class="mx-2 flex-2 px-2">{this.$$r.$$renderTabs.renderTabs()}</div>
|
|
28
|
+
<div class="hidden flex-none lg:block">
|
|
29
|
+
<ul class="menu menu-horizontal">
|
|
30
|
+
{this.$$r.$$renderLocale.render()}
|
|
31
|
+
{this.$$r.$$renderTheme.renderThemeDark()}
|
|
32
|
+
{this.sys.config.ssr.cookie && this.$$r.$$renderTheme.renderThemeName()}
|
|
33
|
+
</ul>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.locale.tsx
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BeanRenderBase, ClientOnly } from 'zova';
|
|
2
|
+
import { Render } from 'zova-module-a-bean';
|
|
3
|
+
import { $icon } from 'zova-module-a-icon';
|
|
4
|
+
import { closeNearestDetails } from 'zova-module-home-base';
|
|
5
|
+
|
|
6
|
+
@Render()
|
|
7
|
+
export class RenderLocale extends BeanRenderBase {
|
|
8
|
+
public render() {
|
|
9
|
+
const currentRoute = this.$currentRoute;
|
|
10
|
+
const metaLocale = currentRoute?.meta?.locale;
|
|
11
|
+
const locales = currentRoute?.meta?.locales ?? this.sys.config.locale.items;
|
|
12
|
+
return (
|
|
13
|
+
<li>
|
|
14
|
+
<details>
|
|
15
|
+
<summary>{$icon('::language', 24)}</summary>
|
|
16
|
+
<ClientOnly>
|
|
17
|
+
<ul class="bg-base-100 rounded-t-none p-2 w-48">
|
|
18
|
+
{Object.keys(locales).map(key => {
|
|
19
|
+
const title = this.$scopeBase.locale[locales[key]]();
|
|
20
|
+
return (
|
|
21
|
+
<li key={key} class={this.app.meta.locale.current === key ? 'disabled' : ''}>
|
|
22
|
+
<a
|
|
23
|
+
onClick={event => {
|
|
24
|
+
if (metaLocale) {
|
|
25
|
+
const fullPath = this.$router.resolveName(currentRoute.name as any, {
|
|
26
|
+
params: Object.assign({}, currentRoute.params, {
|
|
27
|
+
locale: key === this.sys.config.locale.default ? '' : key,
|
|
28
|
+
}),
|
|
29
|
+
query: currentRoute.query,
|
|
30
|
+
});
|
|
31
|
+
this.$router.push(fullPath);
|
|
32
|
+
} else {
|
|
33
|
+
this.$$serviceLocale.setLocale(key as any);
|
|
34
|
+
}
|
|
35
|
+
closeNearestDetails(event);
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
{$icon(this.app.meta.locale.current === key ? '::done' : '::none', 24)}
|
|
39
|
+
{title}
|
|
40
|
+
</a>
|
|
41
|
+
</li>
|
|
42
|
+
);
|
|
43
|
+
})}
|
|
44
|
+
</ul>
|
|
45
|
+
</ClientOnly>
|
|
46
|
+
</details>
|
|
47
|
+
</li>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { RouteTab } from 'zova-module-a-routertabs';
|
|
3
|
+
|
|
4
|
+
import { BeanRenderBase, ClientOnly } from 'zova';
|
|
5
|
+
import { Render } from 'zova-module-a-bean';
|
|
6
|
+
import { $iconName, ZIcon } from 'zova-module-a-icon';
|
|
7
|
+
import { ZRouterViewTabs } from 'zova-module-a-routertabs';
|
|
8
|
+
import { closeNearestDetails, ZItemLink } from 'zova-module-home-base';
|
|
9
|
+
|
|
10
|
+
@Render()
|
|
11
|
+
export class RenderTabs extends BeanRenderBase {
|
|
12
|
+
public renderTabs(): VNode | undefined {
|
|
13
|
+
const $$modelTabs = this.$$modelTabs;
|
|
14
|
+
if (!$$modelTabs) return;
|
|
15
|
+
|
|
16
|
+
const domTabs = $$modelTabs.tabs.map(tab => this._renderTab(tab));
|
|
17
|
+
const domWrapper = (
|
|
18
|
+
<div role="tablist" class="tabs tabs-lifted">
|
|
19
|
+
{domTabs}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
if (!$$modelTabs.cache) return domWrapper;
|
|
23
|
+
|
|
24
|
+
return <ClientOnly>{domWrapper}</ClientOnly>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private _renderTab(tab: RouteTab): VNode {
|
|
28
|
+
const $$modelTabs = this.$$modelTabs;
|
|
29
|
+
const { tabKey, info } = tab;
|
|
30
|
+
const titleLocale = this.$text(info?.title || '');
|
|
31
|
+
const tabIcon = this.getTabIcon(tab);
|
|
32
|
+
if (info.folder) {
|
|
33
|
+
return (
|
|
34
|
+
<li>
|
|
35
|
+
<details>
|
|
36
|
+
<summary>
|
|
37
|
+
{!!tabIcon && <ZIcon name={tabIcon as any} width="24"></ZIcon>}
|
|
38
|
+
{titleLocale}
|
|
39
|
+
</summary>
|
|
40
|
+
<ClientOnly>
|
|
41
|
+
<ul class="bg-base-100 rounded-t-none p-2 w-48">
|
|
42
|
+
{info.children?.map(item => (
|
|
43
|
+
<li key={item.link} onClick={closeNearestDetails}>
|
|
44
|
+
<ZItemLink
|
|
45
|
+
title={item.title!}
|
|
46
|
+
icon={(item.icon as any) ?? $iconName('::none')}
|
|
47
|
+
href={item.link && item.external ? item.link : undefined}
|
|
48
|
+
to={item.link && !item.external ? item.link : undefined}
|
|
49
|
+
></ZItemLink>
|
|
50
|
+
</li>
|
|
51
|
+
))}
|
|
52
|
+
</ul>
|
|
53
|
+
</ClientOnly>
|
|
54
|
+
</details>
|
|
55
|
+
</li>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
// not external
|
|
59
|
+
if (!info.external) {
|
|
60
|
+
const className = tabKey === $$modelTabs.tabKeyCurrent ? 'text-primary' : '';
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<a
|
|
64
|
+
key={tabKey}
|
|
65
|
+
role="tab"
|
|
66
|
+
class={`tab ${className}`}
|
|
67
|
+
onClick={() => {
|
|
68
|
+
$$modelTabs.activeTab(tabKey);
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
{!!tabIcon && <ZIcon name={tabIcon as any} width="24"></ZIcon>}
|
|
72
|
+
{titleLocale}
|
|
73
|
+
</a>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
// external
|
|
77
|
+
return (
|
|
78
|
+
<ZItemLink
|
|
79
|
+
key={tabKey}
|
|
80
|
+
title={titleLocale}
|
|
81
|
+
icon={info.icon as any}
|
|
82
|
+
href={info.link}
|
|
83
|
+
></ZItemLink>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public getTabIcon(tab: RouteTab) {
|
|
88
|
+
const { info } = tab;
|
|
89
|
+
return info?.icon ? info?.icon : '';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
_renderRouterViewTabs() {
|
|
93
|
+
return <ZRouterViewTabs></ZRouterViewTabs>;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { IThemeRecord } from 'zova-module-a-style';
|
|
2
|
+
|
|
3
|
+
import { BeanRenderBase, ClientOnly } from 'zova';
|
|
4
|
+
import { Render } from 'zova-module-a-bean';
|
|
5
|
+
import { $icon } from 'zova-module-a-icon';
|
|
6
|
+
import { closeNearestDetails } from 'zova-module-home-base';
|
|
7
|
+
|
|
8
|
+
@Render()
|
|
9
|
+
export class RenderTheme extends BeanRenderBase {
|
|
10
|
+
renderThemeDark() {
|
|
11
|
+
const themes = [
|
|
12
|
+
{
|
|
13
|
+
mode: false,
|
|
14
|
+
title: this.scope.locale.ThemeLight(),
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
mode: true,
|
|
18
|
+
title: this.scope.locale.ThemeDark(),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
mode: 'auto',
|
|
22
|
+
title: this.scope.locale.ThemeAuto(),
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
return (
|
|
26
|
+
<li>
|
|
27
|
+
<details>
|
|
28
|
+
<summary>{$icon('::dark-theme', 24)}</summary>
|
|
29
|
+
<ClientOnly>
|
|
30
|
+
<ul class="bg-base-100 rounded-t-none p-2 w-48">
|
|
31
|
+
{themes.map(item => {
|
|
32
|
+
return (
|
|
33
|
+
<li
|
|
34
|
+
key={item.mode.toString()}
|
|
35
|
+
class={this.$theme.darkMode === item.mode ? 'disabled' : ''}
|
|
36
|
+
>
|
|
37
|
+
<a
|
|
38
|
+
onClick={event => {
|
|
39
|
+
this.$theme.darkMode = item.mode as any;
|
|
40
|
+
closeNearestDetails(event);
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
{$icon(this.$theme.darkMode === item.mode ? '::done' : '::none', 24)}
|
|
44
|
+
{item.title}
|
|
45
|
+
</a>
|
|
46
|
+
</li>
|
|
47
|
+
);
|
|
48
|
+
})}
|
|
49
|
+
</ul>
|
|
50
|
+
</ClientOnly>
|
|
51
|
+
</details>
|
|
52
|
+
</li>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
renderThemeName() {
|
|
57
|
+
const themes = this.getThemeNames();
|
|
58
|
+
return (
|
|
59
|
+
<li>
|
|
60
|
+
<details>
|
|
61
|
+
<summary>{$icon(':outline:theme-outline', 24)}</summary>
|
|
62
|
+
<ClientOnly>
|
|
63
|
+
<ul class="bg-base-100 rounded-t-none p-2 w-48">
|
|
64
|
+
{themes.map(item => {
|
|
65
|
+
return (
|
|
66
|
+
<li key={item.name} class={this.$theme.name === item.name ? 'disabled' : ''}>
|
|
67
|
+
<a
|
|
68
|
+
onClick={event => {
|
|
69
|
+
this.$theme.name = item.name as keyof IThemeRecord;
|
|
70
|
+
closeNearestDetails(event);
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
{$icon(this.$theme.name === item.name ? '::done' : '::none', 24)}
|
|
74
|
+
{item.title}
|
|
75
|
+
</a>
|
|
76
|
+
</li>
|
|
77
|
+
);
|
|
78
|
+
})}
|
|
79
|
+
</ul>
|
|
80
|
+
</ClientOnly>
|
|
81
|
+
</details>
|
|
82
|
+
</li>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
getThemeNames() {
|
|
87
|
+
return [
|
|
88
|
+
{
|
|
89
|
+
name: 'home-theme:orange' satisfies keyof IThemeRecord,
|
|
90
|
+
title: this.scope.locale.ThemeOrange(),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'home-theme:default' satisfies keyof IThemeRecord,
|
|
94
|
+
title: this.scope.locale.ThemeBlue(),
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
}
|