render-core 1.3.12 → 1.3.14
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/class/controller/appController.d.ts +14 -9
- package/class/controller/appController.js +33 -31
- package/class/controller/contextController.d.ts +8 -14
- package/class/controller/contextController.js +28 -41
- package/class/controller/pageController.d.ts +9 -6
- package/class/controller/pageController.js +10 -12
- package/core/utility/styleUtility.d.ts +1 -0
- package/core/utility/styleUtility.js +18 -0
- package/func/Theme.d.ts +16 -0
- package/func/Theme.js +33 -0
- package/index.d.ts +9 -3
- package/index.js +15 -7
- package/package.json +1 -1
- package/runtime/tools.d.ts +3 -3
- package/runtime/tools.js +7 -3
- package/status/read/read.d.ts +2 -2
- package/status/read/read.js +2 -2
|
@@ -3,28 +3,33 @@ import { AppTip } from "../tips/appTip";
|
|
|
3
3
|
* This class is associated with localStorage.
|
|
4
4
|
*/
|
|
5
5
|
export declare class AppController implements AppTip {
|
|
6
|
-
private readonly
|
|
6
|
+
private readonly fields;
|
|
7
7
|
constructor();
|
|
8
8
|
/**
|
|
9
|
-
* This method is used to add
|
|
10
|
-
* @param
|
|
9
|
+
* This method is used to add custom data.
|
|
10
|
+
* @param fields
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
saveFields(fields: {}): void;
|
|
13
13
|
/**
|
|
14
14
|
* 更新数据
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
loadFields(): void;
|
|
18
18
|
/**
|
|
19
19
|
* store fields
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
storeFields(): void;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param field
|
|
25
|
+
* @param value
|
|
26
|
+
*/
|
|
27
|
+
setField(field: string, value: any): void;
|
|
23
28
|
/**
|
|
24
29
|
* 获取数据
|
|
25
|
-
* @param
|
|
30
|
+
* @param field
|
|
26
31
|
*/
|
|
27
|
-
|
|
32
|
+
getField(field: string): any;
|
|
28
33
|
/**
|
|
29
34
|
* 资源定向
|
|
30
35
|
* @param url
|
|
@@ -6,27 +6,24 @@ import { status_read, status_write } from "../../index";
|
|
|
6
6
|
var AppController = /** @class */ (function () {
|
|
7
7
|
//系统变量
|
|
8
8
|
function AppController() {
|
|
9
|
-
this.
|
|
9
|
+
this.fields = {
|
|
10
10
|
system_theme: {
|
|
11
11
|
data: "default",
|
|
12
|
-
react: true
|
|
13
|
-
callback: function (value, context) {
|
|
14
|
-
context.setFiled("system_theme", value);
|
|
15
|
-
}
|
|
12
|
+
react: true
|
|
16
13
|
}
|
|
17
14
|
};
|
|
18
15
|
}
|
|
19
16
|
/**
|
|
20
|
-
* This method is used to add
|
|
21
|
-
* @param
|
|
17
|
+
* This method is used to add custom data.
|
|
18
|
+
* @param fields
|
|
22
19
|
*/
|
|
23
|
-
AppController.prototype.
|
|
24
|
-
for (var
|
|
25
|
-
if (Reflect.has(this.
|
|
26
|
-
console.log("This filed is a
|
|
20
|
+
AppController.prototype.saveFields = function (fields) {
|
|
21
|
+
for (var fieldsKey in fields) {
|
|
22
|
+
if (Reflect.has(this.fields, fieldsKey)) {
|
|
23
|
+
console.log("This filed is a system filed, please have a new name for the filed:" + fieldsKey);
|
|
27
24
|
}
|
|
28
25
|
else {
|
|
29
|
-
Reflect.set(this.
|
|
26
|
+
Reflect.set(this.fields, fieldsKey, fields[fieldsKey]);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
};
|
|
@@ -34,17 +31,17 @@ var AppController = /** @class */ (function () {
|
|
|
34
31
|
* 更新数据
|
|
35
32
|
* @private
|
|
36
33
|
*/
|
|
37
|
-
AppController.prototype.
|
|
38
|
-
for (var
|
|
39
|
-
if (this.
|
|
34
|
+
AppController.prototype.loadFields = function () {
|
|
35
|
+
for (var fieldsKey in this.fields) {
|
|
36
|
+
if (this.fields[fieldsKey].react) {
|
|
40
37
|
if (status_read({
|
|
41
38
|
type: "local",
|
|
42
|
-
fields: [
|
|
43
|
-
})[
|
|
44
|
-
this.
|
|
39
|
+
fields: [fieldsKey]
|
|
40
|
+
})[fieldsKey]) {
|
|
41
|
+
this.fields[fieldsKey].data = status_read({
|
|
45
42
|
type: "local",
|
|
46
|
-
fields: [
|
|
47
|
-
})[
|
|
43
|
+
fields: [fieldsKey]
|
|
44
|
+
})[fieldsKey];
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
47
|
}
|
|
@@ -52,39 +49,44 @@ var AppController = /** @class */ (function () {
|
|
|
52
49
|
/**
|
|
53
50
|
* store fields
|
|
54
51
|
*/
|
|
55
|
-
AppController.prototype.
|
|
56
|
-
for (var
|
|
52
|
+
AppController.prototype.storeFields = function () {
|
|
53
|
+
for (var fieldsKey in this.fields) {
|
|
57
54
|
var data = {};
|
|
58
|
-
Reflect.set(data,
|
|
55
|
+
Reflect.set(data, fieldsKey, this.fields[fieldsKey]["data"]);
|
|
59
56
|
status_write({
|
|
60
57
|
type: "local",
|
|
61
58
|
fields: data
|
|
62
59
|
});
|
|
63
60
|
}
|
|
64
61
|
};
|
|
65
|
-
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
* @param field
|
|
65
|
+
* @param value
|
|
66
|
+
*/
|
|
67
|
+
AppController.prototype.setField = function (field, value) {
|
|
66
68
|
var data = {};
|
|
67
|
-
Reflect.set(data,
|
|
69
|
+
Reflect.set(data, field, value);
|
|
68
70
|
//写入数
|
|
69
71
|
status_write({
|
|
70
72
|
type: "local",
|
|
71
73
|
fields: data
|
|
72
74
|
});
|
|
73
75
|
//更新数据
|
|
74
|
-
this.
|
|
76
|
+
this.loadFields();
|
|
75
77
|
//执行回调
|
|
76
|
-
if (this.
|
|
78
|
+
if (this.fields[field].callback) {
|
|
77
79
|
// @ts-ignore
|
|
78
80
|
this.fileds[filed].callback(value, window.context);
|
|
79
81
|
}
|
|
80
82
|
};
|
|
81
83
|
/**
|
|
82
84
|
* 获取数据
|
|
83
|
-
* @param
|
|
85
|
+
* @param field
|
|
84
86
|
*/
|
|
85
|
-
AppController.prototype.
|
|
86
|
-
if (this.
|
|
87
|
-
return this.
|
|
87
|
+
AppController.prototype.getField = function (field) {
|
|
88
|
+
if (this.fields[field]) {
|
|
89
|
+
return this.fields[field].data;
|
|
88
90
|
}
|
|
89
91
|
else {
|
|
90
92
|
return null;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
export declare class ContextController {
|
|
2
|
-
private readonly
|
|
3
|
-
private meta;
|
|
2
|
+
private readonly fields;
|
|
4
3
|
constructor();
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
saveFields(fields: {}): void;
|
|
5
|
+
loadFields(): void;
|
|
6
|
+
storeFields(): void;
|
|
8
7
|
/**
|
|
9
8
|
* 写入数据
|
|
10
|
-
* @param
|
|
9
|
+
* @param field
|
|
11
10
|
* @param value
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
setField(field: string, value: any): void;
|
|
14
13
|
/**
|
|
15
14
|
* 获取数据
|
|
16
|
-
* @param
|
|
15
|
+
* @param field
|
|
17
16
|
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 返回系统数据
|
|
21
|
-
* @param filed
|
|
22
|
-
*/
|
|
23
|
-
getMeta(filed: string): string;
|
|
17
|
+
getField(field: string): any;
|
|
24
18
|
}
|
|
@@ -1,48 +1,42 @@
|
|
|
1
|
-
import { reloadStyle } from "../../core/utility/styleUtility";
|
|
2
|
-
import meta from "../../meta/meta";
|
|
3
1
|
import { status_read, status_write } from "../../index";
|
|
4
2
|
var ContextController = /** @class */ (function () {
|
|
5
3
|
function ContextController() {
|
|
6
|
-
this.
|
|
4
|
+
this.fields = {
|
|
7
5
|
system_theme: {
|
|
8
6
|
data: "default",
|
|
9
|
-
react: true
|
|
10
|
-
callback: function (value) {
|
|
11
|
-
reloadStyle(value);
|
|
12
|
-
}
|
|
7
|
+
react: true
|
|
13
8
|
}
|
|
14
9
|
};
|
|
15
|
-
this.meta = meta;
|
|
16
10
|
}
|
|
17
|
-
ContextController.prototype.
|
|
18
|
-
for (var
|
|
19
|
-
if (Reflect.has(this.
|
|
20
|
-
console.log("This
|
|
11
|
+
ContextController.prototype.saveFields = function (fields) {
|
|
12
|
+
for (var fieldsKey in fields) {
|
|
13
|
+
if (Reflect.has(this.fields, fieldsKey)) {
|
|
14
|
+
console.log("This field is a system field, please have a new name for the field:" + fieldsKey);
|
|
21
15
|
}
|
|
22
16
|
else {
|
|
23
|
-
Reflect.set(this.
|
|
17
|
+
Reflect.set(this.fields, fieldsKey, fields[fieldsKey]);
|
|
24
18
|
}
|
|
25
19
|
}
|
|
26
20
|
};
|
|
27
|
-
ContextController.prototype.
|
|
28
|
-
for (var
|
|
29
|
-
if (this.
|
|
21
|
+
ContextController.prototype.loadFields = function () {
|
|
22
|
+
for (var fieldsKey in this.fields) {
|
|
23
|
+
if (this.fields[fieldsKey].react) {
|
|
30
24
|
if (status_read({
|
|
31
25
|
type: "session",
|
|
32
|
-
fields: [
|
|
33
|
-
})[
|
|
34
|
-
this.
|
|
26
|
+
fields: [fieldsKey]
|
|
27
|
+
})[fieldsKey]) {
|
|
28
|
+
this.fields[fieldsKey].data = status_read({
|
|
35
29
|
type: "session",
|
|
36
|
-
fields: [
|
|
37
|
-
})[
|
|
30
|
+
fields: [fieldsKey]
|
|
31
|
+
})[fieldsKey];
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
};
|
|
42
|
-
ContextController.prototype.
|
|
43
|
-
for (var
|
|
36
|
+
ContextController.prototype.storeFields = function () {
|
|
37
|
+
for (var fieldsKey in this.fields) {
|
|
44
38
|
var data = {};
|
|
45
|
-
Reflect.set(data,
|
|
39
|
+
Reflect.set(data, fieldsKey, this.fields[fieldsKey]["data"]);
|
|
46
40
|
status_write({
|
|
47
41
|
type: "session",
|
|
48
42
|
fields: data
|
|
@@ -51,12 +45,12 @@ var ContextController = /** @class */ (function () {
|
|
|
51
45
|
};
|
|
52
46
|
/**
|
|
53
47
|
* 写入数据
|
|
54
|
-
* @param
|
|
48
|
+
* @param field
|
|
55
49
|
* @param value
|
|
56
50
|
*/
|
|
57
|
-
ContextController.prototype.
|
|
51
|
+
ContextController.prototype.setField = function (field, value) {
|
|
58
52
|
var data = {};
|
|
59
|
-
Reflect.set(data,
|
|
53
|
+
Reflect.set(data, field, value);
|
|
60
54
|
//写入数据
|
|
61
55
|
status_write({
|
|
62
56
|
type: "session",
|
|
@@ -64,32 +58,25 @@ var ContextController = /** @class */ (function () {
|
|
|
64
58
|
});
|
|
65
59
|
//更新数据
|
|
66
60
|
// @ts-ignore
|
|
67
|
-
this.
|
|
61
|
+
this.loadfields();
|
|
68
62
|
//数据回调
|
|
69
|
-
if (this.
|
|
63
|
+
if (this.fields[field].callback) {
|
|
70
64
|
// @ts-ignore
|
|
71
|
-
this.
|
|
65
|
+
this.fields[field].callback(value, window.appSite);
|
|
72
66
|
}
|
|
73
67
|
};
|
|
74
68
|
/**
|
|
75
69
|
* 获取数据
|
|
76
|
-
* @param
|
|
70
|
+
* @param field
|
|
77
71
|
*/
|
|
78
|
-
ContextController.prototype.
|
|
79
|
-
if (this.
|
|
80
|
-
return this.
|
|
72
|
+
ContextController.prototype.getField = function (field) {
|
|
73
|
+
if (this.fields[field]) {
|
|
74
|
+
return this.fields[field].data;
|
|
81
75
|
}
|
|
82
76
|
else {
|
|
83
77
|
return null;
|
|
84
78
|
}
|
|
85
79
|
};
|
|
86
|
-
/**
|
|
87
|
-
* 返回系统数据
|
|
88
|
-
* @param filed
|
|
89
|
-
*/
|
|
90
|
-
ContextController.prototype.getMeta = function (filed) {
|
|
91
|
-
return this.meta[filed];
|
|
92
|
-
};
|
|
93
80
|
return ContextController;
|
|
94
81
|
}());
|
|
95
82
|
export { ContextController };
|
|
@@ -8,13 +8,16 @@ export declare class PageController {
|
|
|
8
8
|
to: ComponentController[];
|
|
9
9
|
link: Map<string, {}>;
|
|
10
10
|
constructor();
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param method
|
|
14
|
+
* @param args
|
|
15
|
+
*/
|
|
11
16
|
receiver(method: string, ...args: any[]): void;
|
|
12
|
-
set crtTag(element: Element);
|
|
13
|
-
get crtTag(): Element;
|
|
14
17
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param style
|
|
18
|
+
*
|
|
19
|
+
* @param element
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
set crtTag(element: Element);
|
|
22
|
+
get crtTag(): Element;
|
|
20
23
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { changeStyle } from "../../core/utility/styleUtility";
|
|
2
1
|
var PageController = /** @class */ (function () {
|
|
3
2
|
//构造函数
|
|
4
3
|
function PageController() {
|
|
@@ -9,34 +8,33 @@ var PageController = /** @class */ (function () {
|
|
|
9
8
|
this.crtTag = null;
|
|
10
9
|
this.solt = new Map();
|
|
11
10
|
}
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param method
|
|
14
|
+
* @param args
|
|
15
|
+
*/
|
|
13
16
|
PageController.prototype.receiver = function (method) {
|
|
14
17
|
var args = [];
|
|
15
18
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
16
19
|
args[_i - 1] = arguments[_i];
|
|
17
20
|
}
|
|
18
|
-
|
|
21
|
+
Reflect.get(window, method).call(window, args);
|
|
19
22
|
};
|
|
20
23
|
Object.defineProperty(PageController.prototype, "crtTag", {
|
|
21
24
|
//返回当前页面的渲染元素
|
|
22
25
|
get: function () {
|
|
23
26
|
return this.currentTag;
|
|
24
27
|
},
|
|
25
|
-
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param element
|
|
31
|
+
*/
|
|
26
32
|
set: function (element) {
|
|
27
33
|
this.currentTag = element;
|
|
28
34
|
},
|
|
29
35
|
enumerable: false,
|
|
30
36
|
configurable: true
|
|
31
37
|
});
|
|
32
|
-
/**
|
|
33
|
-
* Change the tag theme
|
|
34
|
-
* @param tag
|
|
35
|
-
* @param style
|
|
36
|
-
*/
|
|
37
|
-
PageController.prototype.changeTheme = function (tag, style) {
|
|
38
|
-
changeStyle(tag, style);
|
|
39
|
-
};
|
|
40
38
|
return PageController;
|
|
41
39
|
}());
|
|
42
40
|
export { PageController };
|
|
@@ -94,3 +94,21 @@ export function changeStyle(tag, theme) {
|
|
|
94
94
|
head.replaceChild(style, target);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
export function changeTheme(theme) {
|
|
98
|
+
Reflect.get(window, "styleLib").forEach(function (value, key) {
|
|
99
|
+
var styles = document.getElementsByTagName("style");
|
|
100
|
+
for (var i = 0; i < styles.length; i++) {
|
|
101
|
+
if (styles[i].getAttribute("tag") === key) {
|
|
102
|
+
var style = document.createElement('style');
|
|
103
|
+
if (value.get(theme.toUpperCase())) {
|
|
104
|
+
var text = document.createTextNode(value.get(theme.toUpperCase()));
|
|
105
|
+
style.appendChild(text);
|
|
106
|
+
style.setAttribute("tag", key.toUpperCase());
|
|
107
|
+
style.setAttribute("theme", theme.toUpperCase());
|
|
108
|
+
var head = document.getElementsByTagName('head')[0];
|
|
109
|
+
head.replaceChild(style, styles[i]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
package/func/Theme.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param tag
|
|
4
|
+
* @param theme
|
|
5
|
+
*/
|
|
6
|
+
export declare function changeTagTheme(tag: string, theme: string): void;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param theme
|
|
10
|
+
*/
|
|
11
|
+
export declare function changeSessionTheme(theme: string): void;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param theme
|
|
15
|
+
*/
|
|
16
|
+
export declare function changeApplicationTheme(theme: string): void;
|
package/func/Theme.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { changeStyle, changeTheme } from "../core/utility/styleUtility";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param tag
|
|
5
|
+
* @param theme
|
|
6
|
+
*/
|
|
7
|
+
export function changeTagTheme(tag, theme) {
|
|
8
|
+
changeStyle(tag, theme);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param theme
|
|
13
|
+
*/
|
|
14
|
+
export function changeSessionTheme(theme) {
|
|
15
|
+
var application = Reflect.get(window, "context");
|
|
16
|
+
application.setField("system_theme", {
|
|
17
|
+
data: theme,
|
|
18
|
+
react: true,
|
|
19
|
+
callback: function (value, context) {
|
|
20
|
+
context.setFiled("system_theme", theme);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
changeTheme(application.getField("system_theme"));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param theme
|
|
28
|
+
*/
|
|
29
|
+
export function changeApplicationTheme(theme) {
|
|
30
|
+
var application = Reflect.get(window, "appSite");
|
|
31
|
+
application.setField("system_theme", theme);
|
|
32
|
+
changeTheme(application.getField("system_theme"));
|
|
33
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export declare class RenderJS implements RenderTip {
|
|
|
8
8
|
readonly config: {};
|
|
9
9
|
readonly tagLib: Map<string, Component>;
|
|
10
10
|
readonly styleLib: Map<string, Map<string, string>>;
|
|
11
|
-
private application;
|
|
12
|
-
private context;
|
|
11
|
+
private readonly application;
|
|
12
|
+
private readonly context;
|
|
13
13
|
page: PageController;
|
|
14
14
|
constructor();
|
|
15
15
|
/**
|
|
@@ -37,9 +37,15 @@ export declare class RenderJS implements RenderTip {
|
|
|
37
37
|
*/
|
|
38
38
|
private mount;
|
|
39
39
|
/**
|
|
40
|
-
* This method is the
|
|
40
|
+
* This method is the booster method of the render.
|
|
41
41
|
*/
|
|
42
42
|
run(): void;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param name
|
|
46
|
+
* @param func
|
|
47
|
+
*/
|
|
48
|
+
registerElements(name: string, func: any): void;
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
45
51
|
* The tool to register element to window
|
package/index.js
CHANGED
|
@@ -27,18 +27,18 @@ var RenderJS = /** @class */ (function () {
|
|
|
27
27
|
* @param config
|
|
28
28
|
*/
|
|
29
29
|
RenderJS.prototype.configApp = function (config) {
|
|
30
|
-
this.application.
|
|
31
|
-
this.application.
|
|
32
|
-
this.application.
|
|
30
|
+
this.application.saveFields(config);
|
|
31
|
+
this.application.storeFields();
|
|
32
|
+
this.application.loadFields();
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @param config
|
|
37
37
|
*/
|
|
38
38
|
RenderJS.prototype.configContext = function (config) {
|
|
39
|
-
this.context.
|
|
40
|
-
this.context.
|
|
41
|
-
this.context.
|
|
39
|
+
this.context.saveFields(config);
|
|
40
|
+
this.context.storeFields();
|
|
41
|
+
this.context.loadFields();
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
*
|
|
@@ -65,7 +65,7 @@ var RenderJS = /** @class */ (function () {
|
|
|
65
65
|
Reflect.set(window, "page", this.page);
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
68
|
-
* This method is the
|
|
68
|
+
* This method is the booster method of the render.
|
|
69
69
|
*/
|
|
70
70
|
RenderJS.prototype.run = function () {
|
|
71
71
|
//挂载对象
|
|
@@ -73,6 +73,14 @@ var RenderJS = /** @class */ (function () {
|
|
|
73
73
|
//execute
|
|
74
74
|
render(this);
|
|
75
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @param name
|
|
79
|
+
* @param func
|
|
80
|
+
*/
|
|
81
|
+
RenderJS.prototype.registerElements = function (name, func) {
|
|
82
|
+
Reflect.set(window, name, func);
|
|
83
|
+
};
|
|
76
84
|
return RenderJS;
|
|
77
85
|
}());
|
|
78
86
|
export { RenderJS };
|
package/package.json
CHANGED
package/runtime/tools.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Component } from "../class/component/component";
|
|
2
2
|
import { RenderJS } from "../index";
|
|
3
3
|
/**
|
|
4
|
-
* This function is used to save the
|
|
5
|
-
* So, you can hava a tip that we
|
|
4
|
+
* This function is used to save the prototype component class in the window object.
|
|
5
|
+
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
6
6
|
* @param application
|
|
7
7
|
* @param component
|
|
8
8
|
*/
|
|
9
9
|
export declare function registerTagLib(application: RenderJS, component: Component | Component[]): void;
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The entrance of render
|
|
12
12
|
* @param renderjs
|
|
13
13
|
*/
|
|
14
14
|
export declare function render(renderjs: RenderJS): void;
|
package/runtime/tools.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Component } from "../class/component/component";
|
|
2
2
|
import { themeStyle } from "../core/utility/styleUtility";
|
|
3
3
|
import { renderHtml } from "./runtime";
|
|
4
|
+
import { changeApplicationTheme, changeSessionTheme, changeTagTheme } from "../func/Theme";
|
|
4
5
|
/**
|
|
5
|
-
* This function is used to save the
|
|
6
|
-
* So, you can hava a tip that we
|
|
6
|
+
* This function is used to save the prototype component class in the window object.
|
|
7
|
+
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
7
8
|
* @param application
|
|
8
9
|
* @param component
|
|
9
10
|
*/
|
|
@@ -30,7 +31,7 @@ export function registerTagLib(application, component) {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
|
-
* The
|
|
34
|
+
* The entrance of render
|
|
34
35
|
* @param renderjs
|
|
35
36
|
*/
|
|
36
37
|
export function render(renderjs) {
|
|
@@ -38,6 +39,9 @@ export function render(renderjs) {
|
|
|
38
39
|
renderjs.tagLib.forEach(function (component) {
|
|
39
40
|
themeStyle(component, renderjs.styleLib);
|
|
40
41
|
});
|
|
42
|
+
renderjs.registerElements("changeTagTheme", changeTagTheme);
|
|
43
|
+
renderjs.registerElements("changeSessionTheme", changeSessionTheme);
|
|
44
|
+
renderjs.registerElements("changeApplicationTheme", changeApplicationTheme);
|
|
41
45
|
//开始渲染
|
|
42
46
|
renderHtml(document.body.children, renderjs.page);
|
|
43
47
|
}
|
package/status/read/read.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This function is used to get
|
|
2
|
+
* This function is used to get value from sessionStorage.
|
|
3
3
|
* @param filed
|
|
4
4
|
*/
|
|
5
5
|
export declare function sessionStorageEngin_read(filed: string): any;
|
|
6
6
|
/**
|
|
7
|
-
* This function is used to get
|
|
7
|
+
* This function is used to get value from localStorage.
|
|
8
8
|
* @param filed
|
|
9
9
|
*/
|
|
10
10
|
export declare function localStorageEngine_read(filed: string): any;
|
package/status/read/read.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This function is used to get
|
|
2
|
+
* This function is used to get value from sessionStorage.
|
|
3
3
|
* @param filed
|
|
4
4
|
*/
|
|
5
5
|
export function sessionStorageEngin_read(filed) {
|
|
@@ -12,7 +12,7 @@ export function sessionStorageEngin_read(filed) {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* This function is used to get
|
|
15
|
+
* This function is used to get value from localStorage.
|
|
16
16
|
* @param filed
|
|
17
17
|
*/
|
|
18
18
|
export function localStorageEngine_read(filed) {
|