render-core 1.3.38 → 1.3.40
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/component/component.d.ts +41 -41
- package/class/component/component.js +108 -108
- package/class/controller/appController.d.ts +17 -44
- package/class/controller/appController.js +25 -132
- package/class/controller/componentController.d.ts +15 -15
- package/class/controller/componentController.js +22 -22
- package/class/controller/pageController.d.ts +23 -23
- package/class/controller/pageController.js +40 -40
- package/class/tips/appTip.d.ts +2 -2
- package/class/tips/appTip.js +1 -1
- package/class/tips/componentTip.d.ts +13 -13
- package/class/tips/componentTip.js +1 -1
- package/class/tips/renderTip.d.ts +3 -5
- package/class/tips/renderTip.js +1 -1
- package/core/cmd/data/v-el.d.ts +8 -8
- package/core/cmd/data/v-el.js +28 -28
- package/core/cmd/data/v-html.d.ts +8 -8
- package/core/cmd/data/v-html.js +26 -26
- package/core/cmd/data/v-txt.d.ts +8 -8
- package/core/cmd/data/v-txt.js +29 -29
- package/core/cmd/justify/v-if.d.ts +6 -6
- package/core/cmd/justify/v-if.js +43 -43
- package/core/cmd/justify/v-render.d.ts +6 -6
- package/core/cmd/justify/v-render.js +26 -26
- package/core/cmd/justify/v-show.d.ts +6 -6
- package/core/cmd/justify/v-show.js +26 -26
- package/core/cmd/justify/v-switch.d.ts +6 -6
- package/core/cmd/justify/v-switch.js +35 -35
- package/core/cmd/loop/v-for.d.ts +12 -12
- package/core/cmd/loop/v-for.js +63 -63
- package/core/cmd/loop/v-index.d.ts +14 -14
- package/core/cmd/loop/v-index.js +80 -79
- package/core/cmd/loop/v-key.d.ts +12 -12
- package/core/cmd/loop/v-key.js +70 -70
- package/core/cmd/method/v-on.d.ts +8 -8
- package/core/cmd/method/v-on.js +40 -40
- package/core/cmd/property/v-bind.d.ts +6 -6
- package/core/cmd/property/v-bind.js +33 -33
- package/core/cmd/react/v-model.d.ts +6 -6
- package/core/cmd/react/v-model.js +22 -22
- package/core/cmd/ref/v-ref.d.ts +6 -6
- package/core/cmd/ref/v-ref.js +16 -16
- package/core/cmd/solt/v-solt.d.ts +14 -14
- package/core/cmd/solt/v-solt.js +46 -46
- package/core/inject/inject.d.ts +30 -35
- package/core/inject/inject.js +63 -70
- package/core/lifecycle/afterMethods.d.ts +16 -16
- package/core/lifecycle/afterMethods.js +22 -22
- package/core/lifecycle/controllerCycle.d.ts +13 -13
- package/core/lifecycle/controllerCycle.js +42 -42
- package/core/lifecycle/mount.d.ts +16 -17
- package/core/lifecycle/mount.js +31 -34
- package/core/loader/loader.d.ts +7 -7
- package/core/loader/loader.js +18 -18
- package/core/proxy/getProxy.d.ts +13 -13
- package/core/proxy/getProxy.js +42 -42
- package/core/render/PostRender.d.ts +12 -12
- package/core/render/PostRender.js +42 -45
- package/core/render/delivery.d.ts +5 -5
- package/core/render/delivery.js +42 -42
- package/core/render/initRender.d.ts +12 -12
- package/core/render/initRender.js +39 -41
- package/core/render/partRender.d.ts +15 -15
- package/core/render/partRender.js +31 -31
- package/core/render/rawRender.d.ts +12 -12
- package/core/render/rawRender.js +43 -45
- package/core/render/updateRender.d.ts +6 -6
- package/core/render/updateRender.js +29 -32
- package/core/resolver/props.d.ts +18 -18
- package/core/resolver/props.js +60 -60
- package/core/resolver/query.d.ts +4 -4
- package/core/resolver/query.js +15 -15
- package/core/utility/checkUtility.d.ts +1 -1
- package/core/utility/checkUtility.js +4 -4
- package/core/utility/cmdUtility.d.ts +16 -16
- package/core/utility/cmdUtility.js +57 -57
- package/core/utility/dataUtility.d.ts +1 -1
- package/core/utility/dataUtility.js +8 -8
- package/core/utility/errorUtility.d.ts +3 -3
- package/core/utility/errorUtility.js +9 -9
- package/core/utility/injectUtility.d.ts +13 -13
- package/core/utility/injectUtility.js +58 -58
- package/core/utility/inputType.d.ts +5 -5
- package/core/utility/inputType.js +20 -20
- package/core/utility/inputUtility.d.ts +4 -4
- package/core/utility/inputUtility.js +100 -100
- package/core/utility/miscUtility.d.ts +6 -6
- package/core/utility/miscUtility.js +12 -12
- package/core/utility/modelUtility.d.ts +15 -15
- package/core/utility/modelUtility.js +66 -66
- package/core/utility/sectionUtility.d.ts +6 -6
- package/core/utility/sectionUtility.js +104 -104
- package/core/utility/styleUtility.d.ts +17 -29
- package/core/utility/styleUtility.js +67 -114
- package/core/utility/templateUtility.d.ts +6 -6
- package/core/utility/templateUtility.js +13 -13
- package/core/utility/vForUtility.d.ts +15 -15
- package/core/utility/vForUtility.js +20 -20
- package/http/redirect/redirect.d.ts +11 -11
- package/http/redirect/redirect.js +36 -36
- package/index.d.ts +44 -71
- package/index.js +70 -130
- package/package.json +3 -8
- package/runtime/metaTagLib.d.ts +2 -2
- package/runtime/metaTagLib.js +27 -27
- package/runtime/runtime.d.ts +7 -7
- package/runtime/runtime.js +26 -26
- package/runtime/tools.d.ts +14 -14
- package/runtime/tools.js +43 -49
- package/README.md +0 -2
- package/class/controller/contextController.d.ts +0 -18
- package/class/controller/contextController.js +0 -79
- package/func/Theme.d.ts +0 -16
- package/func/Theme.js +0 -27
- package/status/read/read.d.ts +0 -10
- package/status/read/read.js +0 -26
- package/status/write/write.d.ts +0 -12
- package/status/write/write.js +0 -92
package/runtime/tools.js
CHANGED
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
import { Component } from "../class/component/component";
|
|
2
|
-
import { themeStyle } from "../core/utility/styleUtility";
|
|
3
|
-
import { renderHtml } from "./runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
renderjs.
|
|
43
|
-
|
|
44
|
-
renderjs.registerElements("changeTagTheme", changeTagTheme);
|
|
45
|
-
renderjs.registerElements("changeSessionTheme", changeSessionTheme);
|
|
46
|
-
renderjs.registerElements("changeApplicationTheme", changeApplicationTheme);
|
|
47
|
-
//开始渲染
|
|
48
|
-
renderHtml(document.body.children, renderjs.page);
|
|
49
|
-
}
|
|
1
|
+
import { Component } from "../class/component/component";
|
|
2
|
+
import { themeStyle } from "../core/utility/styleUtility";
|
|
3
|
+
import { renderHtml } from "./runtime";
|
|
4
|
+
/**
|
|
5
|
+
* This function is used to save the prototype component class in the window object.
|
|
6
|
+
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
7
|
+
* @param application
|
|
8
|
+
* @param component
|
|
9
|
+
*/
|
|
10
|
+
export function registerTagLib(application, component) {
|
|
11
|
+
//if the input parameter is an instance of Component,do the code block.
|
|
12
|
+
if (component instanceof Component) {
|
|
13
|
+
if (!application.tagLib.has(component.getName().toUpperCase())) {
|
|
14
|
+
application.tagLib.set(component.getName().toUpperCase(), component);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
//if the input parameter is an array of Component,do the code block.
|
|
22
|
+
component.forEach(function (component) {
|
|
23
|
+
if (!application.tagLib.has(component.getName().toUpperCase())) {
|
|
24
|
+
application.tagLib.set(component.getName().toUpperCase(), component);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The entrance of render
|
|
34
|
+
* @param renderjs
|
|
35
|
+
*/
|
|
36
|
+
export function render(renderjs) {
|
|
37
|
+
//获取styleLib对象
|
|
38
|
+
renderjs.tagLib.forEach(function (component) {
|
|
39
|
+
themeStyle(component, renderjs.styleLib);
|
|
40
|
+
});
|
|
41
|
+
//开始渲染
|
|
42
|
+
renderHtml(document.body.children, renderjs.page);
|
|
43
|
+
}
|
package/README.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare class ContextController {
|
|
2
|
-
private readonly fields;
|
|
3
|
-
constructor();
|
|
4
|
-
saveFields(fields: {}): void;
|
|
5
|
-
loadFields(): void;
|
|
6
|
-
storeFields(): void;
|
|
7
|
-
/**
|
|
8
|
-
* 写入数据
|
|
9
|
-
* @param field
|
|
10
|
-
* @param value
|
|
11
|
-
*/
|
|
12
|
-
setField(field: string, value: any): void;
|
|
13
|
-
/**
|
|
14
|
-
* 获取数据
|
|
15
|
-
* @param field
|
|
16
|
-
*/
|
|
17
|
-
getField(field: string): any;
|
|
18
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { status_read, status_write } from "../../index";
|
|
2
|
-
var ContextController = /** @class */ (function () {
|
|
3
|
-
function ContextController() {
|
|
4
|
-
this.fields = {};
|
|
5
|
-
}
|
|
6
|
-
ContextController.prototype.saveFields = function (fields) {
|
|
7
|
-
for (var fieldsKey in fields) {
|
|
8
|
-
if (Reflect.has(this.fields, fieldsKey)) {
|
|
9
|
-
console.log("This field is a system field, please have a new name for the field:" + fieldsKey);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
Reflect.set(this.fields, fieldsKey, fields[fieldsKey]);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
ContextController.prototype.loadFields = function () {
|
|
17
|
-
for (var fieldsKey in this.fields) {
|
|
18
|
-
if (this.fields[fieldsKey].react) {
|
|
19
|
-
if (status_read({
|
|
20
|
-
type: "session",
|
|
21
|
-
fields: [fieldsKey]
|
|
22
|
-
})[fieldsKey]) {
|
|
23
|
-
this.fields[fieldsKey].data = status_read({
|
|
24
|
-
type: "session",
|
|
25
|
-
fields: [fieldsKey]
|
|
26
|
-
})[fieldsKey]["data"];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (this.fields[fieldsKey].down) {
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
this.fields[fieldsKey].callback(this.fields[fieldsKey]["data"], window.appSite);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
ContextController.prototype.storeFields = function () {
|
|
36
|
-
for (var fieldsKey in this.fields) {
|
|
37
|
-
var data = {};
|
|
38
|
-
Reflect.set(data, fieldsKey, {
|
|
39
|
-
data: this.fields[fieldsKey]["data"]
|
|
40
|
-
});
|
|
41
|
-
status_write({
|
|
42
|
-
type: "session",
|
|
43
|
-
fields: data
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* 写入数据
|
|
49
|
-
* @param field
|
|
50
|
-
* @param value
|
|
51
|
-
*/
|
|
52
|
-
ContextController.prototype.setField = function (field, value) {
|
|
53
|
-
var data = {};
|
|
54
|
-
Reflect.set(data, field, {
|
|
55
|
-
data: value
|
|
56
|
-
});
|
|
57
|
-
//写入数据
|
|
58
|
-
status_write({
|
|
59
|
-
type: "session",
|
|
60
|
-
fields: data
|
|
61
|
-
});
|
|
62
|
-
//更新数据
|
|
63
|
-
this.loadFields();
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* 获取数据
|
|
67
|
-
* @param field
|
|
68
|
-
*/
|
|
69
|
-
ContextController.prototype.getField = function (field) {
|
|
70
|
-
if (this.fields[field]) {
|
|
71
|
-
return this.fields[field].data;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
return ContextController;
|
|
78
|
-
}());
|
|
79
|
-
export { ContextController };
|
package/func/Theme.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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", theme);
|
|
17
|
-
changeTheme(application.getField("system_theme"));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param theme
|
|
22
|
-
*/
|
|
23
|
-
export function changeApplicationTheme(theme) {
|
|
24
|
-
var application = Reflect.get(window, "appSite");
|
|
25
|
-
application.setField("system_theme", theme);
|
|
26
|
-
changeTheme(application.getField("system_theme"));
|
|
27
|
-
}
|
package/status/read/read.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function is used to get value from sessionStorage.
|
|
3
|
-
* @param filed
|
|
4
|
-
*/
|
|
5
|
-
export declare function sessionStorageEngin_read(filed: string): any;
|
|
6
|
-
/**
|
|
7
|
-
* This function is used to get value from localStorage.
|
|
8
|
-
* @param filed
|
|
9
|
-
*/
|
|
10
|
-
export declare function localStorageEngine_read(filed: string): any;
|
package/status/read/read.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function is used to get value from sessionStorage.
|
|
3
|
-
* @param filed
|
|
4
|
-
*/
|
|
5
|
-
export function sessionStorageEngin_read(filed) {
|
|
6
|
-
if (sessionStorage.getItem(filed) !== null) {
|
|
7
|
-
return JSON.parse(sessionStorage.getItem(filed));
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
console.warn("The sessionStorage has not init the key:" + filed);
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* This function is used to get value from localStorage.
|
|
16
|
-
* @param filed
|
|
17
|
-
*/
|
|
18
|
-
export function localStorageEngine_read(filed) {
|
|
19
|
-
if (localStorage.getItem(filed) !== null) {
|
|
20
|
-
return JSON.parse(localStorage.getItem(filed));
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
console.warn("The localStorage has not init the key:" + filed);
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
}
|
package/status/write/write.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function is used to store the key-value to sessionStorage.
|
|
3
|
-
* @param filed
|
|
4
|
-
* @param fields
|
|
5
|
-
*/
|
|
6
|
-
export declare function sessionStorageEngin_write(filed: string, fields: {}): void;
|
|
7
|
-
/**
|
|
8
|
-
* This function is used to store the key-value to localStorage.
|
|
9
|
-
* @param filed
|
|
10
|
-
* @param fields
|
|
11
|
-
*/
|
|
12
|
-
export declare function localStorageEngine_write(filed: string, fields: {}): void;
|
package/status/write/write.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function is used to store the key-value to sessionStorage.
|
|
3
|
-
* @param filed
|
|
4
|
-
* @param fields
|
|
5
|
-
*/
|
|
6
|
-
export function sessionStorageEngin_write(filed, fields) {
|
|
7
|
-
if (sessionStorage.getItem(filed) !== null) {
|
|
8
|
-
switch (typeof fields[filed]) {
|
|
9
|
-
case "string":
|
|
10
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
11
|
-
break;
|
|
12
|
-
case "number":
|
|
13
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
14
|
-
break;
|
|
15
|
-
case "boolean":
|
|
16
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
17
|
-
break;
|
|
18
|
-
case "bigint":
|
|
19
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
20
|
-
break;
|
|
21
|
-
case "object":
|
|
22
|
-
sessionStorage.setItem(filed, JSON.stringify(fields[filed]));
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
console.warn("The sessionStorage has no key:" + filed + ", which will be stored to sessionStorage!");
|
|
28
|
-
switch (typeof fields[filed]) {
|
|
29
|
-
case "string":
|
|
30
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
31
|
-
break;
|
|
32
|
-
case "number":
|
|
33
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
34
|
-
break;
|
|
35
|
-
case "boolean":
|
|
36
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
37
|
-
break;
|
|
38
|
-
case "bigint":
|
|
39
|
-
sessionStorage.setItem(filed, fields[filed]);
|
|
40
|
-
break;
|
|
41
|
-
case "object":
|
|
42
|
-
sessionStorage.setItem(filed, JSON.stringify(fields[filed]));
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* This function is used to store the key-value to localStorage.
|
|
49
|
-
* @param filed
|
|
50
|
-
* @param fields
|
|
51
|
-
*/
|
|
52
|
-
export function localStorageEngine_write(filed, fields) {
|
|
53
|
-
if (localStorage.getItem(filed) !== null) {
|
|
54
|
-
switch (typeof fields[filed]) {
|
|
55
|
-
case "string":
|
|
56
|
-
localStorage.setItem(filed, fields[filed]);
|
|
57
|
-
break;
|
|
58
|
-
case "number":
|
|
59
|
-
localStorage.setItem(filed, fields[filed]);
|
|
60
|
-
break;
|
|
61
|
-
case "boolean":
|
|
62
|
-
localStorage.setItem(filed, fields[filed]);
|
|
63
|
-
break;
|
|
64
|
-
case "bigint":
|
|
65
|
-
localStorage.setItem(filed, fields[filed]);
|
|
66
|
-
break;
|
|
67
|
-
case "object":
|
|
68
|
-
localStorage.setItem(filed, JSON.stringify(fields[filed]));
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
console.warn("The localStorage has no key:" + filed + ", which will be stored to localStorage!");
|
|
74
|
-
switch (typeof fields[filed]) {
|
|
75
|
-
case "string":
|
|
76
|
-
localStorage.setItem(filed, fields[filed]);
|
|
77
|
-
break;
|
|
78
|
-
case "number":
|
|
79
|
-
localStorage.setItem(filed, fields[filed]);
|
|
80
|
-
break;
|
|
81
|
-
case "boolean":
|
|
82
|
-
localStorage.setItem(filed, fields[filed]);
|
|
83
|
-
break;
|
|
84
|
-
case "bigint":
|
|
85
|
-
localStorage.setItem(filed, fields[filed]);
|
|
86
|
-
break;
|
|
87
|
-
case "object":
|
|
88
|
-
localStorage.setItem(filed, JSON.stringify(fields[filed]));
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|