render-core 1.4.8 → 1.4.10
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 +14 -8
- package/index.js +18 -13
- package/kernel/delivery/delivery.js +3 -3
- package/kernel/directive/property/v-bind.js +2 -2
- package/kernel/directive/react/v-model.js +1 -1
- package/kernel/proxyer/getProxy.d.ts +0 -3
- package/kernel/proxyer/getProxy.js +3 -7
- package/kernel/renderer/initRender.js +9 -10
- package/kernel/renderer/postRender.js +10 -11
- package/kernel/renderer/rawRender.js +10 -11
- package/kernel/renderer/updateRender.js +14 -13
- package/kernel/router/router.js +3 -3
- package/package.json +1 -4
- package/system/generic/component/ComponentGeneric.d.ts +1 -1
- package/system/generic/controller/ControllerGeneric.d.ts +10 -4
- package/system/generic/data/ComputedDataGeneric.d.ts +13 -0
- package/system/generic/data/ComputedDataGeneric.js +1 -0
- package/system/generic/data/WatcherDataGeneric.d.ts +13 -0
- package/system/generic/data/WatcherDataGeneric.js +1 -0
- package/system/injection/injection.d.ts +8 -3
- package/system/injection/injection.js +22 -12
- package/system/injection/injector.d.ts +30 -0
- package/system/injection/injector.js +77 -0
- package/system/lifecycle/mount.js +5 -8
- package/system/loader/loader.js +1 -1
- package/system/output/errorUtility.d.ts +3 -0
- package/system/output/errorUtility.js +9 -0
- package/system/prototype/ContextController.d.ts +9 -8
- package/system/prototype/ContextController.js +1 -7
- package/system/recorder/table2/system_func_2.d.ts +5 -0
- package/system/recorder/table2/system_func_2.js +8 -0
- package/system/utility/data/dataUtility.d.ts +5 -0
- package/system/utility/data/dataUtility.js +12 -0
- package/system/utility/directive/cmdUtility.d.ts +15 -0
- package/system/utility/directive/cmdUtility.js +43 -0
- package/system/utility/initiate/miscUtility.d.ts +6 -0
- package/system/utility/initiate/miscUtility.js +12 -0
- package/system/utility/initiate/templateUtility.d.ts +6 -0
- package/system/utility/initiate/templateUtility.js +11 -0
- package/system/utility/react/inputType.d.ts +25 -0
- package/system/utility/react/inputType.js +40 -0
- package/system/utility/react/inputUtility.d.ts +19 -0
- package/system/utility/react/inputUtility.js +125 -0
- package/system/utility/react/modelUtility.d.ts +15 -0
- package/system/utility/react/modelUtility.js +64 -0
- package/system/utility/react/sectionUtility.d.ts +6 -0
- package/system/utility/react/sectionUtility.js +123 -0
- package/system/utility/style/styleUtility.d.ts +29 -0
- package/system/utility/style/styleUtility.js +102 -0
- package/tension/prototype/AbstractComponent.d.ts +1 -1
- package/tension/prototype/HooksAction.js +1 -1
- package/xboot/Entrance.d.ts +3 -3
- package/xboot/Entrance.js +4 -5
- package/xboot/RenderProcessor.js +2 -2
- package/xboot/TagProcessor.js +4 -8
package/index.d.ts
CHANGED
|
@@ -16,16 +16,22 @@ export declare class PropertyType {
|
|
|
16
16
|
static JSON: 'json';
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* This abstract class is the plugin interface class for those who want to develop plugin for the system
|
|
20
20
|
*/
|
|
21
21
|
export declare abstract class AbstractPlugin implements PluginGeneric {
|
|
22
22
|
plugin(preface: PrefaceGeneric, hooks: HooksGeneric): void;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* This abstract class is the router interface class for those who want to develop router for the system
|
|
26
26
|
*/
|
|
27
27
|
export declare abstract class AbstractRouter implements RouterGeneric {
|
|
28
|
+
/**
|
|
29
|
+
* The method must be overwritten by developer
|
|
30
|
+
*/
|
|
28
31
|
getComponent(): Component;
|
|
32
|
+
/**
|
|
33
|
+
* The method must be overwritten by developer
|
|
34
|
+
*/
|
|
29
35
|
getPathVariable(): Map<string, any>;
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
@@ -48,12 +54,6 @@ export declare class Component extends AbstractComponent {
|
|
|
48
54
|
afterRender?: () => void;
|
|
49
55
|
});
|
|
50
56
|
}
|
|
51
|
-
/**
|
|
52
|
-
* This func is used to extend window environment
|
|
53
|
-
* @param on
|
|
54
|
-
* @param func
|
|
55
|
-
*/
|
|
56
|
-
export declare function extend_window(on: string, func: any): void;
|
|
57
57
|
/**
|
|
58
58
|
* This proto is the application proto.
|
|
59
59
|
*/
|
|
@@ -82,3 +82,9 @@ export declare class RenderJS implements RenderGeneric {
|
|
|
82
82
|
*/
|
|
83
83
|
weave(mounter: string): void;
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* This func is used to extend window environment
|
|
87
|
+
* @param on
|
|
88
|
+
* @param func
|
|
89
|
+
*/
|
|
90
|
+
export declare function extend_window(on: string, func: any): void;
|
package/index.js
CHANGED
|
@@ -31,27 +31,32 @@ var PropertyType = /** @class */ (function () {
|
|
|
31
31
|
}());
|
|
32
32
|
export { PropertyType };
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* This abstract class is the plugin interface class for those who want to develop plugin for the system
|
|
35
35
|
*/
|
|
36
36
|
var AbstractPlugin = /** @class */ (function () {
|
|
37
37
|
function AbstractPlugin() {
|
|
38
38
|
}
|
|
39
|
-
AbstractPlugin.prototype.plugin = function (preface, hooks) {
|
|
40
|
-
};
|
|
39
|
+
AbstractPlugin.prototype.plugin = function (preface, hooks) { };
|
|
41
40
|
return AbstractPlugin;
|
|
42
41
|
}());
|
|
43
42
|
export { AbstractPlugin };
|
|
44
43
|
/**
|
|
45
|
-
*
|
|
44
|
+
* This abstract class is the router interface class for those who want to develop router for the system
|
|
46
45
|
*/
|
|
47
46
|
var AbstractRouter = /** @class */ (function () {
|
|
48
47
|
function AbstractRouter() {
|
|
49
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* The method must be overwritten by developer
|
|
51
|
+
*/
|
|
50
52
|
AbstractRouter.prototype.getComponent = function () {
|
|
51
53
|
return undefined;
|
|
52
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* The method must be overwritten by developer
|
|
57
|
+
*/
|
|
53
58
|
AbstractRouter.prototype.getPathVariable = function () {
|
|
54
|
-
return
|
|
59
|
+
return new Map();
|
|
55
60
|
};
|
|
56
61
|
return AbstractRouter;
|
|
57
62
|
}());
|
|
@@ -67,14 +72,6 @@ var Component = /** @class */ (function (_super) {
|
|
|
67
72
|
return Component;
|
|
68
73
|
}(AbstractComponent));
|
|
69
74
|
export { Component };
|
|
70
|
-
/**
|
|
71
|
-
* This func is used to extend window environment
|
|
72
|
-
* @param on
|
|
73
|
-
* @param func
|
|
74
|
-
*/
|
|
75
|
-
export function extend_window(on, func) {
|
|
76
|
-
Reflect.set(window, on, func);
|
|
77
|
-
}
|
|
78
75
|
/**
|
|
79
76
|
* This proto is the application proto.
|
|
80
77
|
*/
|
|
@@ -124,3 +121,11 @@ var RenderJS = /** @class */ (function () {
|
|
|
124
121
|
return RenderJS;
|
|
125
122
|
}());
|
|
126
123
|
export { RenderJS };
|
|
124
|
+
/**
|
|
125
|
+
* This func is used to extend window environment
|
|
126
|
+
* @param on
|
|
127
|
+
* @param func
|
|
128
|
+
*/
|
|
129
|
+
export function extend_window(on, func) {
|
|
130
|
+
Reflect.set(window, on, func);
|
|
131
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
|
-
import { isUnKnown } from "../../system/utility/checkUtility";
|
|
3
2
|
import { get_tag_library, set_context_controller } from "../../system/recorder/table0/system_func_0";
|
|
4
3
|
import { init_renderer } from "../renderer/initRender";
|
|
5
4
|
import { post_renderer } from "../renderer/postRender";
|
|
6
5
|
import { raw_renderer } from "../renderer/rawRender";
|
|
7
6
|
import { renderHtml } from "../../xboot/renderProcessor";
|
|
7
|
+
import { tag_unknown_check } from "../../system/recorder/table2/system_func_2";
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
* @param protoTypeComponent
|
|
@@ -48,7 +48,7 @@ export function mpa_delivery(protoTypeComponent, componentAttachedRootElement, c
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
if (
|
|
51
|
+
if (tag_unknown_check(child.nodeName.toUpperCase())) {
|
|
52
52
|
//从tag库中获取该组件的定义
|
|
53
53
|
var component = get_tag_library().get(child.nodeName.toUpperCase());
|
|
54
54
|
if (!component) {
|
|
@@ -73,7 +73,7 @@ export function mpa_delivery(protoTypeComponent, componentAttachedRootElement, c
|
|
|
73
73
|
*/
|
|
74
74
|
export function findComponent(collection, parentController) {
|
|
75
75
|
for (var i = 0; i < collection.length; i++) {
|
|
76
|
-
if (
|
|
76
|
+
if (tag_unknown_check(collection[i].nodeName)) {
|
|
77
77
|
mpa_delivery(get_tag_library().get(collection[i].nodeName.toUpperCase()), collection[i].parentNode, collection[i], parentController);
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tag_unknown_check } from "../../../system/recorder/table2/system_func_2";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param nodes
|
|
@@ -7,7 +7,7 @@ import { isUnKnown } from "../../../system/utility/checkUtility";
|
|
|
7
7
|
export function parse_directive_bind(nodes, data) {
|
|
8
8
|
for (var i = 0; i < nodes.length; i++) {
|
|
9
9
|
//对系统元素进行属性绑定
|
|
10
|
-
if (!
|
|
10
|
+
if (!tag_unknown_check(nodes[i].nodeName)) {
|
|
11
11
|
var attributes = nodes[i].getAttributeNames();
|
|
12
12
|
for (var j = 0; j < attributes.length; j++) {
|
|
13
13
|
var result = attributes[j].match(/^@bind:([a-z]+)$/g);
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
2
|
/**
|
|
3
|
-
* 获取data对象的代理对象
|
|
4
3
|
* @param data
|
|
5
4
|
* @param updater
|
|
6
5
|
*/
|
|
7
6
|
export declare function get_proxy_for_method(data: {}, updater: ContextController): any;
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
10
8
|
* @param origin
|
|
11
9
|
*/
|
|
12
10
|
export declare function get_proxy_for_watcher(origin: object): object;
|
|
13
11
|
/**
|
|
14
|
-
*
|
|
15
12
|
* @param origin
|
|
16
13
|
*/
|
|
17
14
|
export declare function get_proxy_for_computed(origin: object): object;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { update_Render } from "../renderer/updateRender";
|
|
2
|
-
import { locateInputAddress } from "../../system/utility/sectionUtility";
|
|
2
|
+
import { locateInputAddress } from "../../system/utility/react/sectionUtility";
|
|
3
3
|
/**
|
|
4
|
-
* 获取data对象的代理对象
|
|
5
4
|
* @param data
|
|
6
5
|
* @param updater
|
|
7
6
|
*/
|
|
@@ -11,18 +10,17 @@ export function get_proxy_for_method(data, updater) {
|
|
|
11
10
|
return new Proxy(data, handel);
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
13
|
* @param updater
|
|
16
14
|
*/
|
|
17
15
|
function get_setter_for_method_proxy(updater) {
|
|
18
16
|
var setter = function (obj, prop, value) {
|
|
17
|
+
Reflect.set(obj, prop, value);
|
|
18
|
+
update_Render(this);
|
|
19
19
|
try {
|
|
20
20
|
this.watcher[prop](obj[prop], value);
|
|
21
21
|
}
|
|
22
22
|
catch (error) {
|
|
23
23
|
}
|
|
24
|
-
Reflect.set(obj, prop, value);
|
|
25
|
-
update_Render(this);
|
|
26
24
|
locateInputAddress(this);
|
|
27
25
|
Reflect.deleteProperty(this, "origin");
|
|
28
26
|
return true;
|
|
@@ -30,7 +28,6 @@ function get_setter_for_method_proxy(updater) {
|
|
|
30
28
|
return setter.bind(updater);
|
|
31
29
|
}
|
|
32
30
|
/**
|
|
33
|
-
*
|
|
34
31
|
* @param origin
|
|
35
32
|
*/
|
|
36
33
|
export function get_proxy_for_watcher(origin) {
|
|
@@ -38,7 +35,6 @@ export function get_proxy_for_watcher(origin) {
|
|
|
38
35
|
return new Proxy(origin, handles);
|
|
39
36
|
}
|
|
40
37
|
/**
|
|
41
|
-
*
|
|
42
38
|
* @param origin
|
|
43
39
|
*/
|
|
44
40
|
export function get_proxy_for_computed(origin) {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
|
-
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/cmdUtility";
|
|
2
|
+
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/directive/cmdUtility";
|
|
3
3
|
import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
|
|
4
|
-
import { inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugin_to_data, inject_$props_to_data, inject_$refs_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/
|
|
4
|
+
import { inject_$commit_to_data, inject_$getter_to_data, inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugin_to_data, inject_$props_to_data, inject_$publish_to_data, inject_$refs_to_data, inject_$setter_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/injector";
|
|
5
5
|
import { after_process_for_init } from "../../system/lifecycle/lifeCycle";
|
|
6
6
|
import { findComponent } from "../delivery/delivery";
|
|
7
|
-
import { getTemplate } from "../../system/utility/templateUtility";
|
|
8
|
-
import { loader_tag_style } from "../../system/utility/styleUtility";
|
|
7
|
+
import { getTemplate } from "../../system/utility/initiate/templateUtility";
|
|
8
|
+
import { loader_tag_style } from "../../system/utility/style/styleUtility";
|
|
9
9
|
import { get_style_library } from "../../system/recorder/table0/system_func_0";
|
|
10
10
|
import { get_proxy_for_computed, get_proxy_for_method, get_proxy_for_watcher } from "../proxyer/getProxy";
|
|
11
|
-
import {
|
|
12
|
-
import { getCommitMethod, getGetterMethod, getPublishMethod } from "../../system/injection/injection";
|
|
11
|
+
import { get_commit_method, get_getter_method, get_publish_method, get_setter_method } from "../../system/injection/injection";
|
|
13
12
|
import { parse_directive_salt_collect } from "../directive/salt/v-solt";
|
|
14
13
|
/**
|
|
15
14
|
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
@@ -42,14 +41,14 @@ export function init_renderer(protoType, parent, child, parentController) {
|
|
|
42
41
|
inject_$plugin_to_data(currentController.originalData);
|
|
43
42
|
inject_$http_to_data(currentController.originalData);
|
|
44
43
|
inject_$pathVariable_to_data(currentController.originalData);
|
|
44
|
+
inject_$commit_to_data(currentController.originalData, get_commit_method(currentController));
|
|
45
|
+
inject_$publish_to_data(currentController.originalData, get_publish_method(currentController));
|
|
46
|
+
inject_$setter_to_data(currentController.originalData, get_setter_method(currentController));
|
|
47
|
+
inject_$getter_to_data(currentController.originalData, get_getter_method(currentController));
|
|
45
48
|
/* initiate method, computed, watcher */
|
|
46
49
|
inject_method_to_data(currentController, protoType);
|
|
47
50
|
inject_computed_to_controller(currentController, protoType);
|
|
48
51
|
inject_watcher_to_controller(currentController, protoType);
|
|
49
|
-
//注入commit
|
|
50
|
-
getCodeSpaceForCommit(currentController.originalData, getCommitMethod(parentController));
|
|
51
|
-
getCodeSpaceForPublish(currentController.originalData, getPublishMethod(currentController));
|
|
52
|
-
getGetCodeSpaceForProperty(currentController.originalData, getGetterMethod(currentController));
|
|
53
52
|
protoType.getBeforeRender().apply(currentController.originalData, null);
|
|
54
53
|
/* directive parse before */
|
|
55
54
|
directive_parse_collection_for_before(tagTemplate, protoType, currentController);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
|
-
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/cmdUtility";
|
|
2
|
+
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/directive/cmdUtility";
|
|
3
3
|
import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
|
|
4
|
-
import { inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugin_to_data, inject_$props_to_data, inject_$refs_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/
|
|
4
|
+
import { inject_$commit_to_data, inject_$getter_to_data, inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugin_to_data, inject_$props_to_data, inject_$publish_to_data, inject_$refs_to_data, inject_$setter_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/injector";
|
|
5
5
|
import { after_process_for_post } from "../../system/lifecycle/lifeCycle";
|
|
6
6
|
import { findComponent } from "../delivery/delivery";
|
|
7
7
|
import { parse_directive_salt_collect } from "../directive/salt/v-solt";
|
|
8
|
-
import { getTemplate } from "../../system/utility/templateUtility";
|
|
9
|
-
import { loader_tag_style } from "../../system/utility/styleUtility";
|
|
8
|
+
import { getTemplate } from "../../system/utility/initiate/templateUtility";
|
|
9
|
+
import { loader_tag_style } from "../../system/utility/style/styleUtility";
|
|
10
10
|
import { get_style_library } from "../../system/recorder/table0/system_func_0";
|
|
11
11
|
import { get_proxy_for_computed, get_proxy_for_method, get_proxy_for_watcher } from "../proxyer/getProxy";
|
|
12
|
-
import { dataInject } from "../../system/utility/dataUtility";
|
|
13
|
-
import {
|
|
14
|
-
import { getCommitMethod, getGetterMethod, getPublishMethod } from "../../system/injection/injection";
|
|
12
|
+
import { dataInject } from "../../system/utility/data/dataUtility";
|
|
13
|
+
import { get_commit_method, get_getter_method, get_publish_method, get_setter_method } from "../../system/injection/injection";
|
|
15
14
|
/**
|
|
16
15
|
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
17
16
|
* @param protoType
|
|
@@ -43,10 +42,10 @@ export function post_renderer(protoType, parent, child, parentController) {
|
|
|
43
42
|
inject_$plugin_to_data(currentController.originalData);
|
|
44
43
|
inject_$http_to_data(currentController.originalData);
|
|
45
44
|
inject_$pathVariable_to_data(currentController.originalData);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
inject_$commit_to_data(currentController.originalData, get_commit_method(currentController));
|
|
46
|
+
inject_$publish_to_data(currentController.originalData, get_publish_method(currentController));
|
|
47
|
+
inject_$setter_to_data(currentController.originalData, get_setter_method(currentController));
|
|
48
|
+
inject_$getter_to_data(currentController.originalData, get_getter_method(currentController));
|
|
50
49
|
/* initiate method, computed, watcher */
|
|
51
50
|
inject_method_to_data(currentController, protoType);
|
|
52
51
|
inject_computed_to_controller(currentController, protoType);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
|
-
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/cmdUtility";
|
|
2
|
+
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/directive/cmdUtility";
|
|
3
3
|
import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
|
|
4
|
-
import { inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugin_to_data, inject_$props_to_data, inject_$refs_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/
|
|
4
|
+
import { inject_$commit_to_data, inject_$getter_to_data, inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugin_to_data, inject_$props_to_data, inject_$publish_to_data, inject_$refs_to_data, inject_$setter_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/injector";
|
|
5
5
|
import { after_process_for_post } from "../../system/lifecycle/lifeCycle";
|
|
6
6
|
import { findComponent } from "../delivery/delivery";
|
|
7
7
|
import { parse_directive_salt_collect } from "../directive/salt/v-solt";
|
|
8
|
-
import { getTemplate } from "../../system/utility/templateUtility";
|
|
9
|
-
import { loader_tag_style } from "../../system/utility/styleUtility";
|
|
8
|
+
import { getTemplate } from "../../system/utility/initiate/templateUtility";
|
|
9
|
+
import { loader_tag_style } from "../../system/utility/style/styleUtility";
|
|
10
10
|
import { get_style_library } from "../../system/recorder/table0/system_func_0";
|
|
11
11
|
import { get_proxy_for_computed, get_proxy_for_method, get_proxy_for_watcher } from "../proxyer/getProxy";
|
|
12
|
-
import { dataInject } from "../../system/utility/dataUtility";
|
|
13
|
-
import {
|
|
14
|
-
import { getCommitMethod, getGetterMethod, getPublishMethod } from "../../system/injection/injection";
|
|
12
|
+
import { dataInject } from "../../system/utility/data/dataUtility";
|
|
13
|
+
import { get_commit_method, get_getter_method, get_publish_method, get_setter_method } from "../../system/injection/injection";
|
|
15
14
|
/**
|
|
16
15
|
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
17
16
|
* @param protoType
|
|
@@ -43,10 +42,10 @@ export function raw_renderer(protoType, parent, child, parentController) {
|
|
|
43
42
|
inject_$plugin_to_data(currentController.originalData);
|
|
44
43
|
inject_$http_to_data(currentController.originalData);
|
|
45
44
|
inject_$pathVariable_to_data(currentController.originalData);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
inject_$commit_to_data(currentController.originalData, get_commit_method(currentController));
|
|
46
|
+
inject_$publish_to_data(currentController.originalData, get_publish_method(currentController));
|
|
47
|
+
inject_$setter_to_data(currentController.originalData, get_setter_method(currentController));
|
|
48
|
+
inject_$getter_to_data(currentController.originalData, get_getter_method(currentController));
|
|
50
49
|
/* initiate method, computed, watcher */
|
|
51
50
|
inject_method_to_data(currentController, protoType);
|
|
52
51
|
inject_computed_to_controller(currentController, protoType);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { directive_parse_collection_for_after, directive_parse_collection_for_before, } from "../../system/utility/cmdUtility";
|
|
2
|
-
import { inject_$refs_to_data } from "../../system/injection/
|
|
1
|
+
import { directive_parse_collection_for_after, directive_parse_collection_for_before, } from "../../system/utility/directive/cmdUtility";
|
|
2
|
+
import { inject_$refs_to_data } from "../../system/injection/injector";
|
|
3
3
|
import { findComponent } from "../delivery/delivery";
|
|
4
|
-
import { getTemplate } from "../../system/utility/templateUtility";
|
|
5
|
-
import { mountForUpdate } from "../../system/lifecycle/mount";
|
|
4
|
+
import { getTemplate } from "../../system/utility/initiate/templateUtility";
|
|
5
|
+
import { archive_mount, mountForUpdate } from "../../system/lifecycle/mount";
|
|
6
6
|
/**
|
|
7
7
|
* 更新渲染方法
|
|
8
8
|
* @param currentController
|
|
@@ -16,15 +16,16 @@ export function update_Render(currentController) {
|
|
|
16
16
|
//mount
|
|
17
17
|
if (!currentController.componentConfig.boxMode) {
|
|
18
18
|
var renderSpace = mountForUpdate(tagTemplate);
|
|
19
|
-
while (currentController.
|
|
20
|
-
currentController.componentAttachedRootElement.removeChild(currentController.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
while (currentController.anchorBegin.nextSibling !== currentController.anchorEnd)
|
|
20
|
+
currentController.componentAttachedRootElement.removeChild(currentController.anchorBegin.nextSibling);
|
|
21
|
+
while (renderSpace.hasChildNodes())
|
|
22
|
+
currentController.componentAttachedRootElement.insertBefore(renderSpace.firstChild, currentController.anchorEnd);
|
|
23
|
+
while (renderSpace.hasChildNodes())
|
|
24
|
+
currentController.componentAttachedRootElement.insertBefore(renderSpace.firstChild, currentController.anchorEnd);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
archive_mount(currentController, currentController.prototypeOfComponent, currentController.componentAttachedRootElement.parentNode, currentController.componentAttachedRootElement, tagTemplate);
|
|
28
29
|
}
|
|
29
30
|
//渲染后处理
|
|
30
31
|
directive_parse_collection_for_after(currentController.componentAttachedRootElement, currentController);
|
package/kernel/router/router.js
CHANGED
|
@@ -8,7 +8,7 @@ import { set_path_variable } from "../../system/recorder/table1/system_func_1";
|
|
|
8
8
|
*/
|
|
9
9
|
export function router_listener_with_router(view) {
|
|
10
10
|
if (!get_system_ext_router())
|
|
11
|
-
console.
|
|
11
|
+
console.warn("Router not supported");
|
|
12
12
|
else {
|
|
13
13
|
if (view !== null) {
|
|
14
14
|
var controller = get_context_controller();
|
|
@@ -19,7 +19,7 @@ export function router_listener_with_router(view) {
|
|
|
19
19
|
spa_delivery(component, view.parentNode, view, controller);
|
|
20
20
|
}
|
|
21
21
|
else
|
|
22
|
-
console.
|
|
22
|
+
console.warn("Without view element to render");
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -33,5 +33,5 @@ export function router_listener_without_router(component, mounter) {
|
|
|
33
33
|
spa_delivery(component, mounter.parentNode, mounter, controller);
|
|
34
34
|
}
|
|
35
35
|
else
|
|
36
|
-
console.
|
|
36
|
+
console.warn("Without mounter element to render");
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "render-core",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"description": "The extendable javascript web framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc"
|
|
9
|
-
},
|
|
10
7
|
"repository": {
|
|
11
8
|
"type": "git",
|
|
12
9
|
"url": "https://github.com//render-js/render-core.git"
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { ContextController } from "../../prototype/ContextController";
|
|
2
2
|
import { Component } from "../../../index";
|
|
3
|
+
import { OriginalDataGeneric } from "../data/OriginalDataGeneric";
|
|
4
|
+
/**
|
|
5
|
+
* The class is the prototype of controller
|
|
6
|
+
*/
|
|
3
7
|
export interface ControllerGeneric {
|
|
4
8
|
componentAttachedRootElement: ParentNode;
|
|
5
9
|
prototypeOfComponent: Component;
|
|
6
10
|
parentController: ContextController;
|
|
11
|
+
anchorBegin: HTMLElement;
|
|
12
|
+
anchorEnd: HTMLElement;
|
|
7
13
|
componentConfig: {
|
|
8
14
|
boxMode: boolean;
|
|
9
15
|
};
|
|
10
|
-
originalData:
|
|
11
|
-
dataForMethod:
|
|
12
|
-
dataForComputed:
|
|
16
|
+
originalData: OriginalDataGeneric;
|
|
17
|
+
dataForMethod: OriginalDataGeneric;
|
|
18
|
+
dataForComputed: OriginalDataGeneric;
|
|
19
|
+
dataForWatcher: OriginalDataGeneric;
|
|
13
20
|
salt: Map<string, any>;
|
|
14
21
|
lazyComponent: Map<string, {}>;
|
|
15
22
|
slaveComponent: ContextController[];
|
|
@@ -17,5 +24,4 @@ export interface ControllerGeneric {
|
|
|
17
24
|
computed: {};
|
|
18
25
|
watcher: {};
|
|
19
26
|
receiver(method: string, ...args: any[]): any;
|
|
20
|
-
flush(): void;
|
|
21
27
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpAction } from "../../prototype/HttpAction";
|
|
2
|
+
export interface ComputedDataGeneric {
|
|
3
|
+
$name?: string;
|
|
4
|
+
$props?: Map<string, any>;
|
|
5
|
+
$params?: Map<string, any>;
|
|
6
|
+
$refs?: Map<string, any>;
|
|
7
|
+
$pathVariable?: Map<string, any>;
|
|
8
|
+
$http?: HttpAction;
|
|
9
|
+
$plugin?: (plugin: string) => any;
|
|
10
|
+
$commit?: (method: string, ...args: [any]) => void;
|
|
11
|
+
$publish?: (method: string, ...args: [any]) => void;
|
|
12
|
+
$get?: (name: string) => any;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpAction } from "../../prototype/HttpAction";
|
|
2
|
+
export interface WatcherDataGeneric {
|
|
3
|
+
$name?: string;
|
|
4
|
+
$props?: Map<string, any>;
|
|
5
|
+
$params?: Map<string, any>;
|
|
6
|
+
$refs?: Map<string, any>;
|
|
7
|
+
$pathVariable?: Map<string, any>;
|
|
8
|
+
$http?: HttpAction;
|
|
9
|
+
$plugin?: (plugin: string) => any;
|
|
10
|
+
$commit?: (method: string, ...args: [any]) => void;
|
|
11
|
+
$publish?: (method: string, ...args: [any]) => void;
|
|
12
|
+
$get?: (name: string) => any;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,14 +3,19 @@ import { ContextController } from "../prototype/ContextController";
|
|
|
3
3
|
*
|
|
4
4
|
* @param controller
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function get_commit_method(controller: ContextController): any;
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
* @param controller
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function get_publish_method(controller: ContextController): any;
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
14
|
* @param controller
|
|
15
15
|
*/
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function get_getter_method(controller: ContextController): any;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param controller
|
|
20
|
+
*/
|
|
21
|
+
export declare function get_setter_method(controller: ContextController): any;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
*
|
|
3
3
|
* @param controller
|
|
4
4
|
*/
|
|
5
|
-
export function
|
|
5
|
+
export function get_commit_method(controller) {
|
|
6
6
|
var commit = function (method) {
|
|
7
7
|
var args = [];
|
|
8
8
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -16,17 +16,7 @@ export function getCommitMethod(controller) {
|
|
|
16
16
|
*
|
|
17
17
|
* @param controller
|
|
18
18
|
*/
|
|
19
|
-
export function
|
|
20
|
-
var getter = function (property) {
|
|
21
|
-
return this[property];
|
|
22
|
-
};
|
|
23
|
-
return getter.bind(controller.componentConfig);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param controller
|
|
28
|
-
*/
|
|
29
|
-
export function getPublishMethod(controller) {
|
|
19
|
+
export function get_publish_method(controller) {
|
|
30
20
|
var publisher = function (method) {
|
|
31
21
|
var args = [];
|
|
32
22
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -38,3 +28,23 @@ export function getPublishMethod(controller) {
|
|
|
38
28
|
};
|
|
39
29
|
return publisher.bind(controller);
|
|
40
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param controller
|
|
34
|
+
*/
|
|
35
|
+
export function get_getter_method(controller) {
|
|
36
|
+
var getter = function (property) {
|
|
37
|
+
return this[property];
|
|
38
|
+
};
|
|
39
|
+
return getter.bind(controller.componentConfig);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param controller
|
|
44
|
+
*/
|
|
45
|
+
export function get_setter_method(controller) {
|
|
46
|
+
var setter = function (property, value) {
|
|
47
|
+
Reflect.set(this, property, value);
|
|
48
|
+
};
|
|
49
|
+
return setter.bind(controller.componentConfig);
|
|
50
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ContextController } from "../prototype/ContextController";
|
|
2
|
+
import { Component } from "../../index";
|
|
3
|
+
export declare function inject_$name_to_data(name: string, origin: {}): void;
|
|
4
|
+
export declare function inject_$props_to_data(childNode: ChildNode, meta: {} | [], origin: object): void;
|
|
5
|
+
export declare function inject_$refs_to_data(template: Element, origin: object): void;
|
|
6
|
+
export declare function inject_$http_to_data(origin: {}): void;
|
|
7
|
+
export declare function inject_$pathVariable_to_data(origin: {}): void;
|
|
8
|
+
export declare function inject_$plugin_to_data(config: object): void;
|
|
9
|
+
export declare function inject_$commit_to_data(data: {}, commit: any): void;
|
|
10
|
+
export declare function inject_$publish_to_data(data: {}, publisher: any): void;
|
|
11
|
+
export declare function inject_$setter_to_data(data: {}, setter: any): void;
|
|
12
|
+
export declare function inject_$getter_to_data(data: {}, getter: any): void;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param controller
|
|
16
|
+
* @param proto
|
|
17
|
+
*/
|
|
18
|
+
export declare function inject_method_to_data(controller: ContextController, proto: Component): void;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param controller
|
|
22
|
+
* @param proto
|
|
23
|
+
*/
|
|
24
|
+
export declare function inject_watcher_to_controller(controller: ContextController, proto: Component): void;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param controller
|
|
28
|
+
* @param proto
|
|
29
|
+
*/
|
|
30
|
+
export declare function inject_computed_to_controller(controller: ContextController, proto: Component): void;
|