render-core 1.4.2 → 1.4.3

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 (83) hide show
  1. package/index.d.ts +31 -7
  2. package/index.js +30 -18
  3. package/kernel/delivery/delivery.d.ts +25 -1
  4. package/kernel/delivery/delivery.js +32 -2
  5. package/kernel/directive/data/v-el.d.ts +1 -1
  6. package/kernel/directive/data/v-html.d.ts +1 -1
  7. package/kernel/directive/data/v-txt.d.ts +1 -1
  8. package/kernel/directive/salt/v-solt.d.ts +1 -1
  9. package/kernel/proxyer/getProxy.d.ts +9 -1
  10. package/kernel/proxyer/getProxy.js +12 -0
  11. package/kernel/renderer/initRender.d.ts +1 -1
  12. package/kernel/renderer/initRender.js +8 -9
  13. package/kernel/renderer/postRender.d.ts +1 -1
  14. package/kernel/renderer/postRender.js +8 -9
  15. package/kernel/renderer/rawRender.d.ts +1 -1
  16. package/kernel/renderer/rawRender.js +8 -9
  17. package/kernel/renderer/updateRender.d.ts +1 -1
  18. package/kernel/router/router.d.ts +12 -0
  19. package/kernel/router/router.js +32 -0
  20. package/package.json +1 -1
  21. package/system/define/ContextController.d.ts +1 -1
  22. package/system/generic/component/ComponentGeneric.d.ts +13 -0
  23. package/system/generic/component/ComponentGeneric.js +1 -0
  24. package/system/generic/controller/ControllerGeneric.d.ts +21 -0
  25. package/system/generic/controller/ControllerGeneric.js +1 -0
  26. package/system/generic/data/OriginalDataGeneric.d.ts +12 -0
  27. package/system/generic/data/OriginalDataGeneric.js +1 -0
  28. package/system/generic/http/HttpGeneric.d.ts +4 -0
  29. package/system/generic/http/HttpGeneric.js +1 -0
  30. package/system/generic/render/RenderGeneric.d.ts +4 -0
  31. package/system/generic/render/RenderGeneric.js +1 -0
  32. package/system/injection/inject.d.ts +4 -2
  33. package/system/injection/inject.js +12 -3
  34. package/system/injection/injection.d.ts +1 -6
  35. package/system/injection/injection.js +1 -11
  36. package/system/lifecycle/lifeCycle.d.ts +1 -1
  37. package/system/lifecycle/mount.d.ts +1 -1
  38. package/system/prototype/ContextController.d.ts +29 -0
  39. package/system/prototype/ContextController.js +23 -0
  40. package/system/prototype/HttpAction.d.ts +9 -0
  41. package/system/prototype/HttpAction.js +37 -0
  42. package/system/recorder/table0/system_func_0.d.ts +4 -21
  43. package/system/recorder/table0/system_func_0.js +2 -26
  44. package/system/recorder/table0/system_t_0.d.ts +1 -3
  45. package/system/recorder/table0/system_t_0.js +1 -3
  46. package/system/recorder/table1/system_func_1.d.ts +6 -0
  47. package/system/recorder/table1/system_func_1.js +18 -0
  48. package/system/recorder/table1/system_t_1.d.ts +3 -0
  49. package/system/recorder/table1/system_t_1.js +4 -1
  50. package/system/recorder/table3/system_func_3.d.ts +10 -0
  51. package/system/recorder/table3/system_func_3.js +25 -0
  52. package/system/recorder/table3/system_t_3.d.ts +10 -0
  53. package/system/recorder/table3/system_t_3.js +9 -0
  54. package/system/utility/cmdUtility.d.ts +1 -1
  55. package/system/utility/dataUtility.d.ts +4 -0
  56. package/system/utility/dataUtility.js +4 -0
  57. package/system/utility/inputType.d.ts +1 -1
  58. package/system/utility/sectionUtility.d.ts +1 -1
  59. package/system/utility/templateUtility.js +0 -2
  60. package/tension/DefaultRouterPlugin.d.ts +3 -3
  61. package/tension/SystemInitPlugin.d.ts +6 -0
  62. package/tension/SystemInitPlugin.js +12 -0
  63. package/tension/generic/plugin/PluginGeneric.d.ts +5 -0
  64. package/tension/generic/plugin/PluginGeneric.js +1 -0
  65. package/tension/generic/plugin/hooks/HooksGeneric.d.ts +6 -0
  66. package/tension/generic/plugin/hooks/HooksGeneric.js +1 -0
  67. package/tension/generic/plugin/preface/PrefaceGeneric.d.ts +11 -0
  68. package/tension/generic/plugin/preface/PrefaceGeneric.js +1 -0
  69. package/tension/generic/router/RouterGeneric.d.ts +5 -0
  70. package/tension/generic/router/RouterGeneric.js +1 -0
  71. package/tension/prototype/AbstractComponent.d.ts +1 -1
  72. package/tension/prototype/AbstractRouter.d.ts +1 -1
  73. package/tension/prototype/HooksAction.d.ts +3 -3
  74. package/tension/prototype/HooksAction.js +4 -9
  75. package/tension/prototype/PrefaceAction.d.ts +10 -5
  76. package/tension/prototype/PrefaceAction.js +19 -6
  77. package/tension/prototype/RouterAction.d.ts +6 -13
  78. package/tension/prototype/RouterAction.js +13 -6
  79. package/xboot/Entrance.d.ts +4 -0
  80. package/xboot/Entrance.js +6 -2
  81. package/xboot/RenderProcessor.d.ts +1 -1
  82. package/xboot/RenderProcessor.js +3 -11
  83. package/xboot/TagProcessor.js +0 -1
