render-core 1.4.9 → 1.4.11

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.
Files changed (88) hide show
  1. package/index.d.ts +14 -8
  2. package/index.js +18 -13
  3. package/kernel/delivery/delivery.js +3 -3
  4. package/kernel/directive/property/v-bind.js +2 -2
  5. package/kernel/directive/react/v-model.js +1 -1
  6. package/kernel/proxyer/getProxy.d.ts +0 -3
  7. package/kernel/proxyer/getProxy.js +1 -5
  8. package/kernel/renderer/initRender.js +9 -10
  9. package/kernel/renderer/postRender.js +10 -11
  10. package/kernel/renderer/rawRender.js +10 -11
  11. package/kernel/renderer/updateRender.js +14 -13
  12. package/kernel/router/router.js +3 -3
  13. package/package.json +1 -4
  14. package/system/generic/component/ComponentGeneric.d.ts +1 -1
  15. package/system/generic/controller/ControllerGeneric.d.ts +10 -4
  16. package/system/generic/data/ComputedDataGeneric.d.ts +13 -0
  17. package/system/generic/data/WatcherDataGeneric.d.ts +13 -0
  18. package/system/injection/injection.d.ts +8 -3
  19. package/system/injection/injection.js +22 -12
  20. package/system/injection/{inject.d.ts → injector.d.ts} +4 -0
  21. package/system/injection/{inject.js → injector.js} +14 -0
  22. package/system/lifecycle/mount.js +5 -8
  23. package/system/loader/loader.js +1 -1
  24. package/system/prototype/ContextController.d.ts +9 -8
  25. package/system/prototype/ContextController.js +1 -7
  26. package/system/recorder/table2/system_func_2.d.ts +5 -0
  27. package/system/recorder/table2/system_func_2.js +8 -0
  28. package/system/utility/{dataUtility.d.ts → data/dataUtility.d.ts} +1 -1
  29. package/system/utility/{dataUtility.js → data/dataUtility.js} +1 -1
  30. package/system/utility/{cmdUtility.d.ts → directive/cmdUtility.d.ts} +2 -2
  31. package/system/utility/{cmdUtility.js → directive/cmdUtility.js} +14 -14
  32. package/system/utility/{miscUtility.d.ts → initiate/miscUtility.d.ts} +1 -1
  33. package/system/utility/{miscUtility.js → initiate/miscUtility.js} +1 -1
  34. package/system/utility/initiate/templateUtility.d.ts +6 -0
  35. package/system/utility/{templateUtility.js → initiate/templateUtility.js} +1 -0
  36. package/system/utility/react/inputType.d.ts +25 -0
  37. package/system/utility/{inputType.js → react/inputType.js} +20 -0
  38. package/system/utility/{inputUtility.d.ts → react/inputUtility.d.ts} +15 -1
  39. package/system/utility/{inputUtility.js → react/inputUtility.js} +26 -9
  40. package/system/utility/{modelUtility.d.ts → react/modelUtility.d.ts} +3 -3
  41. package/system/utility/{modelUtility.js → react/modelUtility.js} +5 -7
  42. package/system/utility/{sectionUtility.d.ts → react/sectionUtility.d.ts} +1 -1
  43. package/system/utility/{sectionUtility.js → react/sectionUtility.js} +25 -9
  44. package/system/utility/{styleUtility.d.ts → style/styleUtility.d.ts} +1 -1
  45. package/system/utility/{styleUtility.js → style/styleUtility.js} +3 -3
  46. package/tension/prototype/HooksAction.js +1 -1
  47. package/xboot/{Entrance.d.ts → entrance.d.ts} +3 -3
  48. package/xboot/{Entrance.js → entrance.js} +4 -5
  49. package/xboot/{RenderProcessor.js → renderProcessor.js} +2 -2
  50. package/xboot/{TagProcessor.js → tagProcessor.js} +4 -8
  51. package/system/define/ContextController.d.ts +0 -29
  52. package/system/define/ContextController.js +0 -23
  53. package/system/generic/ControllerGeneric.d.ts +0 -21
  54. package/system/generic/RenderGeneric.d.ts +0 -4
  55. package/system/http/Http.d.ts +0 -11
  56. package/system/http/Http.js +0 -36
  57. package/system/router/router.d.ts +0 -3
  58. package/system/router/router.js +0 -20
  59. package/system/utility/checkUtility.d.ts +0 -1
  60. package/system/utility/checkUtility.js +0 -4
  61. package/system/utility/injectUtility.d.ts +0 -4
  62. package/system/utility/injectUtility.js +0 -14
  63. package/system/utility/inputType.d.ts +0 -5
  64. package/system/utility/templateUtility.d.ts +0 -5
  65. package/tension/DefaultRouterPlugin.d.ts +0 -17
  66. package/tension/DefaultRouterPlugin.js +0 -11
  67. package/tension/generic/ComponentGeneric.d.ts +0 -13
  68. package/tension/generic/ComponentGeneric.js +0 -1
  69. package/tension/generic/HooksGeneric.d.ts +0 -6
  70. package/tension/generic/HooksGeneric.js +0 -1
  71. package/tension/generic/OriginalDataGeneric.d.ts +0 -18
  72. package/tension/generic/OriginalDataGeneric.js +0 -1
  73. package/tension/generic/PluginGeneric.d.ts +0 -5
  74. package/tension/generic/PluginGeneric.js +0 -1
  75. package/tension/generic/PrefaceGeneric.d.ts +0 -6
  76. package/tension/generic/PrefaceGeneric.js +0 -1
  77. package/tension/generic/RouterGeneric.d.ts +0 -5
  78. package/tension/generic/RouterGeneric.js +0 -1
  79. package/tension/prototype/AbstractRouter.d.ts +0 -6
  80. package/tension/prototype/AbstractRouter.js +0 -12
  81. package/tension/prototype/RouterAction.d.ts +0 -9
  82. package/tension/prototype/RouterAction.js +0 -20
  83. /package/system/generic/{ControllerGeneric.js → data/ComputedDataGeneric.js} +0 -0
  84. /package/system/generic/{RenderGeneric.js → data/WatcherDataGeneric.js} +0 -0
  85. /package/system/{utility → output}/errorUtility.d.ts +0 -0
  86. /package/system/{utility → output}/errorUtility.js +0 -0
  87. /package/xboot/{RenderProcessor.d.ts → renderProcessor.d.ts} +0 -0
  88. /package/xboot/{TagProcessor.d.ts → tagProcessor.d.ts} +0 -0
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 undefined;
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 (isUnKnown(child.nodeName.toUpperCase())) {
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 (isUnKnown(collection[i].nodeName)) {
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 { isUnKnown } from "../../../system/utility/checkUtility";
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 (!isUnKnown(nodes[i].nodeName)) {
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,4 +1,4 @@
1
- import { compositionend, compositionstart, listener } from "../../../system/utility/modelUtility";
1
+ import { compositionend, compositionstart, listener } from "../../../system/utility/react/modelUtility";
2
2
  /**
3
3
  * 绑定数据模型
4
4
  * @param nodes
@@ -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,7 +10,6 @@ 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) {
@@ -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/inject";
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 { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty } from "../../system/utility/injectUtility";
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/inject";
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 { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty } from "../../system/utility/injectUtility";
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
- //注入commit
47
- getCodeSpaceForCommit(currentController.originalData, getCommitMethod(parentController));
48
- getCodeSpaceForPublish(currentController.originalData, getPublishMethod(currentController));
49
- getGetCodeSpaceForProperty(currentController.originalData, getGetterMethod(currentController));
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/inject";
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 { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty, } from "../../system/utility/injectUtility";
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
- //注入commit
47
- getCodeSpaceForCommit(currentController.originalData, getCommitMethod(parentController));
48
- getCodeSpaceForPublish(currentController.originalData, getPublishMethod(currentController));
49
- getGetCodeSpaceForProperty(currentController.originalData, getGetterMethod(currentController));
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/inject";
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.begin.nextSibling !== currentController.anchor) {
20
- currentController.componentAttachedRootElement.removeChild(currentController.begin.nextSibling);
21
- }
22
- while (renderSpace.hasChildNodes()) {
23
- currentController.componentAttachedRootElement.insertBefore(renderSpace.firstChild, currentController.anchor);
24
- }
25
- while (renderSpace.hasChildNodes()) {
26
- currentController.componentAttachedRootElement.insertBefore(renderSpace.firstChild, currentController.anchor);
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);
@@ -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.log("Router not supported");
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.log("Without view element to render");
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.log("Without mounter element to render");
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.9",
3
+ "version": "1.4.11",
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"
@@ -5,8 +5,8 @@ export interface ComponentGeneric {
5
5
  getBoxStyle(): string;
6
6
  getProps(): {};
7
7
  getData(): {};
8
- getComputed(): {};
9
8
  getMethods(): {};
9
+ getComputed(): {};
10
10
  getWatcher(): {};
11
11
  getBeforeRender(): () => void;
12
12
  getAfterRender(): () => void;
@@ -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,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
+ }
@@ -3,14 +3,19 @@ import { ContextController } from "../prototype/ContextController";
3
3
  *
4
4
  * @param controller
5
5
  */
6
- export declare function getCommitMethod(controller: ContextController): any;
6
+ export declare function get_commit_method(controller: ContextController): any;
7
7
  /**
8
8
  *
9
9
  * @param controller
10
10
  */
11
- export declare function getGetterMethod(controller: ContextController): any;
11
+ export declare function get_publish_method(controller: ContextController): any;
12
12
  /**
13
13
  *
14
14
  * @param controller
15
15
  */
16
- export declare function getPublishMethod(controller: ContextController): any;
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 getCommitMethod(controller) {
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 getGetterMethod(controller) {
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
+ }
@@ -6,6 +6,10 @@ export declare function inject_$refs_to_data(template: Element, origin: object):
6
6
  export declare function inject_$http_to_data(origin: {}): void;
7
7
  export declare function inject_$pathVariable_to_data(origin: {}): void;
8
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;
9
13
  /**
10
14
  *
11
15
  * @param controller
@@ -25,6 +25,20 @@ export function inject_$plugin_to_data(config) {
25
25
  return get_user_anonymous_ext(name);
26
26
  });
27
27
  }
28
+ //注入对象
29
+ export function inject_$commit_to_data(data, commit) {
30
+ Reflect.set(data, "$commit", commit);
31
+ }
32
+ //注入对象
33
+ export function inject_$publish_to_data(data, publisher) {
34
+ Reflect.set(data, "$publish", publisher);
35
+ }
36
+ export function inject_$setter_to_data(data, setter) {
37
+ Reflect.set(data, "$set", setter);
38
+ }
39
+ export function inject_$getter_to_data(data, getter) {
40
+ Reflect.set(data, "$get", getter);
41
+ }
28
42
  /**
29
43
  *
30
44
  * @param controller
@@ -15,9 +15,8 @@ export function archive_mount(controller, proto, parent, child, tagTemplate) {
15
15
  controller.componentAttachedRootElement = renderSpace;
16
16
  //开始渲染
17
17
  parent.replaceChild(renderSpace, child);
18
- while (tagTemplate.hasChildNodes()) {
18
+ while (tagTemplate.hasChildNodes())
19
19
  renderSpace.append(tagTemplate.firstChild);
20
- }
21
20
  }
22
21
  /**
23
22
  * Insert elements without div element
@@ -28,16 +27,14 @@ export function extract_mount(root) {
28
27
  begin.setAttribute("anchor", "begin");
29
28
  begin.setAttribute("style", "display:none");
30
29
  root.componentAttachedRootElement.parentNode.insertBefore(begin, root.componentAttachedRootElement);
31
- root.begin = begin;
32
- while (root.componentAttachedRootElement.hasChildNodes()) {
33
- //插入元素到根之前
30
+ root.anchorBegin = begin;
31
+ while (root.componentAttachedRootElement.hasChildNodes())
34
32
  root.componentAttachedRootElement.parentNode.insertBefore(root.componentAttachedRootElement.firstChild, root.componentAttachedRootElement);
35
- }
36
33
  var parent = root.componentAttachedRootElement.parentNode;
37
34
  // @ts-ignore
38
35
  root.anchor = root.componentAttachedRootElement;
39
- root.anchor.setAttribute("anchor", "end");
40
- root.anchor.setAttribute("style", "display:none");
36
+ root.anchorEnd.setAttribute("anchor", "end");
37
+ root.anchorBegin.setAttribute("style", "display:none");
41
38
  root.componentAttachedRootElement = parent;
42
39
  }
43
40
  export function mountForUpdate(tagTemplate) {
@@ -1,4 +1,4 @@
1
- import { checkStyleLabel } from "../utility/styleUtility";
1
+ import { checkStyleLabel } from "../utility/style/styleUtility";
2
2
  /**
3
3
  * 加载自定义标签样式
4
4
  * @param tag