zova-module-a-style 5.0.9 → 5.0.12
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/package.json +2 -2
- package/src/api/index.ts +2 -0
- package/src/api/interface/index.ts +1 -0
- package/src/api/service/index.ts +1 -0
- package/src/bean/store.theme.ts +1 -1
- package/src/index.ts +1 -0
- package/src/monkey.ts +2 -2
- package/src/resource/scope.ts +3 -1
- package/src/types.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-style",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.12",
|
|
4
4
|
"title": "a-style",
|
|
5
5
|
"zovaModule": {
|
|
6
6
|
"capabilities": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"tsc:publish": "npm run clean && tsc -b",
|
|
35
35
|
"prepublishOnly": "npm run tsc:publish"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "90bb78df182aa8db862d6b44e86d23aa33b195fa"
|
|
38
38
|
}
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const services = {};
|
package/src/bean/store.theme.ts
CHANGED
|
@@ -44,7 +44,7 @@ export class StoreTheme extends BeanBase<ScopeModule> {
|
|
|
44
44
|
this.token = Cast(res).token;
|
|
45
45
|
if (res.handler) {
|
|
46
46
|
const themeHandler = (await this.bean._getBean(res.handler, true)) as unknown as ThemeHandler;
|
|
47
|
-
await themeHandler.apply(
|
|
47
|
+
await themeHandler.apply({ name: this.name, dark: this.dark, token: this.token } as any);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
package/src/index.ts
CHANGED
package/src/monkey.ts
CHANGED
|
@@ -7,14 +7,14 @@ export class Monkey extends BeanSimple implements IMonkeySystem {
|
|
|
7
7
|
private _storeTheme: StoreTheme;
|
|
8
8
|
private _storeStyleDefault: any;
|
|
9
9
|
|
|
10
|
-
async appInitialize() {
|
|
10
|
+
async appInitialize(_bean: BeanContainerLike) {
|
|
11
11
|
// theme
|
|
12
12
|
this._storeTheme = await this.bean._getBean(StoreTheme, true);
|
|
13
13
|
// style default
|
|
14
14
|
const scope: ScopeModule = await this.bean.getScope(__ThisModule__);
|
|
15
15
|
this._storeStyleDefault = await this.bean._getBean(scope.config.defaultStyle, true);
|
|
16
16
|
}
|
|
17
|
-
async appInitialized() {}
|
|
17
|
+
async appInitialized(_bean: BeanContainerLike) {}
|
|
18
18
|
async beanInit(bean: BeanContainerLike, beanInstance: BeanBase) {
|
|
19
19
|
const self = this;
|
|
20
20
|
bean.defineProperty(beanInstance, '$style', {
|
package/src/resource/scope.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BeanScopeBase, Scope, TypeLocaleBase, TypeModuleResource } from 'zova';
|
|
2
2
|
import { config, Errors, locales, constants } from '../config/index.js';
|
|
3
3
|
import { components } from './components.js';
|
|
4
|
+
import { services } from '../api/service/index.js';
|
|
4
5
|
|
|
5
6
|
@Scope()
|
|
6
7
|
export class ScopeModuleAStyle extends BeanScopeBase {}
|
|
@@ -11,7 +12,8 @@ export interface ScopeModuleAStyle
|
|
|
11
12
|
typeof config,
|
|
12
13
|
typeof Errors,
|
|
13
14
|
(typeof locales)[TypeLocaleBase],
|
|
14
|
-
typeof constants
|
|
15
|
+
typeof constants,
|
|
16
|
+
typeof services
|
|
15
17
|
> {}
|
|
16
18
|
|
|
17
19
|
import 'zova';
|
package/src/types.ts
CHANGED
|
@@ -23,5 +23,10 @@ export interface ThemeBase {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface ThemeHandler {
|
|
26
|
-
apply(result:
|
|
26
|
+
apply(result: ThemeHandlerApplyParams): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ThemeHandlerApplyParams {
|
|
30
|
+
name: string;
|
|
31
|
+
dark: boolean;
|
|
27
32
|
}
|