zova-module-a-style 5.0.14 → 5.0.15
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-style",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.15",
|
|
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": "4694913185e21d7ff9f241cb7fc949dde41cf6fd"
|
|
38
38
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BeanBase, Cast, IBeanRecord
|
|
1
|
+
import { Bean, BeanBase, Cast, IBeanRecord } from 'zova';
|
|
2
2
|
import { ScopeModule } from '../resource/this.js';
|
|
3
3
|
import { ThemeBase, ThemeHandler } from '../types.js';
|
|
4
4
|
|
|
5
5
|
export type ThemeDarkMode = 'auto' | boolean;
|
|
6
6
|
|
|
7
|
-
@
|
|
8
|
-
export class
|
|
7
|
+
@Bean({ containerScope: 'app' })
|
|
8
|
+
export class BeanTheme extends BeanBase<ScopeModule> {
|
|
9
9
|
private _name: string;
|
|
10
10
|
public get name(): string {
|
|
11
11
|
return this._name;
|
package/src/monkey.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { style } from 'typestyle';
|
|
2
2
|
import { BeanBase, BeanContainer, BeanSimple, IMonkeySystem, SymbolModuleName, useComputed } from 'zova';
|
|
3
3
|
import { ScopeModule, __ThisModule__ } from './resource/this.js';
|
|
4
|
-
import {
|
|
4
|
+
import { BeanTheme } from './bean/bean.theme.js';
|
|
5
5
|
|
|
6
6
|
export class Monkey extends BeanSimple implements IMonkeySystem {
|
|
7
|
-
private
|
|
8
|
-
private
|
|
7
|
+
private _beanTheme: BeanTheme;
|
|
8
|
+
private _beanStyleDefault: any;
|
|
9
9
|
|
|
10
10
|
async appInitialize(bean: BeanContainer) {
|
|
11
11
|
// theme
|
|
12
|
-
this.
|
|
12
|
+
this._beanTheme = await bean._getBean(BeanTheme, true);
|
|
13
13
|
// style default
|
|
14
14
|
const scope: ScopeModule = await bean.getScope(__ThisModule__);
|
|
15
|
-
this.
|
|
15
|
+
this._beanStyleDefault = await bean._getBean(scope.config.defaultStyle, true);
|
|
16
16
|
}
|
|
17
17
|
async appInitialized(_bean: BeanContainer) {}
|
|
18
18
|
async beanInit(bean: BeanContainer, beanInstance: BeanBase) {
|
|
@@ -30,21 +30,21 @@ export class Monkey extends BeanSimple implements IMonkeySystem {
|
|
|
30
30
|
enumerable: false,
|
|
31
31
|
configurable: true,
|
|
32
32
|
get() {
|
|
33
|
-
return self.
|
|
33
|
+
return self._beanStyleDefault;
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
36
|
bean.defineProperty(beanInstance, '$theme', {
|
|
37
37
|
enumerable: false,
|
|
38
38
|
configurable: true,
|
|
39
39
|
get() {
|
|
40
|
-
return self.
|
|
40
|
+
return self._beanTheme;
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
bean.defineProperty(beanInstance, '$token', {
|
|
44
44
|
enumerable: false,
|
|
45
45
|
configurable: true,
|
|
46
46
|
get() {
|
|
47
|
-
return useComputed(() => self.
|
|
47
|
+
return useComputed(() => self._beanTheme.token);
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
}
|
package/src/resource/beans.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from '../bean/
|
|
2
|
-
import {
|
|
1
|
+
export * from '../bean/bean.theme.js';
|
|
2
|
+
import { BeanTheme } from '../bean/bean.theme.js';
|
|
3
3
|
import 'zova';
|
|
4
4
|
declare module 'zova' {
|
|
5
5
|
export interface IBeanRecord {
|
|
6
|
-
'a-style.
|
|
6
|
+
'a-style.bean.theme': BeanTheme;
|
|
7
7
|
}
|
|
8
8
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { style } from 'typestyle';
|
|
2
2
|
import 'zova';
|
|
3
|
-
import {
|
|
3
|
+
import { BeanTheme } from './bean/bean.theme.js';
|
|
4
4
|
import { IBeanRecord } from 'zova';
|
|
5
5
|
declare module 'zova' {
|
|
6
6
|
export interface BeanBase {
|
|
7
7
|
$style: typeof style;
|
|
8
|
-
$theme:
|
|
8
|
+
$theme: BeanTheme;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|