render-core 1.3.37 → 1.3.39
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 +44 -44
- package/class/controller/appController.js +132 -132
- package/class/controller/componentController.d.ts +15 -15
- package/class/controller/componentController.js +22 -22
- package/class/controller/contextController.d.ts +18 -18
- package/class/controller/contextController.js +79 -79
- 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 +5 -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 -78
- 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 +29 -29
- package/core/utility/styleUtility.js +114 -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/func/Theme.d.ts +16 -16
- package/func/Theme.js +27 -27
- package/http/redirect/redirect.d.ts +11 -11
- package/http/redirect/redirect.js +36 -36
- package/index.d.ts +71 -71
- package/index.js +130 -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 +49 -49
- package/status/read/read.d.ts +10 -10
- package/status/read/read.js +26 -26
- package/status/write/write.d.ts +12 -12
- package/status/write/write.js +92 -92
- package/README.md +0 -2
package/core/inject/inject.js
CHANGED
|
@@ -1,70 +1,63 @@
|
|
|
1
|
-
import { getCodeSpaceForProps, getCodeSpaceForQuery, getCodeSpaceForRef, } from "../utility/injectUtility";
|
|
2
|
-
import { resolveProps } from "../resolver/props";
|
|
3
|
-
import { resolve_Queries } from "../resolver/query";
|
|
4
|
-
import { resolver_Refs } from "../cmd/ref/v-ref";
|
|
5
|
-
/**
|
|
6
|
-
* 向raw_data中注入props和Query
|
|
7
|
-
* @param controller
|
|
8
|
-
*/
|
|
9
|
-
export function inject(controller) {
|
|
10
|
-
//注入name
|
|
11
|
-
Reflect.set(controller.raw_data, "$name", controller.proto.getName());
|
|
12
|
-
//注入props
|
|
13
|
-
getCodeSpaceForProps(controller.raw_data, resolveProps(Reflect.get(window, "context").crtTag, controller.proto.getProps()));
|
|
14
|
-
//注入query
|
|
15
|
-
getCodeSpaceForQuery(controller.raw_data, resolve_Queries());
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param controller
|
|
20
|
-
*/
|
|
21
|
-
export function injectRefs(controller) {
|
|
22
|
-
var refs = new Map();
|
|
23
|
-
resolver_Refs(controller.root.children, refs);
|
|
24
|
-
getCodeSpaceForRef(controller.raw_data, refs);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param controller
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*/
|
|
65
|
-
export function injectComputed(controller, proto) {
|
|
66
|
-
var methods = Object.getOwnPropertyNames(proto.getComputed());
|
|
67
|
-
methods.forEach(function (value) {
|
|
68
|
-
Reflect.set(controller.computed, value, proto.getComputed()[value].bind(controller.raw_data));
|
|
69
|
-
});
|
|
70
|
-
}
|
|
1
|
+
import { getCodeSpaceForProps, getCodeSpaceForQuery, getCodeSpaceForRef, } from "../utility/injectUtility";
|
|
2
|
+
import { resolveProps } from "../resolver/props";
|
|
3
|
+
import { resolve_Queries } from "../resolver/query";
|
|
4
|
+
import { resolver_Refs } from "../cmd/ref/v-ref";
|
|
5
|
+
/**
|
|
6
|
+
* 向raw_data中注入props和Query
|
|
7
|
+
* @param controller
|
|
8
|
+
*/
|
|
9
|
+
export function inject(controller) {
|
|
10
|
+
//注入name
|
|
11
|
+
Reflect.set(controller.raw_data, "$name", controller.proto.getName());
|
|
12
|
+
//注入props
|
|
13
|
+
getCodeSpaceForProps(controller.raw_data, resolveProps(Reflect.get(window, "context").crtTag, controller.proto.getProps()));
|
|
14
|
+
//注入query
|
|
15
|
+
getCodeSpaceForQuery(controller.raw_data, resolve_Queries());
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param controller
|
|
20
|
+
*/
|
|
21
|
+
export function injectRefs(controller) {
|
|
22
|
+
var refs = new Map();
|
|
23
|
+
resolver_Refs(controller.root.children, refs);
|
|
24
|
+
getCodeSpaceForRef(controller.raw_data, refs);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param controller
|
|
29
|
+
* @param proto
|
|
30
|
+
*/
|
|
31
|
+
export function injectMethod(controller, proto) {
|
|
32
|
+
var methods = Object.getOwnPropertyNames(proto.getMethods());
|
|
33
|
+
methods.forEach(function (value) {
|
|
34
|
+
if (value.match(/^\$\$[a-zA-Z0-9_]*/) !== null) {
|
|
35
|
+
Reflect.set(controller.raw_data, value, proto.getMethods()[value].bind(controller.raw_data));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
Reflect.set(controller.raw_data, value, proto.getMethods()[value].bind(controller.proxyForMethods));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param controller
|
|
45
|
+
* @param proto
|
|
46
|
+
*/
|
|
47
|
+
export function injectWatcher(controller, proto) {
|
|
48
|
+
var methods = Object.getOwnPropertyNames(proto.getWatcher());
|
|
49
|
+
methods.forEach(function (value) {
|
|
50
|
+
Reflect.set(controller.watcher, value, proto.getWatcher()[value].bind(controller.raw_data));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param controller
|
|
56
|
+
* @param proto
|
|
57
|
+
*/
|
|
58
|
+
export function injectComputed(controller, proto) {
|
|
59
|
+
var methods = Object.getOwnPropertyNames(proto.getComputed());
|
|
60
|
+
methods.forEach(function (value) {
|
|
61
|
+
Reflect.set(controller.computed, value, proto.getComputed()[value].bind(controller.raw_data));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
-
import { PageController } from "../../class/controller/pageController";
|
|
3
|
-
/**
|
|
4
|
-
* 该函数用于处理渲染后操作
|
|
5
|
-
* @param controller
|
|
6
|
-
* @param child
|
|
7
|
-
* @param link
|
|
8
|
-
*/
|
|
9
|
-
export declare function afterMethodsTypeOne(controller: ComponentController, child: Element, link: ComponentController | PageController): void;
|
|
10
|
-
/**
|
|
11
|
-
* 该函数用于处理渲染后操作
|
|
12
|
-
* @param controller
|
|
13
|
-
* @param child
|
|
14
|
-
* @param link
|
|
15
|
-
*/
|
|
16
|
-
export declare function afterMethodsTypeTwo(controller: ComponentController, child: Element, link: ComponentController | PageController): void;
|
|
1
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
+
import { PageController } from "../../class/controller/pageController";
|
|
3
|
+
/**
|
|
4
|
+
* 该函数用于处理渲染后操作
|
|
5
|
+
* @param controller
|
|
6
|
+
* @param child
|
|
7
|
+
* @param link
|
|
8
|
+
*/
|
|
9
|
+
export declare function afterMethodsTypeOne(controller: ComponentController, child: Element, link: ComponentController | PageController): void;
|
|
10
|
+
/**
|
|
11
|
+
* 该函数用于处理渲染后操作
|
|
12
|
+
* @param controller
|
|
13
|
+
* @param child
|
|
14
|
+
* @param link
|
|
15
|
+
*/
|
|
16
|
+
export declare function afterMethodsTypeTwo(controller: ComponentController, child: Element, link: ComponentController | PageController): void;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 该函数用于处理渲染后操作
|
|
3
|
-
* @param controller
|
|
4
|
-
* @param child
|
|
5
|
-
* @param link
|
|
6
|
-
*/
|
|
7
|
-
export function afterMethodsTypeOne(controller, child, link) {
|
|
8
|
-
//将本控制对象保存到父控制对象的发布数组中
|
|
9
|
-
link.to.push(controller);
|
|
10
|
-
//将执行空间保存到父控制对象
|
|
11
|
-
link.link.set(child.getAttribute("name"), controller.raw_data);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* 该函数用于处理渲染后操作
|
|
15
|
-
* @param controller
|
|
16
|
-
* @param child
|
|
17
|
-
* @param link
|
|
18
|
-
*/
|
|
19
|
-
export function afterMethodsTypeTwo(controller, child, link) {
|
|
20
|
-
//将本控制对象保存到父控制对象的发布数组中
|
|
21
|
-
link.to.push(controller);
|
|
22
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 该函数用于处理渲染后操作
|
|
3
|
+
* @param controller
|
|
4
|
+
* @param child
|
|
5
|
+
* @param link
|
|
6
|
+
*/
|
|
7
|
+
export function afterMethodsTypeOne(controller, child, link) {
|
|
8
|
+
//将本控制对象保存到父控制对象的发布数组中
|
|
9
|
+
link.to.push(controller);
|
|
10
|
+
//将执行空间保存到父控制对象
|
|
11
|
+
link.link.set(child.getAttribute("name"), controller.raw_data);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 该函数用于处理渲染后操作
|
|
15
|
+
* @param controller
|
|
16
|
+
* @param child
|
|
17
|
+
* @param link
|
|
18
|
+
*/
|
|
19
|
+
export function afterMethodsTypeTwo(controller, child, link) {
|
|
20
|
+
//将本控制对象保存到父控制对象的发布数组中
|
|
21
|
+
link.to.push(controller);
|
|
22
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
-
import { Component } from "../../class/component/component";
|
|
3
|
-
import { PageController } from "../../class/controller/pageController";
|
|
4
|
-
/**
|
|
5
|
-
* This function is used to initiate the component controller object.
|
|
6
|
-
* @param controller
|
|
7
|
-
* @param proto
|
|
8
|
-
* @param child
|
|
9
|
-
* @param link
|
|
10
|
-
* @param tagTemplate
|
|
11
|
-
*/
|
|
12
|
-
export declare function controllerCycleTypeOne(controller: ComponentController, proto: Component, child: Element, link: ComponentController | PageController, tagTemplate: Element): void;
|
|
13
|
-
export declare function controllerCycleTypeTwo(controller: ComponentController, proto: Component, child: Element, link: ComponentController | PageController, tagTemplate: Element): void;
|
|
1
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
+
import { Component } from "../../class/component/component";
|
|
3
|
+
import { PageController } from "../../class/controller/pageController";
|
|
4
|
+
/**
|
|
5
|
+
* This function is used to initiate the component controller object.
|
|
6
|
+
* @param controller
|
|
7
|
+
* @param proto
|
|
8
|
+
* @param child
|
|
9
|
+
* @param link
|
|
10
|
+
* @param tagTemplate
|
|
11
|
+
*/
|
|
12
|
+
export declare function controllerCycleTypeOne(controller: ComponentController, proto: Component, child: Element, link: ComponentController | PageController, tagTemplate: Element): void;
|
|
13
|
+
export declare function controllerCycleTypeTwo(controller: ComponentController, proto: Component, child: Element, link: ComponentController | PageController, tagTemplate: Element): void;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { inject, injectComputed, injectMethod, injectWatcher } from "../inject/inject";
|
|
2
|
-
import { getProxyObject } from "../proxy/getProxy";
|
|
3
|
-
import { getCodeSpaceForCommit, getCodeSpaceForPublish, getCommitMethod, getGetCodeSpaceForProperty, getGetterMethod, getPublishMethod, getSetCodeSpaceForProperty, getSetterMethod } from "../utility/injectUtility";
|
|
4
|
-
import { dataInject } from "../utility/dataUtility";
|
|
5
|
-
/**
|
|
6
|
-
* This function is used to initiate the component controller object.
|
|
7
|
-
* @param controller
|
|
8
|
-
* @param proto
|
|
9
|
-
* @param child
|
|
10
|
-
* @param link
|
|
11
|
-
* @param tagTemplate
|
|
12
|
-
*/
|
|
13
|
-
export function controllerCycleTypeOne(controller, proto, child, link, tagTemplate) {
|
|
14
|
-
//复制原始数据对象到控制对象
|
|
15
|
-
controller.raw_data = link.link.get(child.getAttribute("name"));
|
|
16
|
-
cycleBridge(controller, proto, child, link, tagTemplate);
|
|
17
|
-
}
|
|
18
|
-
export function controllerCycleTypeTwo(controller, proto, child, link, tagTemplate) {
|
|
19
|
-
//复制原始数据对象到控制对象
|
|
20
|
-
controller.raw_data = dataInject(proto.getData());
|
|
21
|
-
cycleBridge(controller, proto, child, link, tagTemplate);
|
|
22
|
-
}
|
|
23
|
-
function cycleBridge(controller, proto, child, link, tagTemplate) {
|
|
24
|
-
//保持控制器模板对象
|
|
25
|
-
controller.proto = proto;
|
|
26
|
-
controller.mode = proto.getMode();
|
|
27
|
-
//向raw_data中注入元数据
|
|
28
|
-
inject(controller);
|
|
29
|
-
//数据渲染代理对象
|
|
30
|
-
controller.proxyForMethods = getProxyObject(controller.raw_data, controller);
|
|
31
|
-
injectComputed(controller, proto);
|
|
32
|
-
injectWatcher(controller, proto);
|
|
33
|
-
injectMethod(controller, proto);
|
|
34
|
-
//注入commit
|
|
35
|
-
getCodeSpaceForCommit(controller.raw_data, getCommitMethod(link));
|
|
36
|
-
//注入receiver
|
|
37
|
-
getCodeSpaceForPublish(controller.raw_data, getPublishMethod(controller));
|
|
38
|
-
//注入setter
|
|
39
|
-
getSetCodeSpaceForProperty(controller.raw_data, getSetterMethod(controller));
|
|
40
|
-
//注入getter
|
|
41
|
-
getGetCodeSpaceForProperty(controller.raw_data, getGetterMethod(controller));
|
|
42
|
-
}
|
|
1
|
+
import { inject, injectComputed, injectMethod, injectWatcher } from "../inject/inject";
|
|
2
|
+
import { getProxyObject } from "../proxy/getProxy";
|
|
3
|
+
import { getCodeSpaceForCommit, getCodeSpaceForPublish, getCommitMethod, getGetCodeSpaceForProperty, getGetterMethod, getPublishMethod, getSetCodeSpaceForProperty, getSetterMethod } from "../utility/injectUtility";
|
|
4
|
+
import { dataInject } from "../utility/dataUtility";
|
|
5
|
+
/**
|
|
6
|
+
* This function is used to initiate the component controller object.
|
|
7
|
+
* @param controller
|
|
8
|
+
* @param proto
|
|
9
|
+
* @param child
|
|
10
|
+
* @param link
|
|
11
|
+
* @param tagTemplate
|
|
12
|
+
*/
|
|
13
|
+
export function controllerCycleTypeOne(controller, proto, child, link, tagTemplate) {
|
|
14
|
+
//复制原始数据对象到控制对象
|
|
15
|
+
controller.raw_data = link.link.get(child.getAttribute("name"));
|
|
16
|
+
cycleBridge(controller, proto, child, link, tagTemplate);
|
|
17
|
+
}
|
|
18
|
+
export function controllerCycleTypeTwo(controller, proto, child, link, tagTemplate) {
|
|
19
|
+
//复制原始数据对象到控制对象
|
|
20
|
+
controller.raw_data = dataInject(proto.getData());
|
|
21
|
+
cycleBridge(controller, proto, child, link, tagTemplate);
|
|
22
|
+
}
|
|
23
|
+
function cycleBridge(controller, proto, child, link, tagTemplate) {
|
|
24
|
+
//保持控制器模板对象
|
|
25
|
+
controller.proto = proto;
|
|
26
|
+
controller.mode = proto.getMode();
|
|
27
|
+
//向raw_data中注入元数据
|
|
28
|
+
inject(controller);
|
|
29
|
+
//数据渲染代理对象
|
|
30
|
+
controller.proxyForMethods = getProxyObject(controller.raw_data, controller);
|
|
31
|
+
injectComputed(controller, proto);
|
|
32
|
+
injectWatcher(controller, proto);
|
|
33
|
+
injectMethod(controller, proto);
|
|
34
|
+
//注入commit
|
|
35
|
+
getCodeSpaceForCommit(controller.raw_data, getCommitMethod(link));
|
|
36
|
+
//注入receiver
|
|
37
|
+
getCodeSpaceForPublish(controller.raw_data, getPublishMethod(controller));
|
|
38
|
+
//注入setter
|
|
39
|
+
getSetCodeSpaceForProperty(controller.raw_data, getSetterMethod(controller));
|
|
40
|
+
//注入getter
|
|
41
|
+
getGetCodeSpaceForProperty(controller.raw_data, getGetterMethod(controller));
|
|
42
|
+
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
-
import { Component } from "../../class/component/component";
|
|
3
|
-
/**
|
|
4
|
-
* This function is used to mount the dom to the html document.
|
|
5
|
-
* @param controller
|
|
6
|
-
* @param proto
|
|
7
|
-
* @param parent
|
|
8
|
-
* @param child
|
|
9
|
-
* @param tagTemplate
|
|
10
|
-
*/
|
|
11
|
-
export declare function mount(controller: ComponentController, proto: Component, parent: ParentNode, child: Element, tagTemplate: Element): void;
|
|
12
|
-
/**
|
|
13
|
-
* insert elements without div
|
|
14
|
-
* @param root
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export declare function unBox(root: ParentNode, controller: ComponentController): void;
|
|
1
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
+
import { Component } from "../../class/component/component";
|
|
3
|
+
/**
|
|
4
|
+
* This function is used to mount the dom to the html document.
|
|
5
|
+
* @param controller
|
|
6
|
+
* @param proto
|
|
7
|
+
* @param parent
|
|
8
|
+
* @param child
|
|
9
|
+
* @param tagTemplate
|
|
10
|
+
*/
|
|
11
|
+
export declare function mount(controller: ComponentController, proto: Component, parent: ParentNode, child: Element, tagTemplate: Element): void;
|
|
12
|
+
/**
|
|
13
|
+
* insert elements without div elment
|
|
14
|
+
* @param root
|
|
15
|
+
*/
|
|
16
|
+
export declare function unBox(root: ParentNode): void;
|
package/core/lifecycle/mount.js
CHANGED
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function is used to mount the dom to the html document.
|
|
3
|
-
* @param controller
|
|
4
|
-
* @param proto
|
|
5
|
-
* @param parent
|
|
6
|
-
* @param child
|
|
7
|
-
* @param tagTemplate
|
|
8
|
-
*/
|
|
9
|
-
export function mount(controller, proto, parent, child, tagTemplate) {
|
|
10
|
-
//mount
|
|
11
|
-
var renderSpace = document.createElement("div");
|
|
12
|
-
//给box添加样式
|
|
13
|
-
renderSpace.setAttribute("style", proto.getBoxStyle());
|
|
14
|
-
//指定渲染空间
|
|
15
|
-
controller.root = renderSpace;
|
|
16
|
-
//开始渲染
|
|
17
|
-
parent.replaceChild(renderSpace, child);
|
|
18
|
-
while (tagTemplate.hasChildNodes()) {
|
|
19
|
-
renderSpace.append(tagTemplate.firstChild);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* insert elements without div
|
|
24
|
-
* @param root
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Reflect.set(controller.raw_data, "$root", root.parentNode);
|
|
33
|
-
root.parentNode.removeChild(root);
|
|
34
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* This function is used to mount the dom to the html document.
|
|
3
|
+
* @param controller
|
|
4
|
+
* @param proto
|
|
5
|
+
* @param parent
|
|
6
|
+
* @param child
|
|
7
|
+
* @param tagTemplate
|
|
8
|
+
*/
|
|
9
|
+
export function mount(controller, proto, parent, child, tagTemplate) {
|
|
10
|
+
//mount
|
|
11
|
+
var renderSpace = document.createElement("div");
|
|
12
|
+
//给box添加样式
|
|
13
|
+
renderSpace.setAttribute("style", proto.getBoxStyle());
|
|
14
|
+
//指定渲染空间
|
|
15
|
+
controller.root = renderSpace;
|
|
16
|
+
//开始渲染
|
|
17
|
+
parent.replaceChild(renderSpace, child);
|
|
18
|
+
while (tagTemplate.hasChildNodes()) {
|
|
19
|
+
renderSpace.append(tagTemplate.firstChild);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* insert elements without div elment
|
|
24
|
+
* @param root
|
|
25
|
+
*/
|
|
26
|
+
export function unBox(root) {
|
|
27
|
+
while (root.hasChildNodes()) {
|
|
28
|
+
root.parentNode.insertBefore(root.firstChild, root);
|
|
29
|
+
}
|
|
30
|
+
root.parentNode.removeChild(root);
|
|
31
|
+
}
|
package/core/loader/loader.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 加载自定义标签样式
|
|
3
|
-
* @param tag
|
|
4
|
-
* @param theme
|
|
5
|
-
* @param styleData
|
|
6
|
-
*/
|
|
7
|
-
export declare function loadStyle(tag: string, theme: string, styleData: string): void;
|
|
1
|
+
/**
|
|
2
|
+
* 加载自定义标签样式
|
|
3
|
+
* @param tag
|
|
4
|
+
* @param theme
|
|
5
|
+
* @param styleData
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadStyle(tag: string, theme: string, styleData: string): void;
|
package/core/loader/loader.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { checkStyleLabel } from "../utility/styleUtility";
|
|
2
|
-
/**
|
|
3
|
-
* 加载自定义标签样式
|
|
4
|
-
* @param tag
|
|
5
|
-
* @param theme
|
|
6
|
-
* @param styleData
|
|
7
|
-
*/
|
|
8
|
-
export function loadStyle(tag, theme, styleData) {
|
|
9
|
-
if (!checkStyleLabel(tag)) {
|
|
10
|
-
var style = document.createElement('style');
|
|
11
|
-
var text = document.createTextNode(styleData);
|
|
12
|
-
style.appendChild(text);
|
|
13
|
-
style.setAttribute("tag", tag.toUpperCase());
|
|
14
|
-
style.setAttribute("theme", theme);
|
|
15
|
-
var head = document.getElementsByTagName('head')[0];
|
|
16
|
-
head.appendChild(style);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
import { checkStyleLabel } from "../utility/styleUtility";
|
|
2
|
+
/**
|
|
3
|
+
* 加载自定义标签样式
|
|
4
|
+
* @param tag
|
|
5
|
+
* @param theme
|
|
6
|
+
* @param styleData
|
|
7
|
+
*/
|
|
8
|
+
export function loadStyle(tag, theme, styleData) {
|
|
9
|
+
if (!checkStyleLabel(tag)) {
|
|
10
|
+
var style = document.createElement('style');
|
|
11
|
+
var text = document.createTextNode(styleData);
|
|
12
|
+
style.appendChild(text);
|
|
13
|
+
style.setAttribute("tag", tag.toUpperCase());
|
|
14
|
+
style.setAttribute("theme", theme);
|
|
15
|
+
var head = document.getElementsByTagName('head')[0];
|
|
16
|
+
head.appendChild(style);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/core/proxy/getProxy.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
-
/**
|
|
3
|
-
* 获取data对象的代理对象
|
|
4
|
-
* @param obj
|
|
5
|
-
* @param updater
|
|
6
|
-
*/
|
|
7
|
-
export declare function getProxyObject(obj: {}, updater: ComponentController): any;
|
|
8
|
-
/**
|
|
9
|
-
* 获取setter代理函数
|
|
10
|
-
* @param data
|
|
11
|
-
* @param updater
|
|
12
|
-
*/
|
|
13
|
-
export declare function getSetter(data: {}, updater: ComponentController): any;
|
|
1
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
+
/**
|
|
3
|
+
* 获取data对象的代理对象
|
|
4
|
+
* @param obj
|
|
5
|
+
* @param updater
|
|
6
|
+
*/
|
|
7
|
+
export declare function getProxyObject(obj: {}, updater: ComponentController): any;
|
|
8
|
+
/**
|
|
9
|
+
* 获取setter代理函数
|
|
10
|
+
* @param data
|
|
11
|
+
* @param updater
|
|
12
|
+
*/
|
|
13
|
+
export declare function getSetter(data: {}, updater: ComponentController): any;
|
package/core/proxy/getProxy.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { update_Render } from "../render/updateRender";
|
|
2
|
-
import { locateInputAddress } from "../utility/sectionUtility";
|
|
3
|
-
/**
|
|
4
|
-
* 获取data对象的代理对象
|
|
5
|
-
* @param obj
|
|
6
|
-
* @param updater
|
|
7
|
-
*/
|
|
8
|
-
export function getProxyObject(obj, updater) {
|
|
9
|
-
//定义代理方法对象
|
|
10
|
-
var handel = {};
|
|
11
|
-
//获取set代理方法
|
|
12
|
-
handel["set"] = getSetter(obj, updater);
|
|
13
|
-
//返回代理对象
|
|
14
|
-
return new Proxy(obj, handel);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* 获取setter代理函数
|
|
18
|
-
* @param data
|
|
19
|
-
* @param updater
|
|
20
|
-
*/
|
|
21
|
-
export function getSetter(data, updater) {
|
|
22
|
-
var setter = function (obj, prop, value) {
|
|
23
|
-
if (this.mode !== "box") {
|
|
24
|
-
console.log("Not box element can not to update data!");
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
//检查是否有watcher
|
|
28
|
-
try {
|
|
29
|
-
this.watcher[prop](obj[prop], value);
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
}
|
|
33
|
-
//更新值
|
|
34
|
-
obj[prop] = value;
|
|
35
|
-
//执行更新
|
|
36
|
-
update_Render(this);
|
|
37
|
-
locateInputAddress(this);
|
|
38
|
-
Reflect.deleteProperty(this, "origin");
|
|
39
|
-
return true;
|
|
40
|
-
};
|
|
41
|
-
return setter.bind(updater);
|
|
42
|
-
}
|
|
1
|
+
import { update_Render } from "../render/updateRender";
|
|
2
|
+
import { locateInputAddress } from "../utility/sectionUtility";
|
|
3
|
+
/**
|
|
4
|
+
* 获取data对象的代理对象
|
|
5
|
+
* @param obj
|
|
6
|
+
* @param updater
|
|
7
|
+
*/
|
|
8
|
+
export function getProxyObject(obj, updater) {
|
|
9
|
+
//定义代理方法对象
|
|
10
|
+
var handel = {};
|
|
11
|
+
//获取set代理方法
|
|
12
|
+
handel["set"] = getSetter(obj, updater);
|
|
13
|
+
//返回代理对象
|
|
14
|
+
return new Proxy(obj, handel);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 获取setter代理函数
|
|
18
|
+
* @param data
|
|
19
|
+
* @param updater
|
|
20
|
+
*/
|
|
21
|
+
export function getSetter(data, updater) {
|
|
22
|
+
var setter = function (obj, prop, value) {
|
|
23
|
+
if (this.mode !== "box") {
|
|
24
|
+
console.log("Not box element can not to update data!");
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
//检查是否有watcher
|
|
28
|
+
try {
|
|
29
|
+
this.watcher[prop](obj[prop], value);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
}
|
|
33
|
+
//更新值
|
|
34
|
+
obj[prop] = value;
|
|
35
|
+
//执行更新
|
|
36
|
+
update_Render(this);
|
|
37
|
+
locateInputAddress(this);
|
|
38
|
+
Reflect.deleteProperty(this, "origin");
|
|
39
|
+
return true;
|
|
40
|
+
};
|
|
41
|
+
return setter.bind(updater);
|
|
42
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Component } from "../../class/component/component";
|
|
2
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
3
|
-
import { PageController } from "../../class/controller/pageController";
|
|
4
|
-
/**
|
|
5
|
-
* 该函数用于初次渲染需要记录状态的组件
|
|
6
|
-
* @param proto
|
|
7
|
-
* @param parent
|
|
8
|
-
* @param child
|
|
9
|
-
* @param link
|
|
10
|
-
* @param tagTemplate
|
|
11
|
-
*/
|
|
12
|
-
export declare function post_render(proto: Component, parent: ParentNode, child: Element, link: ComponentController | PageController, tagTemplate: Element): void;
|
|
1
|
+
import { Component } from "../../class/component/component";
|
|
2
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
3
|
+
import { PageController } from "../../class/controller/pageController";
|
|
4
|
+
/**
|
|
5
|
+
* 该函数用于初次渲染需要记录状态的组件
|
|
6
|
+
* @param proto
|
|
7
|
+
* @param parent
|
|
8
|
+
* @param child
|
|
9
|
+
* @param link
|
|
10
|
+
* @param tagTemplate
|
|
11
|
+
*/
|
|
12
|
+
export declare function post_render(proto: Component, parent: ParentNode, child: Element, link: ComponentController | PageController, tagTemplate: Element): void;
|