render-core 1.3.71 → 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 +55 -23
- package/index.js +79 -45
- 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/kernel/directive/salt/v-solt.js +46 -0
- 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/system/define/ContextController.d.ts +29 -0
- package/system/define/ContextController.js +23 -0
- package/system/generic/ControllerGeneric.d.ts +21 -0
- 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/injection/injection.js +50 -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/system/lifecycle/mount.js +50 -0
- 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/system/utility/injectUtility.d.ts +4 -0
- package/system/utility/injectUtility.js +14 -0
- package/system/utility/inputType.d.ts +5 -0
- package/system/utility/inputType.js +20 -0
- package/{core → system}/utility/inputUtility.d.ts +1 -0
- package/{core → system}/utility/inputUtility.js +8 -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/sectionUtility.js +18 -15
- package/{core → system}/utility/styleUtility.d.ts +5 -4
- package/{core → system}/utility/styleUtility.js +24 -33
- 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/tension/generic/ComponentGeneric.js +1 -0
- package/tension/generic/HooksGeneric.d.ts +6 -0
- package/tension/generic/HooksGeneric.js +1 -0
- package/tension/generic/OriginalDataGeneric.d.ts +18 -0
- package/tension/generic/OriginalDataGeneric.js +1 -0
- package/tension/generic/PluginGeneric.d.ts +5 -0
- package/tension/generic/PluginGeneric.js +1 -0
- package/tension/generic/PrefaceGeneric.d.ts +6 -0
- package/tension/generic/PrefaceGeneric.js +1 -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/xboot/RenderProcessor.js +29 -0
- package/xboot/TagProcessor.d.ts +7 -0
- package/{runtime → xboot}/TagProcessor.js +6 -6
- package/core/cmd/data/v-el.d.ts +0 -8
- package/core/cmd/data/v-html.d.ts +0 -8
- package/core/cmd/data/v-txt.d.ts +0 -8
- 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-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/cmd/solt/v-solt.js +0 -46
- package/core/inject/inject.d.ts +0 -30
- package/core/inject/inject.js +0 -63
- package/core/lifecycle/afterMethods.d.ts +0 -16
- package/core/lifecycle/afterMethods.js +0 -22
- package/core/lifecycle/controllerCycle.d.ts +0 -13
- package/core/lifecycle/controllerCycle.js +0 -42
- package/core/lifecycle/mount.d.ts +0 -16
- package/core/lifecycle/mount.js +0 -31
- package/core/proxy/getProxy.d.ts +0 -13
- package/core/proxy/getProxy.js +0 -42
- 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 -61
- package/core/utility/checkUtility.js +0 -4
- package/core/utility/cmdUtility.d.ts +0 -16
- package/core/utility/cmdUtility.js +0 -58
- package/core/utility/injectUtility.d.ts +0 -13
- package/core/utility/injectUtility.js +0 -58
- package/core/utility/inputType.d.ts +0 -5
- package/core/utility/inputType.js +0 -20
- package/core/utility/miscUtility.d.ts +0 -6
- package/core/utility/sectionUtility.d.ts +0 -6
- package/generic/RenderGeneric.d.ts +0 -5
- package/http/generic/HttpGeneric.d.ts +0 -2
- 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 -15
- package/proto/controller/ComponentController.js +0 -22
- package/proto/controller/PageController.d.ts +0 -23
- package/proto/controller/PageController.js +0 -40
- package/runtime/Entrance.d.ts +0 -6
- package/runtime/Entrance.js +0 -14
- package/runtime/RenderProcessor.d.ts +0 -7
- package/runtime/RenderProcessor.js +0 -28
- package/runtime/TagProcessor.d.ts +0 -9
- /package/{generic/RenderGeneric.js → system/generic/ControllerGeneric.js} +0 -0
- /package/{http/generic/HttpGeneric.js → 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 → 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/modelUtility.d.ts +0 -0
- /package/{core → system}/utility/modelUtility.js +0 -0
- /package/{core → system}/utility/templateUtility.js +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RouterGeneric } from "../generic/RouterGeneric";
|
|
2
|
+
import { Component } from "../../index";
|
|
3
|
+
export declare class RouterAction implements RouterGeneric {
|
|
4
|
+
private routerTable;
|
|
5
|
+
constructor(routeTable: {
|
|
6
|
+
mode?: string;
|
|
7
|
+
table?: [
|
|
8
|
+
{
|
|
9
|
+
path: string;
|
|
10
|
+
component: Component;
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
});
|
|
14
|
+
getComponentByUrl(url: string): Component;
|
|
15
|
+
getQueriesByUrl(url: string): Map<string, any>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var RouterAction = /** @class */ (function () {
|
|
2
|
+
function RouterAction(routeTable) {
|
|
3
|
+
this.routerTable = routeTable;
|
|
4
|
+
}
|
|
5
|
+
RouterAction.prototype.getComponentByUrl = function (url) {
|
|
6
|
+
return undefined;
|
|
7
|
+
};
|
|
8
|
+
RouterAction.prototype.getQueriesByUrl = function (url) {
|
|
9
|
+
return undefined;
|
|
10
|
+
};
|
|
11
|
+
return RouterAction;
|
|
12
|
+
}());
|
|
13
|
+
export { RouterAction };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { themeStyle } from "../system/utility/styleUtility";
|
|
2
|
+
import { renderHtml } from "./RenderProcessor";
|
|
3
|
+
import { get_context_controller, get_style_library, get_tag_library } from "../system/recorder/table0/system_func_0";
|
|
4
|
+
import { router_listener_with_router, router_listener_without_router } from "../system/router/router";
|
|
5
|
+
/**
|
|
6
|
+
* The entrance of render
|
|
7
|
+
* @param root
|
|
8
|
+
*/
|
|
9
|
+
export function render_for_mpa(root) {
|
|
10
|
+
//获取styleLib对象
|
|
11
|
+
get_tag_library().forEach(function (component) {
|
|
12
|
+
themeStyle(component, get_style_library());
|
|
13
|
+
});
|
|
14
|
+
if (root == null) {
|
|
15
|
+
//开始渲染
|
|
16
|
+
get_context_controller().componentAttachedRootElement = document.body;
|
|
17
|
+
renderHtml(document.children, get_context_controller());
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
var mountPoint = document.getElementById(root);
|
|
21
|
+
if (mountPoint == null) {
|
|
22
|
+
get_context_controller().componentAttachedRootElement = document.body;
|
|
23
|
+
//开始渲染
|
|
24
|
+
console.warn("Mount point not found");
|
|
25
|
+
console.warn("Mount point was selected to body");
|
|
26
|
+
renderHtml(document.body.children, get_context_controller());
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
//开始渲染
|
|
30
|
+
get_context_controller().componentAttachedRootElement = mountPoint;
|
|
31
|
+
renderHtml(mountPoint.children, get_context_controller());
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export function render_for_spa(component) {
|
|
36
|
+
get_tag_library().forEach(function (component) {
|
|
37
|
+
themeStyle(component, get_style_library());
|
|
38
|
+
});
|
|
39
|
+
if (component == null)
|
|
40
|
+
router_listener_with_router(document.querySelector("webview"));
|
|
41
|
+
else
|
|
42
|
+
router_listener_without_router(component, document.querySelector("webview"));
|
|
43
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ContextController } from "../system/define/ContextController";
|
|
2
|
+
/**
|
|
3
|
+
* This function is used to render element below the mount point.
|
|
4
|
+
* @param collection
|
|
5
|
+
* @param contextController
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderHtml(collection: HTMLCollection, contextController: ContextController): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { isUnKnown } from "../system/utility/checkUtility";
|
|
2
|
+
import { get_tag_library } from "../system/recorder/table0/system_func_0";
|
|
3
|
+
import { mpa_delivery } from "../kernel/delivery/delivery";
|
|
4
|
+
/**
|
|
5
|
+
* This function is used to render element below the mount point.
|
|
6
|
+
* @param collection
|
|
7
|
+
* @param contextController
|
|
8
|
+
*/
|
|
9
|
+
export function renderHtml(collection, contextController) {
|
|
10
|
+
//遍历element节点,判断是否为自定义标签
|
|
11
|
+
for (var i = 0; i < collection.length; i++) {
|
|
12
|
+
if (isUnKnown(collection[i].nodeName.toUpperCase())) {
|
|
13
|
+
//从tag库中获取该组件的定义
|
|
14
|
+
var component = get_tag_library().get(collection[i].nodeName.toUpperCase());
|
|
15
|
+
if (typeof component === undefined) {
|
|
16
|
+
//没有找到定义,向控制台输出警告
|
|
17
|
+
console.error(collection[i].nodeName.toUpperCase() + " can't be found in renderJs, you should firstly register in renderJs");
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
//找到,渲染自定义标签
|
|
21
|
+
mpa_delivery(component, collection[i].parentNode, collection[i], contextController);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
//非自定义标签,深度解析
|
|
26
|
+
renderHtml(collection[i].children, contextController);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Component } from "../index";
|
|
2
|
+
/**
|
|
3
|
+
* This function is used to save the prototype component proto in the window object.
|
|
4
|
+
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
5
|
+
* @param component
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerTagLib(component: Component | Component[]): void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { get_tag_library } from "../system/recorder/table0/system_func_0";
|
|
1
2
|
/**
|
|
2
3
|
* This function is used to save the prototype component proto in the window object.
|
|
3
4
|
* So, you can hava a tip that we custom a property named 'tagLib' in the window object.
|
|
4
|
-
* @param application
|
|
5
5
|
* @param component
|
|
6
6
|
*/
|
|
7
|
-
export function registerTagLib(
|
|
7
|
+
export function registerTagLib(component) {
|
|
8
8
|
if (Array.isArray(component)) {
|
|
9
9
|
//if the input parameter is an array of Component,do the code block.
|
|
10
10
|
component.forEach(function (component) {
|
|
11
|
-
if (!
|
|
12
|
-
|
|
11
|
+
if (!get_tag_library().has(component.getName().toUpperCase())) {
|
|
12
|
+
get_tag_library().set(component.getName().toUpperCase(), component);
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
15
|
console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
|
|
@@ -17,8 +17,8 @@ export function registerTagLib(application, component) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
|
-
if (!
|
|
21
|
-
|
|
20
|
+
if (!get_tag_library().has(component.getName().toUpperCase())) {
|
|
21
|
+
get_tag_library().set(component.getName().toUpperCase(), component);
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
24
|
console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
|
package/core/cmd/data/v-el.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../../proto/controller/ComponentController";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param node
|
|
5
|
-
* @param data
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_expression(node: ParentNode, data: {}, controller: ComponentController): void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../../proto/controller/ComponentController";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param elements
|
|
5
|
-
* @param data
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_html(elements: HTMLCollection, data: {}, controller: ComponentController): void;
|
package/core/cmd/data/v-txt.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../../proto/controller/ComponentController";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param elements
|
|
5
|
-
* @param data
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_txt(elements: HTMLCollection, data: {}, controller: ComponentController): void;
|
package/core/cmd/loop/v-map.d.ts
DELETED
package/core/cmd/ref/v-ref.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../../proto/controller/ComponentController";
|
|
2
|
-
import { PageController } from "../../../proto/controller/PageController";
|
|
3
|
-
/**
|
|
4
|
-
* 此函数用于解析自定义元素solt
|
|
5
|
-
* @param tagTemplate
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_solt(tagTemplate: Element, controller: ComponentController | PageController): void;
|
|
9
|
-
/**
|
|
10
|
-
* 此函数用于展开solt
|
|
11
|
-
* @param elements
|
|
12
|
-
* @param controller
|
|
13
|
-
*/
|
|
14
|
-
export declare function extract_solt(elements: HTMLCollection, controller: ComponentController | PageController): void;
|
package/core/cmd/solt/v-solt.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 此函数用于解析自定义元素solt
|
|
3
|
-
* @param tagTemplate
|
|
4
|
-
* @param controller
|
|
5
|
-
*/
|
|
6
|
-
export function resolver_solt(tagTemplate, controller) {
|
|
7
|
-
if (tagTemplate.hasChildNodes()) {
|
|
8
|
-
var list = tagTemplate.querySelectorAll("solt");
|
|
9
|
-
if (list.length !== 0) {
|
|
10
|
-
list.forEach(function (value) {
|
|
11
|
-
if (value.hasAttribute("name")) {
|
|
12
|
-
controller.solt.set(value.getAttribute("name"), value.innerHTML);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
controller.solt.set("default", value.innerHTML);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
controller.solt.set("default", tagTemplate.innerHTML);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* 此函数用于展开solt
|
|
26
|
-
* @param elements
|
|
27
|
-
* @param controller
|
|
28
|
-
*/
|
|
29
|
-
export function extract_solt(elements, controller) {
|
|
30
|
-
for (var i = 0; i < elements.length; i++) {
|
|
31
|
-
var result = elements[i].hasAttribute("@solt");
|
|
32
|
-
if (result) {
|
|
33
|
-
var dataName = elements[i].getAttribute("@solt");
|
|
34
|
-
elements[i].removeAttribute("@solt");
|
|
35
|
-
if (!dataName) {
|
|
36
|
-
elements[i].innerHTML = controller.solt.get("default");
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
elements[i].innerHTML = controller.solt.get(dataName);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//深度解析
|
|
44
|
-
extract_solt(elements[i].children, controller);
|
|
45
|
-
}
|
|
46
|
-
}
|
package/core/inject/inject.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../proto/controller/ComponentController";
|
|
2
|
-
import { Component } from "render-refer";
|
|
3
|
-
/**
|
|
4
|
-
* 向raw_data中注入props和Query
|
|
5
|
-
* @param controller
|
|
6
|
-
*/
|
|
7
|
-
export declare function inject(controller: ComponentController): void;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param controller
|
|
11
|
-
*/
|
|
12
|
-
export declare function injectRefs(controller: ComponentController): void;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param controller
|
|
16
|
-
* @param proto
|
|
17
|
-
*/
|
|
18
|
-
export declare function injectMethod(controller: ComponentController, proto: Component): void;
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param controller
|
|
22
|
-
* @param proto
|
|
23
|
-
*/
|
|
24
|
-
export declare function injectWatcher(controller: ComponentController, proto: Component): void;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param controller
|
|
28
|
-
* @param proto
|
|
29
|
-
*/
|
|
30
|
-
export declare function injectComputed(controller: ComponentController, proto: Component): void;
|
package/core/inject/inject.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../proto/controller/ComponentController";
|
|
2
|
-
import { PageController } from "../../proto/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 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../proto/controller/ComponentController";
|
|
2
|
-
import { PageController } from "../../proto/controller/PageController";
|
|
3
|
-
import { Component } from "render-refer";
|
|
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 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../proto/controller/ComponentController";
|
|
2
|
-
import { Component } from "render-refer";
|
|
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
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
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/proxy/getProxy.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../proto/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
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import { ComponentController } from "../../proto/controller/ComponentController";
|
|
2
|
-
import { PageController } from "../../proto/controller/PageController";
|
|
3
|
-
import { Component } from "render-refer";
|
|
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;
|