render-core 1.4.0 → 1.4.1
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/index.d.ts +48 -34
- package/index.js +70 -55
- package/kernel/delivery/delivery.d.ts +5 -0
- package/kernel/delivery/delivery.js +52 -0
- package/kernel/directive/data/v-el.d.ts +8 -0
- package/{core/cmd → kernel/directive}/data/v-el.js +2 -2
- package/kernel/directive/data/v-html.d.ts +8 -0
- package/{core/cmd → kernel/directive}/data/v-html.js +2 -2
- package/kernel/directive/data/v-txt.d.ts +8 -0
- package/{core/cmd → kernel/directive}/data/v-txt.js +2 -2
- package/kernel/directive/justify/v-if.d.ts +6 -0
- package/{core/cmd → kernel/directive}/justify/v-if.js +2 -2
- package/kernel/directive/justify/v-render.d.ts +6 -0
- package/{core/cmd → kernel/directive}/justify/v-render.js +2 -2
- package/kernel/directive/justify/v-show.d.ts +6 -0
- package/{core/cmd → kernel/directive}/justify/v-show.js +2 -2
- package/kernel/directive/justify/v-switch.d.ts +6 -0
- package/{core/cmd → kernel/directive}/justify/v-switch.js +2 -2
- package/{core/cmd → kernel/directive}/loop/v-for-utility.d.ts +1 -1
- package/{core/cmd → kernel/directive}/loop/v-for-utility.js +3 -3
- package/{core/cmd → kernel/directive}/loop/v-for.d.ts +1 -1
- package/{core/cmd → kernel/directive}/loop/v-for.js +2 -2
- package/{core/cmd → kernel/directive}/loop/v-map-utility.d.ts +1 -1
- package/{core/cmd → kernel/directive}/loop/v-map-utility.js +3 -3
- package/kernel/directive/loop/v-map.d.ts +6 -0
- package/{core/cmd → kernel/directive}/loop/v-map.js +2 -2
- package/kernel/directive/method/v-on.d.ts +8 -0
- package/{core/cmd → kernel/directive}/method/v-on.js +2 -2
- package/kernel/directive/property/v-bind.d.ts +6 -0
- package/{core/cmd → kernel/directive}/property/v-bind.js +3 -3
- package/kernel/directive/react/v-model.d.ts +6 -0
- package/{core/cmd → kernel/directive}/react/v-model.js +3 -3
- package/kernel/directive/ref/v-ref.d.ts +6 -0
- package/{core/cmd → kernel/directive}/ref/v-ref.js +2 -2
- package/kernel/directive/salt/v-solt.d.ts +13 -0
- package/{core/cmd/solt → kernel/directive/salt}/v-solt.js +8 -8
- package/kernel/proxyer/getProxy.d.ts +9 -0
- package/kernel/proxyer/getProxy.js +35 -0
- package/kernel/renderer/initRender.d.ts +10 -0
- package/kernel/renderer/initRender.js +69 -0
- package/kernel/renderer/postRender.d.ts +10 -0
- package/kernel/renderer/postRender.js +70 -0
- package/kernel/renderer/rawRender.d.ts +10 -0
- package/kernel/renderer/rawRender.js +70 -0
- package/kernel/renderer/updateRender.d.ts +6 -0
- package/kernel/renderer/updateRender.js +33 -0
- package/package.json +1 -4
- package/{controller → system/define}/ContextController.d.ts +8 -7
- package/system/define/ContextController.js +23 -0
- package/{generic → system/generic}/ControllerGeneric.d.ts +4 -5
- package/system/generic/RenderGeneric.d.ts +4 -0
- package/system/injection/inject.d.ts +24 -0
- package/system/injection/inject.js +54 -0
- package/system/injection/injection.d.ts +21 -0
- package/system/lifecycle/lifeCycle.d.ts +14 -0
- package/system/lifecycle/lifeCycle.js +21 -0
- package/system/lifecycle/mount.d.ts +17 -0
- package/{core → system}/lifecycle/mount.js +10 -11
- package/system/output/error.d.ts +0 -0
- package/system/output/error.js +4 -0
- package/system/recorder/table0/system_func_0.d.ts +47 -0
- package/system/recorder/table0/system_func_0.js +71 -0
- package/system/recorder/table0/system_t_0.d.ts +9 -0
- package/system/recorder/table0/system_t_0.js +7 -0
- package/system/recorder/table1/system_func_1.d.ts +2 -0
- package/system/recorder/table1/system_func_1.js +7 -0
- package/system/recorder/table1/system_t_1.d.ts +4 -0
- package/system/recorder/table1/system_t_1.js +3 -0
- package/system/recorder/table2/system_t_2.d.ts +2 -0
- package/{library/taglib/metaTagLib.js → system/recorder/table2/system_t_2.js} +14 -15
- package/system/resolver/props.d.ts +18 -0
- package/system/resolver/props.js +64 -0
- package/system/router/router.d.ts +3 -0
- package/system/router/router.js +20 -0
- package/system/utility/checkUtility.js +4 -0
- package/system/utility/cmdUtility.d.ts +15 -0
- package/system/utility/cmdUtility.js +43 -0
- package/{core → system}/utility/injectUtility.d.ts +0 -3
- package/{core → system}/utility/injectUtility.js +0 -10
- package/system/utility/inputType.d.ts +5 -0
- package/system/utility/miscUtility.d.ts +6 -0
- package/{core → system}/utility/miscUtility.js +2 -2
- package/system/utility/sectionUtility.d.ts +6 -0
- package/{core → system}/utility/styleUtility.d.ts +2 -2
- package/{core → system}/utility/styleUtility.js +17 -14
- package/{core → system}/utility/templateUtility.d.ts +1 -1
- package/tension/DefaultRouterPlugin.d.ts +17 -0
- package/tension/DefaultRouterPlugin.js +11 -0
- package/tension/generic/ComponentGeneric.d.ts +13 -0
- package/{core/exexutor/executor.d.ts → tension/generic/HooksGeneric.d.ts} +3 -4
- package/tension/generic/OriginalDataGeneric.d.ts +18 -0
- package/tension/generic/PluginGeneric.d.ts +5 -0
- package/tension/generic/PrefaceGeneric.d.ts +6 -0
- package/tension/generic/RouterGeneric.d.ts +5 -0
- package/tension/generic/RouterGeneric.js +1 -0
- package/tension/prototype/AbstractComponent.d.ts +43 -0
- package/tension/prototype/AbstractComponent.js +113 -0
- package/tension/prototype/AbstractRouter.d.ts +6 -0
- package/tension/prototype/AbstractRouter.js +12 -0
- package/tension/prototype/HooksAction.d.ts +7 -0
- package/tension/prototype/HooksAction.js +24 -0
- package/tension/prototype/PrefaceAction.d.ts +7 -0
- package/tension/prototype/PrefaceAction.js +14 -0
- package/tension/prototype/RouterAction.d.ts +16 -0
- package/tension/prototype/RouterAction.js +13 -0
- package/xboot/Entrance.d.ts +7 -0
- package/xboot/Entrance.js +43 -0
- package/xboot/RenderProcessor.d.ts +7 -0
- package/{runtime/renderProcessor.js → xboot/RenderProcessor.js} +7 -9
- package/xboot/TagProcessor.d.ts +7 -0
- package/{runtime/tag → xboot}/TagProcessor.js +6 -6
- package/controller/ComponentController.d.ts +0 -29
- package/controller/ComponentController.js +0 -30
- package/controller/ContextController.js +0 -36
- package/core/cmd/data/v-el.d.ts +0 -9
- package/core/cmd/data/v-html.d.ts +0 -9
- package/core/cmd/data/v-txt.d.ts +0 -9
- package/core/cmd/justify/v-if.d.ts +0 -6
- package/core/cmd/justify/v-render.d.ts +0 -6
- package/core/cmd/justify/v-show.d.ts +0 -6
- package/core/cmd/justify/v-switch.d.ts +0 -6
- package/core/cmd/loop/v-map.d.ts +0 -6
- package/core/cmd/method/v-on.d.ts +0 -8
- package/core/cmd/property/v-bind.d.ts +0 -6
- package/core/cmd/react/v-change.d.ts +0 -6
- package/core/cmd/react/v-change.js +0 -22
- package/core/cmd/react/v-model.d.ts +0 -6
- package/core/cmd/ref/v-ref.d.ts +0 -6
- package/core/cmd/solt/v-solt.d.ts +0 -14
- package/core/exexutor/executor.js +0 -24
- package/core/inject/inject.d.ts +0 -31
- package/core/inject/inject.js +0 -66
- package/core/inject/injection.d.ts +0 -22
- package/core/lifecycle/afterMethods.d.ts +0 -16
- package/core/lifecycle/afterMethods.js +0 -22
- package/core/lifecycle/controllerCycle.d.ts +0 -22
- package/core/lifecycle/controllerCycle.js +0 -66
- package/core/lifecycle/mount.d.ts +0 -17
- package/core/proxy/getProxy.d.ts +0 -11
- package/core/proxy/getProxy.js +0 -26
- package/core/proxy/proxy.d.ts +0 -9
- package/core/proxy/proxy.js +0 -26
- package/core/render/PostRender.d.ts +0 -12
- package/core/render/PostRender.js +0 -42
- package/core/render/delivery.d.ts +0 -5
- package/core/render/delivery.js +0 -42
- package/core/render/initRender.d.ts +0 -12
- package/core/render/initRender.js +0 -39
- package/core/render/rawRender.d.ts +0 -12
- package/core/render/rawRender.js +0 -43
- package/core/render/updateRender.d.ts +0 -6
- package/core/render/updateRender.js +0 -29
- package/core/resolver/props.d.ts +0 -19
- package/core/resolver/props.js +0 -62
- package/core/utility/checkUtility.js +0 -4
- package/core/utility/cmdUtility.d.ts +0 -17
- package/core/utility/cmdUtility.js +0 -58
- package/core/utility/inputType.d.ts +0 -5
- package/core/utility/miscUtility.d.ts +0 -6
- package/core/utility/sectionUtility.d.ts +0 -6
- package/generic/ApplicationGeneric.d.ts +0 -4
- package/generic/ConfigGeneric.d.ts +0 -3
- package/generic/RenderGeneric.d.ts +0 -5
- package/generic/StyleGeneric.d.ts +0 -4
- package/generic/originalDataGeneric.d.ts +0 -4
- package/http/generic/HttpGeneric.d.ts +0 -4
- package/library/props/PropertyLib.d.ts +0 -6
- package/library/props/PropertyLib.js +0 -5
- package/library/taglib/metaTagLib.d.ts +0 -2
- package/proto/controller/AppController.d.ts +0 -16
- package/proto/controller/AppController.js +0 -25
- package/proto/controller/ComponentController.d.ts +0 -18
- package/proto/controller/ComponentController.js +0 -24
- package/proto/controller/PageController.d.ts +0 -23
- package/proto/controller/PageController.js +0 -40
- package/runtime/config/RenderConfig.d.ts +0 -12
- package/runtime/config/RenderConfig.js +0 -11
- package/runtime/config/config.d.ts +0 -4
- package/runtime/config/config.js +0 -4
- package/runtime/config.d.ts +0 -3
- package/runtime/config.js +0 -3
- package/runtime/delivery.d.ts +0 -5
- package/runtime/delivery.js +0 -43
- package/runtime/entrance.d.ts +0 -7
- package/runtime/entrance.js +0 -33
- package/runtime/render/PostRender.d.ts +0 -15
- package/runtime/render/PostRender.js +0 -49
- package/runtime/render/delivery.d.ts +0 -5
- package/runtime/render/delivery.js +0 -42
- package/runtime/render/initRender.d.ts +0 -15
- package/runtime/render/initRender.js +0 -46
- package/runtime/render/rawRender.d.ts +0 -15
- package/runtime/render/rawRender.js +0 -50
- package/runtime/renderProcessor.d.ts +0 -11
- package/runtime/tag/TagProcessor.d.ts +0 -9
- package/runtime/tagProcessor.d.ts +0 -9
- package/runtime/tagProcessor.js +0 -27
- package/runtime/update/updateRender.d.ts +0 -10
- package/runtime/update/updateRender.js +0 -38
- /package/{generic → system/generic}/ControllerGeneric.js +0 -0
- /package/{generic → system/generic}/RenderGeneric.js +0 -0
- /package/{http → system/http}/Http.d.ts +0 -0
- /package/{http → system/http}/Http.js +0 -0
- /package/{core/inject → system/injection}/injection.js +0 -0
- /package/{core → system}/loader/loader.d.ts +0 -0
- /package/{core → system}/loader/loader.js +0 -0
- /package/{core → system}/resolver/query.d.ts +0 -0
- /package/{core → system}/resolver/query.js +0 -0
- /package/{core → system}/utility/checkUtility.d.ts +0 -0
- /package/{core → system}/utility/dataUtility.d.ts +0 -0
- /package/{core → system}/utility/dataUtility.js +0 -0
- /package/{core → system}/utility/errorUtility.d.ts +0 -0
- /package/{core → system}/utility/errorUtility.js +0 -0
- /package/{core → system}/utility/inputType.js +0 -0
- /package/{core → system}/utility/inputUtility.d.ts +0 -0
- /package/{core → system}/utility/inputUtility.js +0 -0
- /package/{core → system}/utility/modelUtility.d.ts +0 -0
- /package/{core → system}/utility/modelUtility.js +0 -0
- /package/{core → system}/utility/sectionUtility.js +0 -0
- /package/{core → system}/utility/templateUtility.js +0 -0
- /package/{generic/ApplicationGeneric.js → tension/generic/ComponentGeneric.js} +0 -0
- /package/{generic/ConfigGeneric.js → tension/generic/HooksGeneric.js} +0 -0
- /package/{generic/StyleGeneric.js → tension/generic/OriginalDataGeneric.js} +0 -0
- /package/{generic/originalDataGeneric.js → tension/generic/PluginGeneric.js} +0 -0
- /package/{http/generic/HttpGeneric.js → tension/generic/PrefaceGeneric.js} +0 -0
package/runtime/delivery.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { isUnKnown } from "../core/utility/checkUtility";
|
|
2
|
-
import { init_render } from "./render/InitRender";
|
|
3
|
-
import { post_render } from "./render/PostRender";
|
|
4
|
-
import { raw_render } from "./render/RawRender";
|
|
5
|
-
import { getTemplate } from "../core/utility/templateUtility";
|
|
6
|
-
import { styleResolveAndLoad } from "../core/utility/styleUtility";
|
|
7
|
-
import RenderConfig from "./config/RenderConfig";
|
|
8
|
-
//渲染自定义标签
|
|
9
|
-
export function delivery(protoTypeComponent, componentAttachedRootElement, child, parentController, tagLib, styleLib, rjsLib) {
|
|
10
|
-
//获得模板元素
|
|
11
|
-
var tagTemplate = getTemplate(protoTypeComponent);
|
|
12
|
-
//加载组件样式
|
|
13
|
-
styleResolveAndLoad(protoTypeComponent.getName(), styleLib);
|
|
14
|
-
//注册当前解析元素
|
|
15
|
-
RenderConfig["crt"] = child;
|
|
16
|
-
//两种渲染方式
|
|
17
|
-
if (child.hasAttribute("name")) {
|
|
18
|
-
//需要保持状态的渲染
|
|
19
|
-
if (parentController.lazyComponent.has(child.getAttribute("name"))) {
|
|
20
|
-
//该元素存在旧数据,是更新渲染
|
|
21
|
-
init_render(protoTypeComponent, componentAttachedRootElement, child, parentController, tagTemplate, tagLib, styleLib, rjsLib);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
//该元素不存在旧数据,是第一次渲染
|
|
25
|
-
post_render(protoTypeComponent, componentAttachedRootElement, child, parentController, tagTemplate, tagLib, styleLib, rjsLib);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
//不需要保持状态的渲染
|
|
30
|
-
raw_render(protoTypeComponent, componentAttachedRootElement, child, parentController, tagTemplate, tagLib, styleLib, rjsLib);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//拓展标签深度渲染
|
|
34
|
-
export function findComponent(collection, parentController, tagLib, styleLib, rjsLib) {
|
|
35
|
-
for (var i = 0; i < collection.length; i++) {
|
|
36
|
-
if (isUnKnown(collection[i].nodeName)) {
|
|
37
|
-
delivery(tagLib.get(collection[i].nodeName.toUpperCase()), collection[i].parentNode, collection[i], parentController, tagLib, styleLib, rjsLib);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
findComponent(collection[i].children, parentController, tagLib, styleLib, rjsLib);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
package/runtime/entrance.d.ts
DELETED
package/runtime/entrance.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { themeStyle } from "../core/utility/styleUtility";
|
|
2
|
-
import { renderHtml } from "./RenderProcessor";
|
|
3
|
-
/**
|
|
4
|
-
* The entrance of render
|
|
5
|
-
* @param renderJs
|
|
6
|
-
* @param root
|
|
7
|
-
*/
|
|
8
|
-
export function render(renderJs, root) {
|
|
9
|
-
//获取styleLib对象
|
|
10
|
-
renderJs.tagLib.forEach(function (component) {
|
|
11
|
-
themeStyle(component, renderJs.styleLib);
|
|
12
|
-
});
|
|
13
|
-
if (root == null) {
|
|
14
|
-
//开始渲染
|
|
15
|
-
renderJs.contextController.componentAttachedRootElement = document.body;
|
|
16
|
-
renderHtml(document.children, renderJs.contextController, renderJs.tagLib, renderJs.styleLib, renderJs.rjsLib);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
var mountPoint = document.getElementById(root);
|
|
20
|
-
if (mountPoint == null) {
|
|
21
|
-
renderJs.contextController.componentAttachedRootElement = document.body;
|
|
22
|
-
//开始渲染
|
|
23
|
-
console.warn("Mount point not found");
|
|
24
|
-
console.warn("Mount point was selected to body");
|
|
25
|
-
renderHtml(document.body.children, renderJs.contextController, renderJs.tagLib, renderJs.styleLib, renderJs.rjsLib);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
//开始渲染
|
|
29
|
-
renderJs.contextController.componentAttachedRootElement = mountPoint;
|
|
30
|
-
renderHtml(mountPoint.children, renderJs.contextController, renderJs.tagLib, renderJs.styleLib, renderJs.rjsLib);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../controller/ComponentController";
|
|
2
|
-
import { ContextController } from "../../controller/ContextController";
|
|
3
|
-
import { Component } from "../../../render-refer/dist";
|
|
4
|
-
/**
|
|
5
|
-
* 该函数用于初次渲染需要记录状态的组件
|
|
6
|
-
* @param protoType
|
|
7
|
-
* @param parent
|
|
8
|
-
* @param child
|
|
9
|
-
* @param componentController
|
|
10
|
-
* @param tagTemplate
|
|
11
|
-
* @param tagLib
|
|
12
|
-
* @param styleLib
|
|
13
|
-
* @param rjsLib
|
|
14
|
-
*/
|
|
15
|
-
export declare function post_render(protoType: Component, parent: ParentNode, child: Element, componentController: ComponentController | ContextController, tagTemplate: Element, tagLib: Map<string, Component>, styleLib: Map<string, Map<string, string>>, rjsLib: Map<string, any>): void;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../controller/ComponentController";
|
|
2
|
-
import { controllerCycleTypeTwo } from "../../core/lifecycle/controllerCycle";
|
|
3
|
-
import { afterCmd, cmdUtility } from "../../core/utility/cmdUtility";
|
|
4
|
-
import { mount, unBox } from "../../core/lifecycle/mount";
|
|
5
|
-
import { injectRefs } from "../../core/inject/inject";
|
|
6
|
-
import { afterMethodsTypeOne } from "../../core/lifecycle/afterMethods";
|
|
7
|
-
import { findComponent } from "../Delivery";
|
|
8
|
-
import { resolver_salt } from "../../core/cmd/solt/v-solt";
|
|
9
|
-
/**
|
|
10
|
-
* 该函数用于初次渲染需要记录状态的组件
|
|
11
|
-
* @param protoType
|
|
12
|
-
* @param parent
|
|
13
|
-
* @param child
|
|
14
|
-
* @param componentController
|
|
15
|
-
* @param tagTemplate
|
|
16
|
-
* @param tagLib
|
|
17
|
-
* @param styleLib
|
|
18
|
-
* @param rjsLib
|
|
19
|
-
*/
|
|
20
|
-
export function post_render(protoType, parent, child, componentController, tagTemplate, tagLib, styleLib, rjsLib) {
|
|
21
|
-
//获取控制对象
|
|
22
|
-
var controller = new ComponentController({
|
|
23
|
-
boxMode: true
|
|
24
|
-
});
|
|
25
|
-
controller.componentConfig["$plugins"] = rjsLib;
|
|
26
|
-
controller.parentController = componentController;
|
|
27
|
-
//解析salt
|
|
28
|
-
resolver_salt(child, controller);
|
|
29
|
-
//控制对象预处理
|
|
30
|
-
controllerCycleTypeTwo(controller, protoType, componentController, tagLib, styleLib);
|
|
31
|
-
//beforeRender
|
|
32
|
-
protoType.getBeforeRender().call(controller.originalData);
|
|
33
|
-
//解析指令
|
|
34
|
-
cmdUtility(tagTemplate, protoType, controller);
|
|
35
|
-
//mount
|
|
36
|
-
mount(controller, protoType, parent, child, tagTemplate);
|
|
37
|
-
injectRefs(controller);
|
|
38
|
-
//渲染后处理
|
|
39
|
-
afterCmd(controller.componentAttachedRootElement, controller.prototypeOfComponent, controller);
|
|
40
|
-
//后处理
|
|
41
|
-
afterMethodsTypeOne(controller, child, componentController);
|
|
42
|
-
//afterRender
|
|
43
|
-
protoType.getAfterRender().call(controller.dataForMethod);
|
|
44
|
-
//深度渲染
|
|
45
|
-
findComponent(controller.componentAttachedRootElement.children, controller, tagLib, styleLib, rjsLib);
|
|
46
|
-
if (!protoType.getConfig()["boxMode"]) {
|
|
47
|
-
unBox(controller);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../proto/controller/ComponentController";
|
|
2
|
-
import { PageController } from "../../proto/controller/PageController";
|
|
3
|
-
import { Component } from "../../../render-refer/dist";
|
|
4
|
-
export declare function delivery(protoTypeComponent: Component, componentAttachedRootElement: ParentNode, child: Element, controller: ComponentController | PageController): void;
|
|
5
|
-
export declare function findComponent(collection: HTMLCollection, link: ComponentController | PageController): void;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { isUnKnown } from "../../core/utility/checkUtility";
|
|
2
|
-
import { init_render } from "./initRender";
|
|
3
|
-
import { post_render } from "./PostRender";
|
|
4
|
-
import { raw_render } from "./rawRender";
|
|
5
|
-
import { getTemplate } from "../../core/utility/templateUtility";
|
|
6
|
-
import { styleResolve } from "../../core/utility/styleUtility";
|
|
7
|
-
//渲染自定义标签
|
|
8
|
-
export function delivery(protoTypeComponent, componentAttachedRootElement, child, controller) {
|
|
9
|
-
//获得模板元素
|
|
10
|
-
var tagTemplate = getTemplate(protoTypeComponent);
|
|
11
|
-
//注册当前解析元素
|
|
12
|
-
Reflect.get(window, "context").crtTag = child;
|
|
13
|
-
//解析样式
|
|
14
|
-
styleResolve(protoTypeComponent.getName());
|
|
15
|
-
//两种渲染方式
|
|
16
|
-
if (child.hasAttribute("name")) {
|
|
17
|
-
//需要保持状态的渲染
|
|
18
|
-
if (controller.lazyComponent.has(child.getAttribute("name"))) {
|
|
19
|
-
//该元素存在旧数据,是更新渲染
|
|
20
|
-
init_render(protoTypeComponent, componentAttachedRootElement, child, controller, tagTemplate);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
//该元素不存在旧数据,是第一次渲染
|
|
24
|
-
post_render(protoTypeComponent, componentAttachedRootElement, child, controller, tagTemplate);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
//不需要保持状态的渲染
|
|
29
|
-
raw_render(protoTypeComponent, componentAttachedRootElement, child, controller, 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
|
-
delivery(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,15 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../controller/ComponentController";
|
|
2
|
-
import { ContextController } from "../../controller/ContextController";
|
|
3
|
-
import { Component } from "../../../render-refer/dist";
|
|
4
|
-
/**
|
|
5
|
-
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
6
|
-
* @param protoType
|
|
7
|
-
* @param parent
|
|
8
|
-
* @param child
|
|
9
|
-
* @param componentController
|
|
10
|
-
* @param tagTemplate
|
|
11
|
-
* @param tagLib
|
|
12
|
-
* @param styleLib
|
|
13
|
-
* @param rjsLib
|
|
14
|
-
*/
|
|
15
|
-
export declare function init_render(protoType: Component, parent: ParentNode, child: Element, componentController: ComponentController | ContextController, tagTemplate: Element, tagLib: Map<string, Component>, styleLib: Map<string, Map<string, string>>, rjsLib: Map<string, any>): void;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../controller/ComponentController";
|
|
2
|
-
import { controllerCycleTypeOne } from "../../core/lifecycle/controllerCycle";
|
|
3
|
-
import { afterCmd, cmdUtility } from "../../core/utility/cmdUtility";
|
|
4
|
-
import { mount, unBox } from "../../core/lifecycle/mount";
|
|
5
|
-
import { injectRefs } from "../../core/inject/inject";
|
|
6
|
-
import { afterMethodsTypeOne } from "../../core/lifecycle/afterMethods";
|
|
7
|
-
import { findComponent } from "../Delivery";
|
|
8
|
-
import { resolver_salt } from "../../core/cmd/solt/v-solt";
|
|
9
|
-
/**
|
|
10
|
-
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
11
|
-
* @param protoType
|
|
12
|
-
* @param parent
|
|
13
|
-
* @param child
|
|
14
|
-
* @param componentController
|
|
15
|
-
* @param tagTemplate
|
|
16
|
-
* @param tagLib
|
|
17
|
-
* @param styleLib
|
|
18
|
-
* @param rjsLib
|
|
19
|
-
*/
|
|
20
|
-
export function init_render(protoType, parent, child, componentController, tagTemplate, tagLib, styleLib, rjsLib) {
|
|
21
|
-
//获取控制对象
|
|
22
|
-
var controller = new ComponentController({
|
|
23
|
-
boxMode: true
|
|
24
|
-
});
|
|
25
|
-
controller.componentConfig["$plugins"] = rjsLib;
|
|
26
|
-
controller.parentController = componentController;
|
|
27
|
-
//解析salt
|
|
28
|
-
resolver_salt(child, controller);
|
|
29
|
-
//控制对象预处理
|
|
30
|
-
controllerCycleTypeOne(controller, protoType, child, componentController, tagLib, styleLib);
|
|
31
|
-
//内存中模板处理
|
|
32
|
-
cmdUtility(tagTemplate, protoType, controller);
|
|
33
|
-
//mount
|
|
34
|
-
mount(controller, protoType, parent, child, tagTemplate);
|
|
35
|
-
//获取
|
|
36
|
-
injectRefs(controller);
|
|
37
|
-
//渲染后数据处理
|
|
38
|
-
afterCmd(controller.componentAttachedRootElement, protoType, controller);
|
|
39
|
-
//后处理
|
|
40
|
-
afterMethodsTypeOne(controller, child, componentController);
|
|
41
|
-
//深度渲染
|
|
42
|
-
findComponent(tagTemplate.children, controller, tagLib, styleLib, rjsLib);
|
|
43
|
-
if (!protoType.getConfig()["boxMode"]) {
|
|
44
|
-
unBox(controller);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../controller/ComponentController";
|
|
2
|
-
import { ContextController } from "../../controller/ContextController";
|
|
3
|
-
import { Component } from "../../../render-refer/dist";
|
|
4
|
-
/**
|
|
5
|
-
* 该函数用于渲染不需要记录状态的组件
|
|
6
|
-
* @param protoType
|
|
7
|
-
* @param parent
|
|
8
|
-
* @param child
|
|
9
|
-
* @param componentController
|
|
10
|
-
* @param tagTemplate
|
|
11
|
-
* @param tagLib
|
|
12
|
-
* @param styleLib
|
|
13
|
-
* @param rjsLib
|
|
14
|
-
*/
|
|
15
|
-
export declare function raw_render(protoType: Component, parent: ParentNode, child: Element, componentController: ComponentController | ContextController, tagTemplate: Element, tagLib: Map<string, Component>, styleLib: Map<string, Map<string, string>>, rjsLib: Map<string, any>): void;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../controller/ComponentController";
|
|
2
|
-
import { controllerCycleTypeTwo } from "../../core/lifecycle/controllerCycle";
|
|
3
|
-
import { afterCmd, cmdUtility } from "../../core/utility/cmdUtility";
|
|
4
|
-
import { mount, unBox } from "../../core/lifecycle/mount";
|
|
5
|
-
import { injectRefs } from "../../core/inject/inject";
|
|
6
|
-
import { afterMethodsTypeTwo } from "../../core/lifecycle/afterMethods";
|
|
7
|
-
import { findComponent } from "../Delivery";
|
|
8
|
-
import { resolver_salt } from "../../core/cmd/solt/v-solt";
|
|
9
|
-
/**
|
|
10
|
-
* 该函数用于渲染不需要记录状态的组件
|
|
11
|
-
* @param protoType
|
|
12
|
-
* @param parent
|
|
13
|
-
* @param child
|
|
14
|
-
* @param componentController
|
|
15
|
-
* @param tagTemplate
|
|
16
|
-
* @param tagLib
|
|
17
|
-
* @param styleLib
|
|
18
|
-
* @param rjsLib
|
|
19
|
-
*/
|
|
20
|
-
export function raw_render(protoType, parent, child, componentController, tagTemplate, tagLib, styleLib, rjsLib) {
|
|
21
|
-
//获取控制对象
|
|
22
|
-
var controller = new ComponentController({
|
|
23
|
-
boxMode: true
|
|
24
|
-
});
|
|
25
|
-
controller.componentConfig["$plugins"] = rjsLib;
|
|
26
|
-
controller.parentController = componentController;
|
|
27
|
-
//解析salt
|
|
28
|
-
resolver_salt(child, controller);
|
|
29
|
-
//控制对象预处理
|
|
30
|
-
controllerCycleTypeTwo(controller, protoType, componentController, tagLib, styleLib);
|
|
31
|
-
//beforeRender,可以获取数据而不触发更新
|
|
32
|
-
protoType.getBeforeRender().call(controller.originalData);
|
|
33
|
-
//解析指令(模板处理)
|
|
34
|
-
cmdUtility(tagTemplate, protoType, controller);
|
|
35
|
-
//mount
|
|
36
|
-
mount(controller, protoType, parent, child, tagTemplate);
|
|
37
|
-
//获取注入引用资源
|
|
38
|
-
injectRefs(controller);
|
|
39
|
-
//渲染后处理
|
|
40
|
-
afterCmd(controller.componentAttachedRootElement, protoType, controller);
|
|
41
|
-
//后处理(数据渲染)
|
|
42
|
-
afterMethodsTypeTwo(controller, child, componentController);
|
|
43
|
-
//afterRender,可以操作渲染后的dom
|
|
44
|
-
protoType.getAfterRender().call(controller.dataForMethod);
|
|
45
|
-
//深度渲染
|
|
46
|
-
findComponent(controller.componentAttachedRootElement.children, controller, tagLib, styleLib, rjsLib);
|
|
47
|
-
if (!protoType.getConfig()["boxMode"]) {
|
|
48
|
-
unBox(controller);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ContextController } from "../controller/ContextController";
|
|
2
|
-
import { Component } from "render-refer";
|
|
3
|
-
/**
|
|
4
|
-
* This function is used to render element below the mount point.
|
|
5
|
-
* @param collection
|
|
6
|
-
* @param contextController
|
|
7
|
-
* @param tagLib
|
|
8
|
-
* @param styleLib
|
|
9
|
-
* @param rjsLib
|
|
10
|
-
*/
|
|
11
|
-
export declare function renderHtml(collection: HTMLCollection, contextController: ContextController, tagLib: Map<string, Component>, styleLib: Map<string, Map<string, string>>, rjsLib: Map<string, any>): void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RenderJS } from "../../index";
|
|
2
|
-
import { Component } from "../../../render-refer/dist";
|
|
3
|
-
/**
|
|
4
|
-
* This function is used to save the prototype component proto in the window object.
|
|
5
|
-
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
6
|
-
* @param application
|
|
7
|
-
* @param component
|
|
8
|
-
*/
|
|
9
|
-
export declare function registerTagLib(application: RenderJS, component: Component | Component[]): void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Component } from "render-refer";
|
|
2
|
-
import { RenderJS } from "../index";
|
|
3
|
-
/**
|
|
4
|
-
* This function is used to save the prototype component proto in the window object.
|
|
5
|
-
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
6
|
-
* @param application
|
|
7
|
-
* @param component
|
|
8
|
-
*/
|
|
9
|
-
export declare function registerTagLib(application: RenderJS, component: Component | Component[]): void;
|
package/runtime/tagProcessor.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This function is used to save the prototype component proto in the window object.
|
|
3
|
-
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
4
|
-
* @param application
|
|
5
|
-
* @param component
|
|
6
|
-
*/
|
|
7
|
-
export function registerTagLib(application, component) {
|
|
8
|
-
if (Array.isArray(component)) {
|
|
9
|
-
//if the input parameter is an array of Component,do the code block.
|
|
10
|
-
component.forEach(function (component) {
|
|
11
|
-
if (!application.tagLib.has(component.getName().toUpperCase())) {
|
|
12
|
-
application.tagLib.set(component.getName().toUpperCase(), component);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
if (!application.tagLib.has(component.getName().toUpperCase())) {
|
|
21
|
-
application.tagLib.set(component.getName().toUpperCase(), component);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../controller/ComponentController";
|
|
2
|
-
import { Component } from "../../../render-refer/dist";
|
|
3
|
-
import { ContextController } from "../../controller/ContextController";
|
|
4
|
-
/**
|
|
5
|
-
* 更新渲染方法
|
|
6
|
-
* @param controller
|
|
7
|
-
* @param tagLib
|
|
8
|
-
* @param styleLib
|
|
9
|
-
*/
|
|
10
|
-
export declare function update_Render(controller: ComponentController | ContextController, tagLib: Map<string, Component>, styleLib: Map<string, Map<string, string>>): void;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { afterCmd, cmdUtility, } from "../../core/utility/cmdUtility";
|
|
2
|
-
import { injectRefs } from "../../core/inject/inject";
|
|
3
|
-
import { findComponent } from "../Delivery";
|
|
4
|
-
import { getTemplate } from "../../core/utility/templateUtility";
|
|
5
|
-
import { mountForUpdate } from "../../core/lifecycle/mount";
|
|
6
|
-
/**
|
|
7
|
-
* 更新渲染方法
|
|
8
|
-
* @param controller
|
|
9
|
-
* @param tagLib
|
|
10
|
-
* @param styleLib
|
|
11
|
-
*/
|
|
12
|
-
export function update_Render(controller, tagLib, styleLib) {
|
|
13
|
-
//生成DOM
|
|
14
|
-
var tagTemplate = getTemplate(controller.prototypeOfComponent);
|
|
15
|
-
//清除保存的发布对象
|
|
16
|
-
controller.slaveComponent = Array();
|
|
17
|
-
//解析指令
|
|
18
|
-
cmdUtility(tagTemplate, controller.prototypeOfComponent, controller);
|
|
19
|
-
//mount
|
|
20
|
-
if (!controller.componentConfig.boxMode) {
|
|
21
|
-
var renderSpace = mountForUpdate(tagTemplate);
|
|
22
|
-
while (controller.begin.nextSibling !== controller.anchor) {
|
|
23
|
-
controller.componentAttachedRootElement.removeChild(controller.begin.nextSibling);
|
|
24
|
-
}
|
|
25
|
-
while (renderSpace.hasChildNodes()) {
|
|
26
|
-
controller.componentAttachedRootElement.insertBefore(renderSpace.firstChild, controller.anchor);
|
|
27
|
-
}
|
|
28
|
-
while (renderSpace.hasChildNodes()) {
|
|
29
|
-
controller.componentAttachedRootElement.insertBefore(renderSpace.firstChild, controller.anchor);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//注入
|
|
33
|
-
injectRefs(controller);
|
|
34
|
-
//渲染后处理
|
|
35
|
-
afterCmd(controller.componentAttachedRootElement, controller.prototypeOfComponent, controller);
|
|
36
|
-
//深度渲染
|
|
37
|
-
findComponent(controller.componentAttachedRootElement.children, controller, tagLib, styleLib, controller.componentConfig["rjsLib"]);
|
|
38
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|