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
|
@@ -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;
|
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
-
import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
|
|
3
|
-
import { afterCmd, cmdUtility } from "../utility/cmdUtility";
|
|
4
|
-
import { mount, unBox } from "../lifecycle/mount";
|
|
5
|
-
import { injectRefs
|
|
6
|
-
import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
|
|
7
|
-
import { findComponent } from "./delivery";
|
|
8
|
-
import { resolver_solt } from "../cmd/solt/v-solt";
|
|
9
|
-
/**
|
|
10
|
-
* 该函数用于初次渲染需要记录状态的组件
|
|
11
|
-
* @param proto
|
|
12
|
-
* @param parent
|
|
13
|
-
* @param child
|
|
14
|
-
* @param link
|
|
15
|
-
* @param tagTemplate
|
|
16
|
-
*/
|
|
17
|
-
export function post_render(proto, parent, child, link, tagTemplate) {
|
|
18
|
-
//获取控制对象
|
|
19
|
-
var controller = new ComponentController();
|
|
20
|
-
//解析solt
|
|
21
|
-
resolver_solt(child, controller);
|
|
22
|
-
//控制对象预处理
|
|
23
|
-
controllerCycleTypeTwo(controller, proto, child, link, tagTemplate);
|
|
24
|
-
//beforeRender
|
|
25
|
-
proto.getBeforeRender().call(controller.raw_data);
|
|
26
|
-
//解析指令
|
|
27
|
-
cmdUtility(tagTemplate, proto, controller);
|
|
28
|
-
//mount
|
|
29
|
-
mount(controller, proto, parent, child, tagTemplate);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
proto.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
unBox(controller.root, controller);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
1
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
+
import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
|
|
3
|
+
import { afterCmd, cmdUtility } from "../utility/cmdUtility";
|
|
4
|
+
import { mount, unBox } from "../lifecycle/mount";
|
|
5
|
+
import { injectRefs } from "../inject/inject";
|
|
6
|
+
import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
|
|
7
|
+
import { findComponent } from "./delivery";
|
|
8
|
+
import { resolver_solt } from "../cmd/solt/v-solt";
|
|
9
|
+
/**
|
|
10
|
+
* 该函数用于初次渲染需要记录状态的组件
|
|
11
|
+
* @param proto
|
|
12
|
+
* @param parent
|
|
13
|
+
* @param child
|
|
14
|
+
* @param link
|
|
15
|
+
* @param tagTemplate
|
|
16
|
+
*/
|
|
17
|
+
export function post_render(proto, parent, child, link, tagTemplate) {
|
|
18
|
+
//获取控制对象
|
|
19
|
+
var controller = new ComponentController();
|
|
20
|
+
//解析solt
|
|
21
|
+
resolver_solt(child, controller);
|
|
22
|
+
//控制对象预处理
|
|
23
|
+
controllerCycleTypeTwo(controller, proto, child, link, tagTemplate);
|
|
24
|
+
//beforeRender
|
|
25
|
+
proto.getBeforeRender().call(controller.raw_data);
|
|
26
|
+
//解析指令
|
|
27
|
+
cmdUtility(tagTemplate, proto, controller);
|
|
28
|
+
//mount
|
|
29
|
+
mount(controller, proto, parent, child, tagTemplate);
|
|
30
|
+
injectRefs(controller);
|
|
31
|
+
//渲染后处理
|
|
32
|
+
afterCmd(controller.root, controller.proto, controller);
|
|
33
|
+
//后处理
|
|
34
|
+
afterMethodsTypeOne(controller, child, link);
|
|
35
|
+
//afterRender
|
|
36
|
+
proto.getAfterRender().call(controller.proxyForMethods);
|
|
37
|
+
//深度渲染
|
|
38
|
+
findComponent(controller.root.children, controller);
|
|
39
|
+
if (proto.getMode() === "insert") {
|
|
40
|
+
unBox(controller.root);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
-
import { Component } from "../../class/component/component";
|
|
3
|
-
import { PageController } from "../../class/controller/pageController";
|
|
4
|
-
export declare function Render(proto: Component, parent: ParentNode, child: Element, link: ComponentController | PageController): void;
|
|
5
|
-
export declare function findComponent(collection: HTMLCollection, link: ComponentController | PageController): void;
|
|
1
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
+
import { Component } from "../../class/component/component";
|
|
3
|
+
import { PageController } from "../../class/controller/pageController";
|
|
4
|
+
export declare function Render(proto: Component, parent: ParentNode, child: Element, link: ComponentController | PageController): void;
|
|
5
|
+
export declare function findComponent(collection: HTMLCollection, link: ComponentController | PageController): void;
|
package/core/render/delivery.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { isUnKnown } from "../utility/checkUtility";
|
|
2
|
-
import { init_render } from "./initRender";
|
|
3
|
-
import { post_render } from "./PostRender";
|
|
4
|
-
import { raw_render } from "./rawRender";
|
|
5
|
-
import { getTemplate } from "../utility/templateUtility";
|
|
6
|
-
import { styleResolve } from "../utility/styleUtility";
|
|
7
|
-
//渲染自定义标签
|
|
8
|
-
export function Render(proto, parent, child, link) {
|
|
9
|
-
//获得模板元素
|
|
10
|
-
var tagTemplate = getTemplate(proto);
|
|
11
|
-
//注册当前解析元素
|
|
12
|
-
Reflect.get(window, "context").crtTag = child;
|
|
13
|
-
//解析样式
|
|
14
|
-
styleResolve(proto.getName());
|
|
15
|
-
//两种渲染方式
|
|
16
|
-
if (child.hasAttribute("name")) {
|
|
17
|
-
//需要保持状态的渲染
|
|
18
|
-
if (link.link.has(child.getAttribute("name"))) {
|
|
19
|
-
//该name元素存在旧数据,是更新渲染
|
|
20
|
-
init_render(proto, parent, child, link, tagTemplate);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
//该name元素不存在旧数据,是第一次渲染
|
|
24
|
-
post_render(proto, parent, child, link, tagTemplate);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
//不需要保持状态的渲染
|
|
29
|
-
raw_render(proto, parent, child, link, tagTemplate);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//拓展标签深度渲染
|
|
33
|
-
export function findComponent(collection, link) {
|
|
34
|
-
for (var i = 0; i < collection.length; i++) {
|
|
35
|
-
if (isUnKnown(collection[i].nodeName)) {
|
|
36
|
-
Render(Reflect.get(window, "tagLib").get(collection[i].nodeName.toUpperCase()), collection[i].parentNode, collection[i], link);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
findComponent(collection[i].children, link);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
1
|
+
import { isUnKnown } from "../utility/checkUtility";
|
|
2
|
+
import { init_render } from "./initRender";
|
|
3
|
+
import { post_render } from "./PostRender";
|
|
4
|
+
import { raw_render } from "./rawRender";
|
|
5
|
+
import { getTemplate } from "../utility/templateUtility";
|
|
6
|
+
import { styleResolve } from "../utility/styleUtility";
|
|
7
|
+
//渲染自定义标签
|
|
8
|
+
export function Render(proto, parent, child, link) {
|
|
9
|
+
//获得模板元素
|
|
10
|
+
var tagTemplate = getTemplate(proto);
|
|
11
|
+
//注册当前解析元素
|
|
12
|
+
Reflect.get(window, "context").crtTag = child;
|
|
13
|
+
//解析样式
|
|
14
|
+
styleResolve(proto.getName());
|
|
15
|
+
//两种渲染方式
|
|
16
|
+
if (child.hasAttribute("name")) {
|
|
17
|
+
//需要保持状态的渲染
|
|
18
|
+
if (link.link.has(child.getAttribute("name"))) {
|
|
19
|
+
//该name元素存在旧数据,是更新渲染
|
|
20
|
+
init_render(proto, parent, child, link, tagTemplate);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
//该name元素不存在旧数据,是第一次渲染
|
|
24
|
+
post_render(proto, parent, child, link, tagTemplate);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
//不需要保持状态的渲染
|
|
29
|
+
raw_render(proto, parent, child, link, tagTemplate);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//拓展标签深度渲染
|
|
33
|
+
export function findComponent(collection, link) {
|
|
34
|
+
for (var i = 0; i < collection.length; i++) {
|
|
35
|
+
if (isUnKnown(collection[i].nodeName)) {
|
|
36
|
+
Render(Reflect.get(window, "tagLib").get(collection[i].nodeName.toUpperCase()), collection[i].parentNode, collection[i], link);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
findComponent(collection[i].children, link);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|