render-core 1.4.0 → 1.4.2
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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { resolve_props } from "../resolver/props";
|
|
2
|
+
import { parse_directive_refs } from "../../kernel/directive/ref/v-ref";
|
|
3
|
+
import { get_plugin_library } from "../recorder/table0/system_func_0";
|
|
4
|
+
export function inject_$name_to_data(name, origin) {
|
|
5
|
+
Reflect.set(origin, "$name", name);
|
|
6
|
+
}
|
|
7
|
+
export function inject_$props_to_data(childNode, meta, origin) {
|
|
8
|
+
var props = resolve_props(childNode, meta);
|
|
9
|
+
Reflect.set(origin, "$props", props);
|
|
10
|
+
}
|
|
11
|
+
export function inject_$refs_to_data(template, origin) {
|
|
12
|
+
var refs = new Map();
|
|
13
|
+
parse_directive_refs(template.children, refs);
|
|
14
|
+
Reflect.set(origin, "$refs", refs);
|
|
15
|
+
}
|
|
16
|
+
export function inject_$plugin_to_config(config) {
|
|
17
|
+
Reflect.set(config, "plugins", get_plugin_library());
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param controller
|
|
22
|
+
* @param proto
|
|
23
|
+
*/
|
|
24
|
+
export function inject_method_to_data(controller, proto) {
|
|
25
|
+
var methods = Object.getOwnPropertyNames(proto.getMethods());
|
|
26
|
+
methods.forEach(function (value) {
|
|
27
|
+
if (value.match(/^\$\$[a-zA-Z0-9_]*/) !== null)
|
|
28
|
+
Reflect.set(controller.originalData, value, proto.getMethods()[value].bind(controller.originalData));
|
|
29
|
+
else
|
|
30
|
+
Reflect.set(controller.originalData, value, proto.getMethods()[value].bind(controller.dataForMethod));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param controller
|
|
36
|
+
* @param proto
|
|
37
|
+
*/
|
|
38
|
+
export function inject_watcher_to_controller(controller, proto) {
|
|
39
|
+
var methods = Object.getOwnPropertyNames(proto.getWatcher());
|
|
40
|
+
methods.forEach(function (value) {
|
|
41
|
+
Reflect.set(controller.watcher, value, proto.getWatcher()[value].bind(controller.originalData));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param controller
|
|
47
|
+
* @param proto
|
|
48
|
+
*/
|
|
49
|
+
export function inject_computed_to_controller(controller, proto) {
|
|
50
|
+
var methods = Object.getOwnPropertyNames(proto.getComputed());
|
|
51
|
+
methods.forEach(function (value) {
|
|
52
|
+
Reflect.set(controller.computed, value, proto.getComputed()[value].bind(controller.originalData));
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ContextController } from "../define/ContextController";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param controller
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCommitMethod(controller: ContextController): any;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param controller
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSetterMethod(controller: ContextController): any;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param controller
|
|
15
|
+
*/
|
|
16
|
+
export declare function getGetterMethod(controller: ContextController): any;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param controller
|
|
20
|
+
*/
|
|
21
|
+
export declare function getPublishMethod(controller: ContextController): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContextController } from "../define/ContextController";
|
|
2
|
+
/**
|
|
3
|
+
* 该函数用于处理渲染后操作
|
|
4
|
+
* @param currenController
|
|
5
|
+
* @param child
|
|
6
|
+
* @param parentController
|
|
7
|
+
*/
|
|
8
|
+
export declare function after_process_for_init(currenController: ContextController, child: ChildNode, parentController: ContextController): void;
|
|
9
|
+
/**
|
|
10
|
+
* 该函数用于处理渲染后操作
|
|
11
|
+
* @param currentController
|
|
12
|
+
* @param parentController
|
|
13
|
+
*/
|
|
14
|
+
export declare function after_process_for_post(currentController: ContextController, parentController: ContextController): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 该函数用于处理渲染后操作
|
|
3
|
+
* @param currenController
|
|
4
|
+
* @param child
|
|
5
|
+
* @param parentController
|
|
6
|
+
*/
|
|
7
|
+
export function after_process_for_init(currenController, child, parentController) {
|
|
8
|
+
/* save currentController to parentController's publishing array */
|
|
9
|
+
parentController.slaveComponent.push(currenController);
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
parentController.lazyComponent.set(child.getAttribute("name"), controller.originalData);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 该函数用于处理渲染后操作
|
|
15
|
+
* @param currentController
|
|
16
|
+
* @param parentController
|
|
17
|
+
*/
|
|
18
|
+
export function after_process_for_post(currentController, parentController) {
|
|
19
|
+
/* save currentController to parentController's publishing array */
|
|
20
|
+
parentController.slaveComponent.push(currentController);
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ContextController } from "../define/ContextController";
|
|
2
|
+
import { Component } from "../../index";
|
|
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 archive_mount(controller: ContextController, proto: Component, parent: ParentNode, child: ChildNode, tagTemplate: Element): void;
|
|
12
|
+
/**
|
|
13
|
+
* Insert elements without div element
|
|
14
|
+
* @param root
|
|
15
|
+
*/
|
|
16
|
+
export declare function extract_mount(root: ContextController): void;
|
|
17
|
+
export declare function mountForUpdate(tagTemplate: Element): Element;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param child
|
|
7
7
|
* @param tagTemplate
|
|
8
8
|
*/
|
|
9
|
-
export function
|
|
9
|
+
export function archive_mount(controller, proto, parent, child, tagTemplate) {
|
|
10
10
|
//mount
|
|
11
11
|
var renderSpace = document.createElement("div");
|
|
12
12
|
//给box添加样式
|
|
@@ -19,20 +19,11 @@ export function mount(controller, proto, parent, child, tagTemplate) {
|
|
|
19
19
|
renderSpace.append(tagTemplate.firstChild);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
export function mountForUpdate(tagTemplate) {
|
|
23
|
-
//mount
|
|
24
|
-
var renderSpace = document.createElement("div");
|
|
25
|
-
renderSpace.setAttribute("anchor", "end");
|
|
26
|
-
while (tagTemplate.hasChildNodes()) {
|
|
27
|
-
renderSpace.append(tagTemplate.firstChild);
|
|
28
|
-
}
|
|
29
|
-
return renderSpace;
|
|
30
|
-
}
|
|
31
22
|
/**
|
|
32
23
|
* Insert elements without div element
|
|
33
24
|
* @param root
|
|
34
25
|
*/
|
|
35
|
-
export function
|
|
26
|
+
export function extract_mount(root) {
|
|
36
27
|
var begin = document.createElement("div");
|
|
37
28
|
begin.setAttribute("anchor", "begin");
|
|
38
29
|
begin.setAttribute("style", "display:none");
|
|
@@ -49,3 +40,11 @@ export function unBox(root) {
|
|
|
49
40
|
root.anchor.setAttribute("style", "display:none");
|
|
50
41
|
root.componentAttachedRootElement = parent;
|
|
51
42
|
}
|
|
43
|
+
export function mountForUpdate(tagTemplate) {
|
|
44
|
+
var renderSpace = document.createElement("div");
|
|
45
|
+
renderSpace.setAttribute("anchor", "end");
|
|
46
|
+
while (tagTemplate.hasChildNodes()) {
|
|
47
|
+
renderSpace.append(tagTemplate.firstChild);
|
|
48
|
+
}
|
|
49
|
+
return renderSpace;
|
|
50
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AbstractPlugin, Component } from "../../../index";
|
|
2
|
+
import { ContextController } from "../../define/ContextController";
|
|
3
|
+
import { AbstractRouter } from "../../../tension/prototype/AbstractRouter";
|
|
4
|
+
/**
|
|
5
|
+
* Use the func to inject a tag component to the tag-library.
|
|
6
|
+
* @param tagName The tag name
|
|
7
|
+
* @param tagDefine The tag define class
|
|
8
|
+
*/
|
|
9
|
+
export declare function tag_library_inject(tagName: string, tagDefine: Component): void;
|
|
10
|
+
/**
|
|
11
|
+
* Use the func to get a tag define class
|
|
12
|
+
* @param tagName The name of tag you want to search
|
|
13
|
+
*/
|
|
14
|
+
export declare function tag_library_search(tagName: string): Component | null;
|
|
15
|
+
/**
|
|
16
|
+
* From the system_t_0 table, get tag library
|
|
17
|
+
*/
|
|
18
|
+
export declare function get_tag_library(): Map<string, Component>;
|
|
19
|
+
/**
|
|
20
|
+
* From the system_t_0 table, get style library
|
|
21
|
+
*/
|
|
22
|
+
export declare function get_style_library(): Map<string, Map<string, string>>;
|
|
23
|
+
/**
|
|
24
|
+
* Set plugin to system_t_0
|
|
25
|
+
*/
|
|
26
|
+
export declare function set_plugin_library(name: string, plugin: AbstractPlugin): void;
|
|
27
|
+
/**
|
|
28
|
+
* From the system_t_o table, get plugin library
|
|
29
|
+
*/
|
|
30
|
+
export declare function get_plugin_library(): Map<string, AbstractPlugin>;
|
|
31
|
+
/**
|
|
32
|
+
* Get context controller from system_t_0
|
|
33
|
+
*/
|
|
34
|
+
export declare function get_context_controller(): ContextController;
|
|
35
|
+
/**
|
|
36
|
+
* Set context controller to system_t_0
|
|
37
|
+
* @param context
|
|
38
|
+
*/
|
|
39
|
+
export declare function set_context_controller(context: ContextController): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get router from system_t_0
|
|
42
|
+
*/
|
|
43
|
+
export declare function get_router_for_application(): AbstractRouter;
|
|
44
|
+
/**
|
|
45
|
+
* Set router for system_t_0
|
|
46
|
+
*/
|
|
47
|
+
export declare function set_router_for_application(router: AbstractRouter): void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import system_t_0 from "./system_t_0";
|
|
2
|
+
/**
|
|
3
|
+
* Use the func to inject a tag component to the tag-library.
|
|
4
|
+
* @param tagName The tag name
|
|
5
|
+
* @param tagDefine The tag define class
|
|
6
|
+
*/
|
|
7
|
+
export function tag_library_inject(tagName, tagDefine) {
|
|
8
|
+
if (system_t_0.tagLib.has(tagName))
|
|
9
|
+
console.log("no");
|
|
10
|
+
else
|
|
11
|
+
system_t_0.tagLib.set(tagName, tagDefine);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Use the func to get a tag define class
|
|
15
|
+
* @param tagName The name of tag you want to search
|
|
16
|
+
*/
|
|
17
|
+
export function tag_library_search(tagName) {
|
|
18
|
+
if (system_t_0.tagLib.has(tagName))
|
|
19
|
+
return system_t_0.tagLib.get(tagName);
|
|
20
|
+
else
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* From the system_t_0 table, get tag library
|
|
25
|
+
*/
|
|
26
|
+
export function get_tag_library() {
|
|
27
|
+
return system_t_0.tagLib;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* From the system_t_0 table, get style library
|
|
31
|
+
*/
|
|
32
|
+
export function get_style_library() {
|
|
33
|
+
return system_t_0.styleLib;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Set plugin to system_t_0
|
|
37
|
+
*/
|
|
38
|
+
export function set_plugin_library(name, plugin) {
|
|
39
|
+
Reflect.get(system_t_0, "extendLib").set(name, plugin);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* From the system_t_o table, get plugin library
|
|
43
|
+
*/
|
|
44
|
+
export function get_plugin_library() {
|
|
45
|
+
return system_t_0.extendLib;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get context controller from system_t_0
|
|
49
|
+
*/
|
|
50
|
+
export function get_context_controller() {
|
|
51
|
+
return system_t_0.contextController;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Set context controller to system_t_0
|
|
55
|
+
* @param context
|
|
56
|
+
*/
|
|
57
|
+
export function set_context_controller(context) {
|
|
58
|
+
Reflect.set(system_t_0, "contextController", context);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get router from system_t_0
|
|
62
|
+
*/
|
|
63
|
+
export function get_router_for_application() {
|
|
64
|
+
return system_t_0.router;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Set router for system_t_0
|
|
68
|
+
*/
|
|
69
|
+
export function set_router_for_application(router) {
|
|
70
|
+
Reflect.set(system_t_0, "router", router);
|
|
71
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractPlugin, Component } from "../../../index";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
tagLib: Map<string, Component>;
|
|
4
|
+
styleLib: Map<string, Map<string, string>>;
|
|
5
|
+
extendLib: Map<string, AbstractPlugin>;
|
|
6
|
+
contextController: any;
|
|
7
|
+
router: any;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
var
|
|
1
|
+
var system_t_2 = [];
|
|
2
2
|
var tableTag = ["FORM", "INPUT", "TEXTAREA", "BUTTON", "SELECT", "OPTGROUP", "OPTION", "LABEL", "FIELDSET", "LEGEND", "DATALIST", "KEYGEN", "OUTPUT"];
|
|
3
|
-
|
|
3
|
+
system_t_2 = system_t_2.concat(tableTag);
|
|
4
4
|
var frameTag = ["FRAME", "FRAMESET", "NOFRAMES", "IFRAME"];
|
|
5
|
-
|
|
5
|
+
system_t_2 = system_t_2.concat(frameTag);
|
|
6
6
|
var imgTag = ["IMG", "MAP", "AREA", "CANVAS", "FIGCAPTION", "FIGURE", "AUDIO", "VIDEO", "SOURCE", "TRACK"];
|
|
7
|
-
|
|
7
|
+
system_t_2 = system_t_2.concat(imgTag);
|
|
8
8
|
var linkTag = ["A", "LINK", "MAIN", "NAV"];
|
|
9
|
-
|
|
9
|
+
system_t_2 = system_t_2.concat(linkTag);
|
|
10
10
|
var listTag = ["UL", "OL", "LI", "DIR", "DL", "DT", "DD", "MENU", "COMMAND"];
|
|
11
|
-
|
|
11
|
+
system_t_2 = system_t_2.concat(listTag);
|
|
12
12
|
var titleTag = ["H1", "H2", "H3", "H4", "H5", "H6"];
|
|
13
|
-
|
|
13
|
+
system_t_2 = system_t_2.concat(titleTag);
|
|
14
14
|
var tbTag = ["TABLE", "CAPTION", "TH", "TR", "TD", "THEAD", "TBODY", "TFOOT", "COL", "COLGROUP"];
|
|
15
|
-
|
|
15
|
+
system_t_2 = system_t_2.concat(tbTag);
|
|
16
16
|
var styleTag = ["STYLE", "DIV", "SPAN", "HEADER", "FOOTER", "SECTION", "ARTICLE", "ASIDE", "DETAILS", "DIALOG", "SUMMARY"];
|
|
17
|
-
|
|
17
|
+
system_t_2 = system_t_2.concat(styleTag);
|
|
18
18
|
var metaTag = ["HEAD", "META", "BASE", "BASEFONT"];
|
|
19
|
-
|
|
19
|
+
system_t_2 = system_t_2.concat(metaTag);
|
|
20
20
|
var programTag = ["SCRIPT", "NOSCRIPT", "APPLET", "EMBED", "OBJECT", "PARAM"];
|
|
21
|
-
|
|
21
|
+
system_t_2 = system_t_2.concat(programTag);
|
|
22
22
|
var formTag = ["ACRONYM", "ABBR", "ADDRESS", "B", "BDI", "BDO", "BIG", "BLOCKQUOTE", "CENTER", "CITE", "CODE", "DEL", "DFN", "EM", "FONT", "I", "INS", "KBD", "MARK", "METER", "PRE", "PROGRESS", "Q", "RP", "RT", "RUBY", "S", "SAMP", "SMALL", "STRIKE", "STRONG", "SUB", "SUP", "TIME", "TT", "U", "VAR", "WBR"];
|
|
23
|
-
|
|
23
|
+
system_t_2 = system_t_2.concat(formTag);
|
|
24
24
|
var baseTag = ["!DOCTYPE", "HTML", "TITLE", "BODY", "P", "BR", "HR", "!--...--"];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export default metaTagLib;
|
|
25
|
+
system_t_2 = system_t_2.concat(baseTag);
|
|
26
|
+
export default system_t_2;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function is used to resolve tag properties.
|
|
3
|
+
* @param tag
|
|
4
|
+
* @param properties
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolve_props(tag: ChildNode, properties: {} | []): Map<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param node
|
|
10
|
+
* @param array
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAllPropsByArray(node: ChildNode, array: Array<string>): Map<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param node
|
|
16
|
+
* @param object
|
|
17
|
+
*/
|
|
18
|
+
export declare function getAllPropsByObject(node: ChildNode, object: {}): Map<string, any>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PropertyType } from "../../index";
|
|
2
|
+
/**
|
|
3
|
+
* This function is used to resolve tag properties.
|
|
4
|
+
* @param tag
|
|
5
|
+
* @param properties
|
|
6
|
+
*/
|
|
7
|
+
export function resolve_props(tag, properties) {
|
|
8
|
+
if (properties instanceof Array)
|
|
9
|
+
return getAllPropsByArray(tag, properties);
|
|
10
|
+
if (properties instanceof Object)
|
|
11
|
+
return getAllPropsByObject(tag, properties);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param node
|
|
16
|
+
* @param array
|
|
17
|
+
*/
|
|
18
|
+
export function getAllPropsByArray(node, array) {
|
|
19
|
+
var props = new Map();
|
|
20
|
+
array.forEach(function (value) {
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
if (node.getAttribute(value)) {
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
props.set(value, node.getAttribute(value));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return props;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param node
|
|
32
|
+
* @param object
|
|
33
|
+
*/
|
|
34
|
+
export function getAllPropsByObject(node, object) {
|
|
35
|
+
var props = new Map();
|
|
36
|
+
for (var objectKey in object) {
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
if (node.getAttribute(objectKey)) {
|
|
39
|
+
if (object[objectKey] === PropertyType.INT) { // @ts-ignore
|
|
40
|
+
props.set(objectKey, parseInt(node.getAttribute(objectKey)));
|
|
41
|
+
}
|
|
42
|
+
else if (object[objectKey] === PropertyType.FLOAT) { // @ts-ignore
|
|
43
|
+
props.set(objectKey, parseFloat(node.getAttribute(objectKey)));
|
|
44
|
+
}
|
|
45
|
+
else if (object[objectKey] === PropertyType.BOOLEAN) {
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
props.set(objectKey, parseFloat(node.getAttribute(objectKey)));
|
|
48
|
+
}
|
|
49
|
+
else if (object[objectKey] === PropertyType.STRING) {
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
props.set(objectKey, node.getAttribute(objectKey));
|
|
52
|
+
}
|
|
53
|
+
else if (object[objectKey] === PropertyType.JSON) {
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
props.set(objectKey, JSON.parse(node.getAttribute(objectKey)));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
props.set(objectKey, node.getAttribute(objectKey));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return props;
|
|
64
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { get_context_controller, get_router_for_application } from "../recorder/table0/system_func_0";
|
|
2
|
+
import { spa_delivery } from "../../kernel/delivery/delivery";
|
|
3
|
+
export function router_listener_with_router(view) {
|
|
4
|
+
if (view !== null) {
|
|
5
|
+
var controller = get_context_controller();
|
|
6
|
+
var router = get_router_for_application();
|
|
7
|
+
var component = router.getComponentByUrl(location.pathname);
|
|
8
|
+
spa_delivery(component, view.parentNode, view, controller);
|
|
9
|
+
}
|
|
10
|
+
else
|
|
11
|
+
console.log("Without view element to render");
|
|
12
|
+
}
|
|
13
|
+
export function router_listener_without_router(component, view) {
|
|
14
|
+
if (view !== null) {
|
|
15
|
+
var controller = get_context_controller();
|
|
16
|
+
spa_delivery(component, view.parentNode, view, controller);
|
|
17
|
+
}
|
|
18
|
+
else
|
|
19
|
+
console.log("Without view element to render");
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ContextController } from "../define/ContextController";
|
|
2
|
+
import { Component } from "../../index";
|
|
3
|
+
/**
|
|
4
|
+
* This function is used to parse_directive those commands which should be executed before mount.
|
|
5
|
+
* @param tagTemplate
|
|
6
|
+
* @param proto
|
|
7
|
+
* @param controller
|
|
8
|
+
*/
|
|
9
|
+
export declare function directive_parse_collection_for_before(tagTemplate: Element, proto: Component, controller: ContextController): void;
|
|
10
|
+
/**
|
|
11
|
+
* This function is used to parse_directive those commands which should be executed after mount.
|
|
12
|
+
* @param templateSpace
|
|
13
|
+
* @param controller
|
|
14
|
+
*/
|
|
15
|
+
export declare function directive_parse_collection_for_after(templateSpace: ParentNode, controller: ContextController): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { add_label_to_element } from "./miscUtility";
|
|
2
|
+
import { parse_directive_event } from "../../kernel/directive/method/v-on";
|
|
3
|
+
import { parse_directive_html } from "../../kernel/directive/data/v-html";
|
|
4
|
+
import { parse_directive_txt } from "../../kernel/directive/data/v-txt";
|
|
5
|
+
import { parse_directive_model } from "../../kernel/directive/react/v-model";
|
|
6
|
+
import { parse_directive_bind } from "../../kernel/directive/property/v-bind";
|
|
7
|
+
import { parse_directive_show } from "../../kernel/directive/justify/v-show";
|
|
8
|
+
import { parse_directive_render } from "../../kernel/directive/justify/v-render";
|
|
9
|
+
import { parse_directive_if } from "../../kernel/directive/justify/v-if";
|
|
10
|
+
import { parse_directive_switch } from "../../kernel/directive/justify/v-switch";
|
|
11
|
+
import { parse_directive_for_of } from "../../kernel/directive/loop/v-for";
|
|
12
|
+
import { parse_directive_salt_extract } from "../../kernel/directive/salt/v-solt";
|
|
13
|
+
import { parse_directive_expression } from "../../kernel/directive/data/v-el";
|
|
14
|
+
import { parse_directive_for_map } from "../../kernel/directive/loop/v-map";
|
|
15
|
+
/**
|
|
16
|
+
* This function is used to parse_directive those commands which should be executed before mount.
|
|
17
|
+
* @param tagTemplate
|
|
18
|
+
* @param proto
|
|
19
|
+
* @param controller
|
|
20
|
+
*/
|
|
21
|
+
export function directive_parse_collection_for_before(tagTemplate, proto, controller) {
|
|
22
|
+
add_label_to_element(tagTemplate.children, proto.getName());
|
|
23
|
+
parse_directive_event(tagTemplate.children, proto.getMethods(), controller.dataForMethod, controller.originalData);
|
|
24
|
+
parse_directive_html(tagTemplate.children, controller.dataForMethod, controller);
|
|
25
|
+
parse_directive_txt(tagTemplate.children, controller.dataForMethod, controller);
|
|
26
|
+
parse_directive_model(tagTemplate.children, controller.dataForMethod);
|
|
27
|
+
parse_directive_bind(tagTemplate.children, controller.dataForMethod);
|
|
28
|
+
parse_directive_salt_extract(tagTemplate.children, controller);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* This function is used to parse_directive those commands which should be executed after mount.
|
|
32
|
+
* @param templateSpace
|
|
33
|
+
* @param controller
|
|
34
|
+
*/
|
|
35
|
+
export function directive_parse_collection_for_after(templateSpace, controller) {
|
|
36
|
+
parse_directive_show(templateSpace.children, controller.dataForMethod);
|
|
37
|
+
parse_directive_render(templateSpace.children, controller.dataForMethod);
|
|
38
|
+
parse_directive_if(templateSpace.children, controller.dataForMethod);
|
|
39
|
+
parse_directive_switch(templateSpace.children, controller.dataForMethod);
|
|
40
|
+
parse_directive_for_map(templateSpace.children, controller.dataForMethod);
|
|
41
|
+
parse_directive_for_of(templateSpace.children, controller.dataForMethod);
|
|
42
|
+
parse_directive_expression(controller.componentAttachedRootElement, controller.dataForMethod, controller);
|
|
43
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare function getCodeSpaceForProps(data: {}, $props: Map<string, object>): void;
|
|
2
|
-
export declare function getCodeSpaceForQuery(data: {}, $query: Map<string, any>): void;
|
|
3
|
-
export declare function getCodeSpaceForRef(data: {}, $ref: Map<string, Element>): void;
|
|
4
1
|
export declare function getCodeSpaceForCommit(data: {}, commit: any): void;
|
|
5
2
|
export declare function getCodeSpaceForPublish(data: {}, publisher: any): void;
|
|
6
3
|
export declare function getSetCodeSpaceForProperty(data: {}, setter: any): void;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export function getCodeSpaceForProps(data, $props) {
|
|
2
|
-
Reflect.set(data, "$props", $props);
|
|
3
|
-
}
|
|
4
|
-
export function getCodeSpaceForQuery(data, $query) {
|
|
5
|
-
Reflect.set(data, "$params", $query);
|
|
6
|
-
}
|
|
7
|
-
//注入对象
|
|
8
|
-
export function getCodeSpaceForRef(data, $ref) {
|
|
9
|
-
Reflect.set(data, "$refs", $ref);
|
|
10
|
-
}
|
|
11
1
|
//注入对象
|
|
12
2
|
export function getCodeSpaceForCommit(data, commit) {
|
|
13
3
|
Reflect.set(data, "$commit", commit);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ContextController } from "../define/ContextController";
|
|
2
|
+
export declare function textType(target: any, doc: any, controller: ContextController): void;
|
|
3
|
+
export declare function assignType(target: any, controller: ContextController): void;
|
|
4
|
+
export declare function fileType(target: any, controller: ContextController): void;
|
|
5
|
+
export declare function checkType(target: any): void;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @param nodes
|
|
4
4
|
* @param component
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function add_label_to_element(nodes, component) {
|
|
7
7
|
for (var i = 0; i < nodes.length; i++) {
|
|
8
8
|
nodes[i].setAttribute("cpn", component);
|
|
9
9
|
var kk = nodes[i].children;
|
|
10
|
-
|
|
10
|
+
add_label_to_element(kk, component);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from "
|
|
1
|
+
import { Component } from "../../index";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param tag
|
|
@@ -15,7 +15,7 @@ export declare function themeStyle(component: Component, styleLib: Map<string, o
|
|
|
15
15
|
* @param tag
|
|
16
16
|
* @param styleLib
|
|
17
17
|
*/
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function loader_tag_style(tag: string, styleLib: Map<string, Map<string, string>>): void;
|
|
19
19
|
/**
|
|
20
20
|
*
|
|
21
21
|
* @param tag
|