package/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { RenderGeneric } from "./system/generic/RenderGeneric";
2
- import { ContextController } from "./system/define/ContextController";
3
- import { PluginGeneric } from "./tension/generic/PluginGeneric";
4
- import { HooksGeneric } from "./tension/generic/HooksGeneric";
1
+ import { RenderGeneric } from "./system/generic/render/RenderGeneric";
2
+ import { ContextController } from "./system/prototype/ContextController";
3
+ import { PluginGeneric } from "./tension/generic/plugin/PluginGeneric";
4
+ import { HooksGeneric } from "./tension/generic/plugin/hooks/HooksGeneric";
5
5
  import { AbstractComponent } from "./tension/prototype/AbstractComponent";
6
- import { PrefaceGeneric } from "./tension/generic/PrefaceGeneric";
6
+ import { PrefaceGeneric } from "./tension/generic/plugin/preface/PrefaceGeneric";
7
7
  /**
8
- * This class is used to define the properties type
8
+ * This class is used to prototype the properties type
9
9
  */
10
10
  export declare class PropertyType {
11
11
  static STRING: 'string';
@@ -14,9 +14,15 @@ export declare class PropertyType {
14
14
  static BOOLEAN: 'boolean';
15
15
  static JSON: 'json';
16
16
  }
17
+ /**
18
+ *
19
+ */
17
20
  export declare abstract class AbstractRenderJS implements RenderGeneric {
18
21
  use_plugin(plugin: AbstractPlugin): void;
19
22
  }
23
+ /**
24
+ *
25
+ */
20
26
  export declare abstract class AbstractPlugin implements PluginGeneric {
21
27
  plugin(preface: PrefaceGeneric, hooks: HooksGeneric): void;
22
28
  }
@@ -44,7 +50,6 @@ export declare class Component extends AbstractComponent {
44
50
  * This proto is the application proto.
45
51
  */
46
52
  export declare class RenderJS extends AbstractRenderJS {
47
- routeMode: boolean;
48
53
  contextController: ContextController;
49
54
  constructor();
50
55
  /**
@@ -53,6 +58,15 @@ export declare class RenderJS extends AbstractRenderJS {
53
58
  * @param func
54
59
  */
55
60
  static registerElement(name: string, func: any): void;
61
+ setRouteTable(value: {
62
+ routeMode: string;
63
+ table: [
64
+ {
65
+ path: string;
66
+ component: Component;
67
+ }
68
+ ];
69
+ }): void;
56
70
  /**
57
71
  * This func is the plugin entry to third vendor
58
72
  */
@@ -67,6 +81,16 @@ export declare class RenderJS extends AbstractRenderJS {
67
81
  * @return void
68
82
  */
69
83
  run(component?: Component, root?: string): void;
84
+ /**
85
+ *
86
+ * @param component
87
+ * @private
88
+ */
70
89
  private spa_run;
90
+ /**
91
+ *
92
+ * @param root
93
+ * @private
94
+ */
71
95
  private mpa_run;
72
96
  }
package/index.js CHANGED
@@ -13,16 +13,17 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
- import { render_for_mpa, render_for_spa } from "./xboot/Entrance";
17
- import { registerTagLib } from "./xboot/TagProcessor";
16
+ import { render_for_mpa, render_for_spa } from "./xboot/entrance";
17
+ import { registerTagLib } from "./xboot/tagProcessor";
18
18
  import { HooksAction } from "./tension/prototype/HooksAction";
19
- import { ContextController } from "./system/define/ContextController";
19
+ import { ContextController } from "./system/prototype/ContextController";
20
20
  import { AbstractComponent } from "./tension/prototype/AbstractComponent";
21
- import { get_router_for_application, set_context_controller } from "./system/recorder/table0/system_func_0";
21
+ import { set_context_controller } from "./system/recorder/table0/system_func_0";
22
22
  import { PrefaceAction } from "./tension/prototype/PrefaceAction";
23
- import { DefaultRouterPlugin } from "./tension/DefaultRouterPlugin";
23
+ import { SystemInitPlugin } from "./tension/SystemInitPlugin";
24
+ import { get_route_mode, set_path_variable } from "./system/recorder/table1/system_func_1";
24
25
  /**
25
- * This class is used to define the properties type
26
+ * This class is used to prototype the properties type
26
27
  */
27
28
  var PropertyType = /** @class */ (function () {
28
29
  function PropertyType() {
@@ -30,6 +31,9 @@ var PropertyType = /** @class */ (function () {
30
31
  return PropertyType;
31
32
  }());
32
33
  export { PropertyType };
34
+ /**
35
+ *
36
+ */
33
37
  var AbstractRenderJS = /** @class */ (function () {
34
38
  function AbstractRenderJS() {
35
39
  }
@@ -38,6 +42,9 @@ var AbstractRenderJS = /** @class */ (function () {
38
42
  return AbstractRenderJS;
39
43
  }());
40
44
  export { AbstractRenderJS };
45
+ /**
46
+ *
47
+ */
41
48
  var AbstractPlugin = /** @class */ (function () {
42
49
  function AbstractPlugin() {
43
50
  }
@@ -64,11 +71,12 @@ var RenderJS = /** @class */ (function (_super) {
64
71
  __extends(RenderJS, _super);
65
72
  function RenderJS() {
66
73
  var _this = _super.call(this) || this;
67
- _this.routeMode = false;
68
- //initiate the page controller
74
+ /* initiate the page controller */
69
75
  _this.contextController = new ContextController({
70
76
  boxMode: false,
71
77
  });
78
+ /* init the basis extension */
79
+ _this.use_plugin(new SystemInitPlugin());
72
80
  return _this;
73
81
  }
74
82
  /**
@@ -79,6 +87,9 @@ var RenderJS = /** @class */ (function (_super) {
79
87
  RenderJS.registerElement = function (name, func) {
80
88
  Reflect.set(window, name, func);
81
89
  };
90
+ RenderJS.prototype.setRouteTable = function (value) {
91
+ set_path_variable(value);
92
+ };
82
93
  /**
83
94
  * This func is the plugin entry to third vendor
84
95
  */
@@ -98,23 +109,24 @@ var RenderJS = /** @class */ (function (_super) {
98
109
  */
99
110
  RenderJS.prototype.run = function (component, root) {
100
111
  set_context_controller(this.contextController);
101
- if (get_router_for_application() == null) {
102
- this.use_plugin(new DefaultRouterPlugin({
103
- mode: "history",
104
- table: [{
105
- path: "",
106
- component: null
107
- }]
108
- }));
109
- }
110
- if (this.routeMode)
112
+ if (get_route_mode())
111
113
  this.spa_run(component);
112
114
  else
113
115
  this.mpa_run(root);
114
116
  };
117
+ /**
118
+ *
119
+ * @param component
120
+ * @private
121
+ */
115
122
  RenderJS.prototype.spa_run = function (component) {
116
123
  render_for_spa(component);
117
124
  };
125
+ /**
126
+ *
127
+ * @param root
128
+ * @private
129
+ */
118
130
  RenderJS.prototype.mpa_run = function (root) {
119
131
  render_for_mpa(root);
120
132
  };
@@ -1,5 +1,29 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  import { Component } from "../../index";
3
+ /**
4
+ *
5
+ * @param protoTypeComponent
6
+ * @param componentAttachedRootElement
7
+ * @param child
8
+ * @param parentController
9
+ */
3
10
  export declare function spa_delivery(protoTypeComponent: Component, componentAttachedRootElement: ParentNode, child: Element, parentController: ContextController): void;
11
+ /**
12
+ *
13
+ * @param protoTypeComponent
14
+ */
15
+ export declare function direct_delivery(protoTypeComponent: Component): void;
16
+ /**
17
+ *
18
+ * @param protoTypeComponent
19
+ * @param componentAttachedRootElement
20
+ * @param child
21
+ * @param parentController
22
+ */
4
23
  export declare function mpa_delivery(protoTypeComponent: Component, componentAttachedRootElement: ParentNode, child: Element, parentController: ContextController): void;
24
+ /**
25
+ *
26
+ * @param collection
27
+ * @param parentController
28
+ */
5
29
  export declare function findComponent(collection: HTMLCollection, parentController: ContextController): void;
@@ -1,12 +1,38 @@
1
+ import { ContextController } from "../../system/prototype/ContextController";
1
2
  import { isUnKnown } from "../../system/utility/checkUtility";
2
3
  import { get_tag_library } from "../../system/recorder/table0/system_func_0";
3
4
  import { init_renderer } from "../renderer/initRender";
4
5
  import { post_renderer } from "../renderer/postRender";
5
6
  import { raw_renderer } from "../renderer/rawRender";
6
- import { renderHtml } from "../../xboot/RenderProcessor";
7
+ import { renderHtml } from "../../xboot/renderProcessor";
8
+ /**
9
+ *
10
+ * @param protoTypeComponent
11
+ * @param componentAttachedRootElement
12
+ * @param child
13
+ * @param parentController
14
+ */
7
15
  export function spa_delivery(protoTypeComponent, componentAttachedRootElement, child, parentController) {
8
16
  raw_renderer(protoTypeComponent, componentAttachedRootElement, child, parentController);
9
17
  }
18
+ /**
19
+ *
20
+ * @param protoTypeComponent
21
+ */
22
+ export function direct_delivery(protoTypeComponent) {
23
+ var context = new ContextController({
24
+ boxMode: true
25
+ });
26
+ var webview = document.querySelector("webview");
27
+ raw_renderer(protoTypeComponent, webview.parentNode, webview, context);
28
+ }
29
+ /**
30
+ *
31
+ * @param protoTypeComponent
32
+ * @param componentAttachedRootElement
33
+ * @param child
34
+ * @param parentController
35
+ */
10
36
  export function mpa_delivery(protoTypeComponent, componentAttachedRootElement, child, parentController) {
11
37
  //两种渲染方式
12
38
  if (child.hasAttribute("name")) {
@@ -39,7 +65,11 @@ export function mpa_delivery(protoTypeComponent, componentAttachedRootElement, c
39
65
  }
40
66
  }
41
67
  }
42
- //拓展标签深度渲染
68
+ /**
69
+ *
70
+ * @param collection
71
+ * @param parentController
72
+ */
43
73
  export function findComponent(collection, parentController) {
44
74
  for (var i = 0; i < collection.length; i++) {
45
75
  if (isUnKnown(collection[i].nodeName)) {
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../../system/define/ContextController";
1
+ import { ContextController } from "../../../system/prototype/ContextController";
2
2
  /**
3
3
  *
4
4
  * @param node
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../../system/define/ContextController";
1
+ import { ContextController } from "../../../system/prototype/ContextController";
2
2
  /**
3
3
  *
4
4
  * @param elements
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../../system/define/ContextController";
1
+ import { ContextController } from "../../../system/prototype/ContextController";
2
2
  /**
3
3
  *
4
4
  * @param elements
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../../system/define/ContextController";
1
+ import { ContextController } from "../../../system/prototype/ContextController";
2
2
  /**
3
3
  * 此函数用于解析自定义元素salt
4
4
  * @param tagTemplate
@@ -1,9 +1,17 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  /**
3
3
  * 获取data对象的代理对象
4
4
  * @param data
5
5
  * @param updater
6
6
  */
7
7
  export declare function get_proxy_for_method(data: {}, updater: ContextController): any;
8
+ /**
9
+ *
10
+ * @param origin
11
+ */
8
12
  export declare function get_proxy_for_watcher(origin: object): object;
13
+ /**
14
+ *
15
+ * @param origin
16
+ */
9
17
  export declare function get_proxy_for_computed(origin: object): object;
@@ -10,6 +10,10 @@ export function get_proxy_for_method(data, updater) {
10
10
  handel["set"] = get_setter_for_method_proxy(updater);
11
11
  return new Proxy(data, handel);
12
12
  }
13
+ /**
14
+ *
15
+ * @param updater
16
+ */
13
17
  function get_setter_for_method_proxy(updater) {
14
18
  var setter = function (obj, prop, value) {
15
19
  try {
@@ -25,10 +29,18 @@ function get_setter_for_method_proxy(updater) {
25
29
  };
26
30
  return setter.bind(updater);
27
31
  }
32
+ /**
33
+ *
34
+ * @param origin
35
+ */
28
36
  export function get_proxy_for_watcher(origin) {
29
37
  var handles = {};
30
38
  return new Proxy(origin, handles);
31
39
  }
40
+ /**
41
+ *
42
+ * @param origin
43
+ */
32
44
  export function get_proxy_for_computed(origin) {
33
45
  var handles = {};
34
46
  return new Proxy(origin, handles);
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  import { Component } from "../../index";
3
3
  /**
4
4
  * 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
@@ -1,15 +1,15 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/cmdUtility";
3
3
  import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
4
- import { inject_$name_to_data, inject_$plugin_to_config, 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_$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";
5
5
  import { after_process_for_init } from "../../system/lifecycle/lifeCycle";
6
6
  import { findComponent } from "../delivery/delivery";
7
7
  import { getTemplate } from "../../system/utility/templateUtility";
8
8
  import { loader_tag_style } from "../../system/utility/styleUtility";
9
- import { get_plugin_library, get_style_library } from "../../system/recorder/table0/system_func_0";
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, getSetCodeSpaceForProperty } from "../../system/utility/injectUtility";
12
- import { getCommitMethod, getGetterMethod, getPublishMethod, getSetterMethod } from "../../system/injection/injection";
11
+ import { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty } from "../../system/utility/injectUtility";
12
+ import { getCommitMethod, getGetterMethod, getPublishMethod } from "../../system/injection/injection";
13
13
  import { parse_directive_salt_collect } from "../directive/salt/v-solt";
14
14
  /**
15
15
  * 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
@@ -26,8 +26,6 @@ export function init_renderer(protoType, parent, child, parentController) {
26
26
  parse_directive_salt_collect(child, currentController);
27
27
  /* some loaders */
28
28
  loader_tag_style(protoType.getName(), get_style_library());
29
- /* some injections to config class */
30
- Reflect.set(currentController.componentConfig, "$plugins", get_plugin_library());
31
29
  /* initiate to controller */
32
30
  currentController.parentController = parentController;
33
31
  currentController.prototypeOfComponent = protoType;
@@ -41,7 +39,9 @@ export function init_renderer(protoType, parent, child, parentController) {
41
39
  inject_$name_to_data(protoType.getName(), currentController.originalData);
42
40
  inject_$props_to_data(child, protoType.getProps(), currentController.originalData);
43
41
  inject_$refs_to_data(tagTemplate, currentController.originalData);
44
- inject_$plugin_to_config(currentController.componentConfig);
42
+ inject_$plugin_to_data(currentController.originalData);
43
+ inject_$http_to_data(currentController.originalData);
44
+ inject_$pathVariable_to_data(currentController.originalData);
45
45
  /* initiate method, computed, watcher */
46
46
  inject_method_to_data(currentController, protoType);
47
47
  inject_computed_to_controller(currentController, protoType);
@@ -49,7 +49,6 @@ export function init_renderer(protoType, parent, child, parentController) {
49
49
  //注入commit
50
50
  getCodeSpaceForCommit(currentController.originalData, getCommitMethod(parentController));
51
51
  getCodeSpaceForPublish(currentController.originalData, getPublishMethod(currentController));
52
- getSetCodeSpaceForProperty(currentController.originalData, getSetterMethod(currentController));
53
52
  getGetCodeSpaceForProperty(currentController.originalData, getGetterMethod(currentController));
54
53
  protoType.getBeforeRender().apply(currentController.originalData, null);
55
54
  /* directive parse before */
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  import { Component } from "../../index";
3
3
  /**
4
4
  * 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
@@ -1,17 +1,17 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/cmdUtility";
3
3
  import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
4
- import { inject_$name_to_data, inject_$plugin_to_config, 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_$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";
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
8
  import { getTemplate } from "../../system/utility/templateUtility";
9
9
  import { loader_tag_style } from "../../system/utility/styleUtility";
10
- import { get_plugin_library, get_style_library } from "../../system/recorder/table0/system_func_0";
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
12
  import { dataInject } from "../../system/utility/dataUtility";
13
- import { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty, getSetCodeSpaceForProperty } from "../../system/utility/injectUtility";
14
- import { getCommitMethod, getGetterMethod, getPublishMethod, getSetterMethod } from "../../system/injection/injection";
13
+ import { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty } from "../../system/utility/injectUtility";
14
+ import { getCommitMethod, getGetterMethod, getPublishMethod } from "../../system/injection/injection";
15
15
  /**
16
16
  * 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
17
17
  * @param protoType
@@ -27,8 +27,6 @@ export function post_renderer(protoType, parent, child, parentController) {
27
27
  parse_directive_salt_collect(child, currentController);
28
28
  /* some loaders */
29
29
  loader_tag_style(protoType.getName(), get_style_library());
30
- /* some injections to config class */
31
- Reflect.set(currentController.componentConfig, "$plugins", get_plugin_library());
32
30
  /* initiate to controller */
33
31
  currentController.parentController = parentController;
34
32
  currentController.prototypeOfComponent = protoType;
@@ -42,11 +40,12 @@ export function post_renderer(protoType, parent, child, parentController) {
42
40
  inject_$name_to_data(protoType.getName(), currentController.originalData);
43
41
  inject_$props_to_data(child, protoType.getProps(), currentController.originalData);
44
42
  inject_$refs_to_data(tagTemplate, currentController.originalData);
45
- inject_$plugin_to_config(currentController.componentConfig);
43
+ inject_$plugin_to_data(currentController.originalData);
44
+ inject_$http_to_data(currentController.originalData);
45
+ inject_$pathVariable_to_data(currentController.originalData);
46
46
  //注入commit
47
47
  getCodeSpaceForCommit(currentController.originalData, getCommitMethod(parentController));
48
48
  getCodeSpaceForPublish(currentController.originalData, getPublishMethod(currentController));
49
- getSetCodeSpaceForProperty(currentController.originalData, getSetterMethod(currentController));
50
49
  getGetCodeSpaceForProperty(currentController.originalData, getGetterMethod(currentController));
51
50
  /* initiate method, computed, watcher */
52
51
  inject_method_to_data(currentController, protoType);
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  import { Component } from "../../index";
3
3
  /**
4
4
  * 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
@@ -1,17 +1,17 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/cmdUtility";
3
3
  import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
4
- import { inject_$name_to_data, inject_$plugin_to_config, 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_$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";
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
8
  import { getTemplate } from "../../system/utility/templateUtility";
9
9
  import { loader_tag_style } from "../../system/utility/styleUtility";
10
- import { get_plugin_library, get_style_library } from "../../system/recorder/table0/system_func_0";
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
12
  import { dataInject } from "../../system/utility/dataUtility";
13
- import { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty, getSetCodeSpaceForProperty } from "../../system/utility/injectUtility";
14
- import { getCommitMethod, getGetterMethod, getPublishMethod, getSetterMethod } from "../../system/injection/injection";
13
+ import { getCodeSpaceForCommit, getCodeSpaceForPublish, getGetCodeSpaceForProperty, } from "../../system/utility/injectUtility";
14
+ import { getCommitMethod, getGetterMethod, getPublishMethod } from "../../system/injection/injection";
15
15
  /**
16
16
  * 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
17
17
  * @param protoType
@@ -27,8 +27,6 @@ export function raw_renderer(protoType, parent, child, parentController) {
27
27
  parse_directive_salt_collect(child, currentController);
28
28
  /* some loaders */
29
29
  loader_tag_style(protoType.getName(), get_style_library());
30
- /* some injections to config class */
31
- Reflect.set(currentController.componentConfig, "$plugins", get_plugin_library());
32
30
  /* initiate to controller */
33
31
  currentController.parentController = parentController;
34
32
  currentController.prototypeOfComponent = protoType;
@@ -42,11 +40,12 @@ export function raw_renderer(protoType, parent, child, parentController) {
42
40
  inject_$name_to_data(protoType.getName(), currentController.originalData);
43
41
  inject_$props_to_data(child, protoType.getProps(), currentController.originalData);
44
42
  inject_$refs_to_data(tagTemplate, currentController.originalData);
45
- inject_$plugin_to_config(currentController.componentConfig);
43
+ inject_$plugin_to_data(currentController.originalData);
44
+ inject_$http_to_data(currentController.originalData);
45
+ inject_$pathVariable_to_data(currentController.originalData);
46
46
  //注入commit
47
47
  getCodeSpaceForCommit(currentController.originalData, getCommitMethod(parentController));
48
48
  getCodeSpaceForPublish(currentController.originalData, getPublishMethod(currentController));
49
- getSetCodeSpaceForProperty(currentController.originalData, getSetterMethod(currentController));
50
49
  getGetCodeSpaceForProperty(currentController.originalData, getGetterMethod(currentController));
51
50
  /* initiate method, computed, watcher */
52
51
  inject_method_to_data(currentController, protoType);
@@ -1,4 +1,4 @@
1
- import { ContextController } from "../../system/define/ContextController";
1
+ import { ContextController } from "../../system/prototype/ContextController";
2
2
  /**
3
3
  * 更新渲染方法
4
4
  * @param currentController
@@ -0,0 +1,12 @@
1
+ import { Component } from "../../index";
2
+ /**
3
+ *
4
+ * @param view
5
+ */
6
+ export declare function router_listener_with_router(view: HTMLElement): void;
7
+ /**
8
+ *
9
+ * @param component
10
+ * @param view
11
+ */
12
+ export declare function router_listener_without_router(component: Component, view: HTMLElement): void;
@@ -0,0 +1,32 @@
1
+ import { get_context_controller } from "../../system/recorder/table0/system_func_0";
2
+ import { spa_delivery } from "../delivery/delivery";
3
+ import { get_system_ext_router } from "../../system/recorder/table3/system_func_3";
4
+ import { set_path_variable } from "../../system/recorder/table1/system_func_1";
5
+ /**
6
+ *
7
+ * @param view
8
+ */
9
+ export function router_listener_with_router(view) {
10
+ if (view !== null) {
11
+ var controller = get_context_controller();
12
+ var router = get_system_ext_router();
13
+ var component = router.getComponent();
14
+ set_path_variable(router.getPathVariable());
15
+ spa_delivery(component, view.parentNode, view, controller);
16
+ }
17
+ else
18
+ console.log("Without view element to render");
19
+ }
20
+ /**
21
+ *
22
+ * @param component
23
+ * @param view
24
+ */
25
+ export function router_listener_without_router(component, view) {
26
+ if (view !== null) {
27
+ var controller = get_context_controller();
28
+ spa_delivery(component, view.parentNode, view, controller);
29
+ }
30
+ else
31
+ console.log("Without view element to render");
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "The extendable javascript web framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,4 +1,4 @@
1
- import { ControllerGeneric } from "../generic/ControllerGeneric";
1
+ import { ControllerGeneric } from "../generic/controller/ControllerGeneric";
2
2
  import { Component } from "../../index";
3
3
  export declare class ContextController implements ControllerGeneric {
4
4
  componentAttachedRootElement: ParentNode | Element;
@@ -0,0 +1,13 @@
1
+ export interface ComponentGeneric {
2
+ getName(): string;
3
+ getTemplate(): string;
4
+ getConfig(): {};
5
+ getBoxStyle(): string;
6
+ getProps(): {};
7
+ getData(): {};
8
+ getComputed(): {};
9
+ getMethods(): {};
10
+ getWatcher(): {};
11
+ getBeforeRender(): () => void;
12
+ getAfterRender(): () => void;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { ContextController } from "../../prototype/ContextController";
2
+ import { Component } from "../../../index";
3
+ export interface ControllerGeneric {
4
+ componentAttachedRootElement: ParentNode;
5
+ prototypeOfComponent: Component;
6
+ parentController: ContextController;
7
+ componentConfig: {
8
+ boxMode: boolean;
9
+ };
10
+ originalData: {};
11
+ dataForMethod: {};
12
+ dataForComputed: {};
13
+ salt: Map<string, any>;
14
+ lazyComponent: Map<string, {}>;
15
+ slaveComponent: ContextController[];
16
+ method: {};
17
+ computed: {};
18
+ watcher: {};
19
+ receiver(method: string, ...args: any[]): any;
20
+ flush(): void;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export interface OriginalDataGeneric {
2
+ $name?: string;
3
+ $props?: Map<string, any>;
4
+ $params?: Map<string, any>;
5
+ $refs?: Map<string, any>;
6
+ $redirect?: (url: string, parameters: {}) => void;
7
+ $relocate?: (position: string) => void;
8
+ $commit?: (method: string, ...args: [any]) => void;
9
+ $publish?: (method: string, ...args: [any]) => void;
10
+ $get?: (name: string) => any;
11
+ $set?: (name: string, value: any) => any;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface HttpGeneric {
2
+ redirect(url: string, parameters: {}): void;
3
+ relocate(position: string): void;
4
+ }
@@ -0,0 +1 @@
1
+ export {};