render-core 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/index.d.ts +48 -34
  2. package/index.js +70 -55
  3. package/kernel/delivery/delivery.d.ts +5 -0
  4. package/kernel/delivery/delivery.js +52 -0
  5. package/kernel/directive/data/v-el.d.ts +8 -0
  6. package/{core/cmd → kernel/directive}/data/v-el.js +2 -2
  7. package/kernel/directive/data/v-html.d.ts +8 -0
  8. package/{core/cmd → kernel/directive}/data/v-html.js +2 -2
  9. package/kernel/directive/data/v-txt.d.ts +8 -0
  10. package/{core/cmd → kernel/directive}/data/v-txt.js +2 -2
  11. package/kernel/directive/justify/v-if.d.ts +6 -0
  12. package/{core/cmd → kernel/directive}/justify/v-if.js +2 -2
  13. package/kernel/directive/justify/v-render.d.ts +6 -0
  14. package/{core/cmd → kernel/directive}/justify/v-render.js +2 -2
  15. package/kernel/directive/justify/v-show.d.ts +6 -0
  16. package/{core/cmd → kernel/directive}/justify/v-show.js +2 -2
  17. package/kernel/directive/justify/v-switch.d.ts +6 -0
  18. package/{core/cmd → kernel/directive}/justify/v-switch.js +2 -2
  19. package/{core/cmd → kernel/directive}/loop/v-for-utility.d.ts +1 -1
  20. package/{core/cmd → kernel/directive}/loop/v-for-utility.js +3 -3
  21. package/{core/cmd → kernel/directive}/loop/v-for.d.ts +1 -1
  22. package/{core/cmd → kernel/directive}/loop/v-for.js +2 -2
  23. package/{core/cmd → kernel/directive}/loop/v-map-utility.d.ts +1 -1
  24. package/{core/cmd → kernel/directive}/loop/v-map-utility.js +3 -3
  25. package/kernel/directive/loop/v-map.d.ts +6 -0
  26. package/{core/cmd → kernel/directive}/loop/v-map.js +2 -2
  27. package/kernel/directive/method/v-on.d.ts +8 -0
  28. package/{core/cmd → kernel/directive}/method/v-on.js +2 -2
  29. package/kernel/directive/property/v-bind.d.ts +6 -0
  30. package/{core/cmd → kernel/directive}/property/v-bind.js +3 -3
  31. package/kernel/directive/react/v-model.d.ts +6 -0
  32. package/{core/cmd → kernel/directive}/react/v-model.js +3 -3
  33. package/kernel/directive/ref/v-ref.d.ts +6 -0
  34. package/{core/cmd → kernel/directive}/ref/v-ref.js +2 -2
  35. package/kernel/directive/salt/v-solt.d.ts +13 -0
  36. package/{core/cmd/solt → kernel/directive/salt}/v-solt.js +8 -8
  37. package/kernel/proxyer/getProxy.d.ts +9 -0
  38. package/kernel/proxyer/getProxy.js +35 -0
  39. package/kernel/renderer/initRender.d.ts +10 -0
  40. package/kernel/renderer/initRender.js +69 -0
  41. package/kernel/renderer/postRender.d.ts +10 -0
  42. package/kernel/renderer/postRender.js +70 -0
  43. package/kernel/renderer/rawRender.d.ts +10 -0
  44. package/kernel/renderer/rawRender.js +70 -0
  45. package/kernel/renderer/updateRender.d.ts +6 -0
  46. package/kernel/renderer/updateRender.js +33 -0
  47. package/package.json +1 -4
  48. package/{controller → system/define}/ContextController.d.ts +8 -7
  49. package/system/define/ContextController.js +23 -0
  50. package/{generic → system/generic}/ControllerGeneric.d.ts +4 -5
  51. package/system/generic/RenderGeneric.d.ts +4 -0
  52. package/system/injection/inject.d.ts +24 -0
  53. package/system/injection/inject.js +54 -0
  54. package/system/injection/injection.d.ts +21 -0
  55. package/system/lifecycle/lifeCycle.d.ts +14 -0
  56. package/system/lifecycle/lifeCycle.js +21 -0
  57. package/system/lifecycle/mount.d.ts +17 -0
  58. package/{core → system}/lifecycle/mount.js +10 -11
  59. package/system/output/error.d.ts +0 -0
  60. package/system/output/error.js +4 -0
  61. package/system/recorder/table0/system_func_0.d.ts +47 -0
  62. package/system/recorder/table0/system_func_0.js +71 -0
  63. package/system/recorder/table0/system_t_0.d.ts +9 -0
  64. package/system/recorder/table0/system_t_0.js +7 -0
  65. package/system/recorder/table1/system_func_1.d.ts +2 -0
  66. package/system/recorder/table1/system_func_1.js +7 -0
  67. package/system/recorder/table1/system_t_1.d.ts +4 -0
  68. package/system/recorder/table1/system_t_1.js +3 -0
  69. package/system/recorder/table2/system_t_2.d.ts +2 -0
  70. package/{library/taglib/metaTagLib.js → system/recorder/table2/system_t_2.js} +14 -15
  71. package/system/resolver/props.d.ts +18 -0
  72. package/system/resolver/props.js +64 -0
  73. package/system/router/router.d.ts +3 -0
  74. package/system/router/router.js +20 -0
  75. package/system/utility/checkUtility.js +4 -0
  76. package/system/utility/cmdUtility.d.ts +15 -0
  77. package/system/utility/cmdUtility.js +43 -0
  78. package/{core → system}/utility/injectUtility.d.ts +0 -3
  79. package/{core → system}/utility/injectUtility.js +0 -10
  80. package/system/utility/inputType.d.ts +5 -0
  81. package/system/utility/miscUtility.d.ts +6 -0
  82. package/{core → system}/utility/miscUtility.js +2 -2
  83. package/system/utility/sectionUtility.d.ts +6 -0
  84. package/{core → system}/utility/styleUtility.d.ts +2 -2
  85. package/{core → system}/utility/styleUtility.js +17 -14
  86. package/{core → system}/utility/templateUtility.d.ts +1 -1
  87. package/tension/DefaultRouterPlugin.d.ts +17 -0
  88. package/tension/DefaultRouterPlugin.js +11 -0
  89. package/tension/generic/ComponentGeneric.d.ts +13 -0
  90. package/{core/exexutor/executor.d.ts → tension/generic/HooksGeneric.d.ts} +3 -4
  91. package/tension/generic/OriginalDataGeneric.d.ts +18 -0
  92. package/tension/generic/PluginGeneric.d.ts +5 -0
  93. package/tension/generic/PrefaceGeneric.d.ts +6 -0
  94. package/tension/generic/RouterGeneric.d.ts +5 -0
  95. package/tension/generic/RouterGeneric.js +1 -0
  96. package/tension/prototype/AbstractComponent.d.ts +43 -0
  97. package/tension/prototype/AbstractComponent.js +113 -0
  98. package/tension/prototype/AbstractRouter.d.ts +6 -0
  99. package/tension/prototype/AbstractRouter.js +12 -0
  100. package/tension/prototype/HooksAction.d.ts +7 -0
  101. package/tension/prototype/HooksAction.js +24 -0
  102. package/tension/prototype/PrefaceAction.d.ts +7 -0
  103. package/tension/prototype/PrefaceAction.js +14 -0
  104. package/tension/prototype/RouterAction.d.ts +16 -0
  105. package/tension/prototype/RouterAction.js +13 -0
  106. package/xboot/Entrance.d.ts +7 -0
  107. package/xboot/Entrance.js +43 -0
  108. package/xboot/RenderProcessor.d.ts +7 -0
  109. package/{runtime/renderProcessor.js → xboot/RenderProcessor.js} +7 -9
  110. package/xboot/TagProcessor.d.ts +7 -0
  111. package/{runtime/tag → xboot}/TagProcessor.js +6 -6
  112. package/controller/ComponentController.d.ts +0 -29
  113. package/controller/ComponentController.js +0 -30
  114. package/controller/ContextController.js +0 -36
  115. package/core/cmd/data/v-el.d.ts +0 -9
  116. package/core/cmd/data/v-html.d.ts +0 -9
  117. package/core/cmd/data/v-txt.d.ts +0 -9
  118. package/core/cmd/justify/v-if.d.ts +0 -6
  119. package/core/cmd/justify/v-render.d.ts +0 -6
  120. package/core/cmd/justify/v-show.d.ts +0 -6
  121. package/core/cmd/justify/v-switch.d.ts +0 -6
  122. package/core/cmd/loop/v-map.d.ts +0 -6
  123. package/core/cmd/method/v-on.d.ts +0 -8
  124. package/core/cmd/property/v-bind.d.ts +0 -6
  125. package/core/cmd/react/v-change.d.ts +0 -6
  126. package/core/cmd/react/v-change.js +0 -22
  127. package/core/cmd/react/v-model.d.ts +0 -6
  128. package/core/cmd/ref/v-ref.d.ts +0 -6
  129. package/core/cmd/solt/v-solt.d.ts +0 -14
  130. package/core/exexutor/executor.js +0 -24
  131. package/core/inject/inject.d.ts +0 -31
  132. package/core/inject/inject.js +0 -66
  133. package/core/inject/injection.d.ts +0 -22
  134. package/core/lifecycle/afterMethods.d.ts +0 -16
  135. package/core/lifecycle/afterMethods.js +0 -22
  136. package/core/lifecycle/controllerCycle.d.ts +0 -22
  137. package/core/lifecycle/controllerCycle.js +0 -66
  138. package/core/lifecycle/mount.d.ts +0 -17
  139. package/core/proxy/getProxy.d.ts +0 -11
  140. package/core/proxy/getProxy.js +0 -26
  141. package/core/proxy/proxy.d.ts +0 -9
  142. package/core/proxy/proxy.js +0 -26
  143. package/core/render/PostRender.d.ts +0 -12
  144. package/core/render/PostRender.js +0 -42
  145. package/core/render/delivery.d.ts +0 -5
  146. package/core/render/delivery.js +0 -42
  147. package/core/render/initRender.d.ts +0 -12
  148. package/core/render/initRender.js +0 -39
  149. package/core/render/rawRender.d.ts +0 -12
  150. package/core/render/rawRender.js +0 -43
  151. package/core/render/updateRender.d.ts +0 -6
  152. package/core/render/updateRender.js +0 -29
  153. package/core/resolver/props.d.ts +0 -19
  154. package/core/resolver/props.js +0 -62
  155. package/core/utility/checkUtility.js +0 -4
  156. package/core/utility/cmdUtility.d.ts +0 -17
  157. package/core/utility/cmdUtility.js +0 -58
  158. package/core/utility/inputType.d.ts +0 -5
  159. package/core/utility/miscUtility.d.ts +0 -6
  160. package/core/utility/sectionUtility.d.ts +0 -6
  161. package/generic/ApplicationGeneric.d.ts +0 -4
  162. package/generic/ConfigGeneric.d.ts +0 -3
  163. package/generic/RenderGeneric.d.ts +0 -5
  164. package/generic/StyleGeneric.d.ts +0 -4
  165. package/generic/originalDataGeneric.d.ts +0 -4
  166. package/http/generic/HttpGeneric.d.ts +0 -4
  167. package/library/props/PropertyLib.d.ts +0 -6
  168. package/library/props/PropertyLib.js +0 -5
  169. package/library/taglib/metaTagLib.d.ts +0 -2
  170. package/proto/controller/AppController.d.ts +0 -16
  171. package/proto/controller/AppController.js +0 -25
  172. package/proto/controller/ComponentController.d.ts +0 -18
  173. package/proto/controller/ComponentController.js +0 -24
  174. package/proto/controller/PageController.d.ts +0 -23
  175. package/proto/controller/PageController.js +0 -40
  176. package/runtime/config/RenderConfig.d.ts +0 -12
  177. package/runtime/config/RenderConfig.js +0 -11
  178. package/runtime/config/config.d.ts +0 -4
  179. package/runtime/config/config.js +0 -4
  180. package/runtime/config.d.ts +0 -3
  181. package/runtime/config.js +0 -3
  182. package/runtime/delivery.d.ts +0 -5
  183. package/runtime/delivery.js +0 -43
  184. package/runtime/entrance.d.ts +0 -7
  185. package/runtime/entrance.js +0 -33
  186. package/runtime/render/PostRender.d.ts +0 -15
  187. package/runtime/render/PostRender.js +0 -49
  188. package/runtime/render/delivery.d.ts +0 -5
  189. package/runtime/render/delivery.js +0 -42
  190. package/runtime/render/initRender.d.ts +0 -15
  191. package/runtime/render/initRender.js +0 -46
  192. package/runtime/render/rawRender.d.ts +0 -15
  193. package/runtime/render/rawRender.js +0 -50
  194. package/runtime/renderProcessor.d.ts +0 -11
  195. package/runtime/tag/TagProcessor.d.ts +0 -9
  196. package/runtime/tagProcessor.d.ts +0 -9
  197. package/runtime/tagProcessor.js +0 -27
  198. package/runtime/update/updateRender.d.ts +0 -10
  199. package/runtime/update/updateRender.js +0 -38
  200. /package/{generic → system/generic}/ControllerGeneric.js +0 -0
  201. /package/{generic → system/generic}/RenderGeneric.js +0 -0
  202. /package/{http → system/http}/Http.d.ts +0 -0
  203. /package/{http → system/http}/Http.js +0 -0
  204. /package/{core/inject → system/injection}/injection.js +0 -0
  205. /package/{core → system}/loader/loader.d.ts +0 -0
  206. /package/{core → system}/loader/loader.js +0 -0
  207. /package/{core → system}/resolver/query.d.ts +0 -0
  208. /package/{core → system}/resolver/query.js +0 -0
  209. /package/{core → system}/utility/checkUtility.d.ts +0 -0
  210. /package/{core → system}/utility/dataUtility.d.ts +0 -0
  211. /package/{core → system}/utility/dataUtility.js +0 -0
  212. /package/{core → system}/utility/errorUtility.d.ts +0 -0
  213. /package/{core → system}/utility/errorUtility.js +0 -0
  214. /package/{core → system}/utility/inputType.js +0 -0
  215. /package/{core → system}/utility/inputUtility.d.ts +0 -0
  216. /package/{core → system}/utility/inputUtility.js +0 -0
  217. /package/{core → system}/utility/modelUtility.d.ts +0 -0
  218. /package/{core → system}/utility/modelUtility.js +0 -0
  219. /package/{core → system}/utility/sectionUtility.js +0 -0
  220. /package/{core → system}/utility/templateUtility.js +0 -0
  221. /package/{generic/ApplicationGeneric.js → tension/generic/ComponentGeneric.js} +0 -0
  222. /package/{generic/ConfigGeneric.js → tension/generic/HooksGeneric.js} +0 -0
  223. /package/{generic/StyleGeneric.js → tension/generic/OriginalDataGeneric.js} +0 -0
  224. /package/{generic/originalDataGeneric.js → tension/generic/PluginGeneric.js} +0 -0
  225. /package/{http/generic/HttpGeneric.js → tension/generic/PrefaceGeneric.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { loadStyle } from "../loader/loader";
2
- import RenderConfig from "../../runtime/config/RenderConfig";
2
+ import { get_theme_style, set_theme_style } from "../recorder/table1/system_func_1";
3
+ import { get_style_library } from "../recorder/table0/system_func_0";
3
4
  /**
4
5
  *
5
6
  * @param tag
@@ -37,21 +38,23 @@ export function themeStyle(component, styleLib) {
37
38
  * @param tag
38
39
  * @param styleLib
39
40
  */
40
- export function styleResolveAndLoad(tag, styleLib) {
41
+ export function loader_tag_style(tag, styleLib) {
41
42
  //获取到启动样式
42
- var theme = RenderConfig["defaultTheme"];
43
- if (styleLib.get(tag.toUpperCase()).get(theme) === undefined) {
44
- console.log("tag:" + tag + " has no theme " + theme);
45
- if (styleLib.get(tag.toUpperCase()).get("default") === undefined) {
46
- console.log("tag:" + tag + " has no theme " + "default");
43
+ var theme = get_theme_style();
44
+ if (styleLib.get(tag.toUpperCase())) {
45
+ if (styleLib.get(tag.toUpperCase()).get(theme) === undefined) {
46
+ console.log("tag:" + tag + " has no theme " + theme);
47
+ if (styleLib.get(tag.toUpperCase()).get("default") === undefined) {
48
+ console.log("tag:" + tag + " has no theme " + "default");
49
+ }
50
+ else {
51
+ loadStyle(tag, "default", styleLib.get(tag.toUpperCase()).get("default"));
52
+ }
47
53
  }
48
54
  else {
49
- loadStyle(tag, "default", styleLib.get(tag.toUpperCase()).get("default"));
55
+ loadStyle(tag, theme, styleLib.get(tag.toUpperCase()).get(theme));
50
56
  }
51
57
  }
52
- else {
53
- loadStyle(tag, theme, styleLib.get(tag.toUpperCase()).get(theme));
54
- }
55
58
  }
56
59
  /**
57
60
  *
@@ -59,7 +62,7 @@ export function styleResolveAndLoad(tag, styleLib) {
59
62
  * @param theme
60
63
  */
61
64
  export function changeStyle(tag, theme) {
62
- var styleTxt = RenderConfig["styleLib"].get(tag.toUpperCase()).get(theme);
65
+ var styleTxt = get_style_library().get(tag.toUpperCase()).get(theme);
63
66
  if (styleTxt === undefined) {
64
67
  console.log("Dont`t find this style!");
65
68
  }
@@ -79,7 +82,7 @@ export function changeStyle(tag, theme) {
79
82
  * @param theme
80
83
  */
81
84
  export function changeTheme(theme) {
82
- RenderConfig["styleLib"].forEach(function (value, key) {
85
+ get_style_library().forEach(function (value, key) {
83
86
  var styles = document.getElementsByTagName("style");
84
87
  for (var i = 0; i < styles.length; i++) {
85
88
  if (styles[i].getAttribute("tag") === key) {
@@ -95,5 +98,5 @@ export function changeTheme(theme) {
95
98
  }
96
99
  }
97
100
  });
98
- RenderConfig["defaultTheme"] = theme;
101
+ set_theme_style(theme);
99
102
  }
@@ -1,4 +1,4 @@
1
- import { Component } from "render-refer";
1
+ import { Component } from "../../index";
2
2
  /**
3
3
  * @param proto
4
4
  */
@@ -0,0 +1,17 @@
1
+ import { PrefaceGeneric } from "./generic/PrefaceGeneric";
2
+ import { HooksGeneric } from "./generic/HooksGeneric";
3
+ import { Component } from "../index";
4
+ import { PluginGeneric } from "./generic/PluginGeneric";
5
+ export declare class DefaultRouterPlugin implements PluginGeneric {
6
+ private readonly routerTable;
7
+ constructor(routeTable: {
8
+ mode: string;
9
+ table: [
10
+ {
11
+ path: string;
12
+ component: Component;
13
+ }
14
+ ];
15
+ });
16
+ plugin(preface: PrefaceGeneric, hooks: HooksGeneric): void;
17
+ }
@@ -0,0 +1,11 @@
1
+ import { RouterAction } from "./prototype/RouterAction";
2
+ var DefaultRouterPlugin = /** @class */ (function () {
3
+ function DefaultRouterPlugin(routeTable) {
4
+ this.routerTable = routeTable;
5
+ }
6
+ DefaultRouterPlugin.prototype.plugin = function (preface, hooks) {
7
+ preface.set_router(new RouterAction(this.routerTable));
8
+ };
9
+ return DefaultRouterPlugin;
10
+ }());
11
+ export { DefaultRouterPlugin };
@@ -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
+ }
@@ -1,7 +1,6 @@
1
- import { HooksGeneric } from "../../../render-refer/dist/generic/HooksGeneric";
2
- export declare class Executor implements HooksGeneric {
3
- relocate(position: string): void;
4
- redirect(url: string, parameters: {}): void;
1
+ export interface HooksGeneric {
5
2
  changeStyle(tag: string, theme: string): void;
6
3
  changeTheme(theme: string): void;
4
+ relocate(position: string): void;
5
+ redirect(url: string, parameters: {}): void;
7
6
  }
@@ -0,0 +1,18 @@
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
+ $context?: {
13
+ getVersion(): string;
14
+ getDestination(): string;
15
+ changeStyle?: (tag: string, theme: string) => void;
16
+ changeTheme?: (theme: string) => void;
17
+ };
18
+ }
@@ -0,0 +1,5 @@
1
+ import { HooksGeneric } from "./HooksGeneric";
2
+ import { PrefaceGeneric } from "./PrefaceGeneric";
3
+ export interface PluginGeneric {
4
+ plugin(preface: PrefaceGeneric, hooks: HooksGeneric): void;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { AbstractPlugin } from "../../index";
2
+ import { AbstractRouter } from "../prototype/AbstractRouter";
3
+ export interface PrefaceGeneric {
4
+ use_plugin(plugin: AbstractPlugin): void;
5
+ set_router(router: AbstractRouter): void;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { Component } from "../../index";
2
+ export interface RouterGeneric {
3
+ getComponentByUrl(url: string): Component;
4
+ getQueriesByUrl(url: string): Map<string, any>;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,43 @@
1
+ import { ComponentGeneric } from "../generic/ComponentGeneric";
2
+ /**
3
+ * This is the component prototype.
4
+ */
5
+ export declare abstract class AbstractComponent implements ComponentGeneric {
6
+ private readonly name;
7
+ private readonly template;
8
+ private readonly config;
9
+ private readonly boxStyle?;
10
+ private readonly props?;
11
+ private readonly data?;
12
+ private readonly methods?;
13
+ private readonly computed?;
14
+ private readonly watcher?;
15
+ private readonly beforeRender?;
16
+ private readonly afterRender?;
17
+ constructor(config: {
18
+ name: string;
19
+ template: string;
20
+ config?: {
21
+ boxMode: boolean;
22
+ };
23
+ boxStyle?: string;
24
+ props?: {} | string[];
25
+ data?: {};
26
+ computed?: {};
27
+ methods?: {};
28
+ watcher?: {};
29
+ beforeRender?: () => void;
30
+ afterRender?: () => void;
31
+ });
32
+ getName(): string;
33
+ getTemplate(): string;
34
+ getConfig(): {};
35
+ getBoxStyle(): string;
36
+ getProps(): {};
37
+ getData(): {};
38
+ getMethods(): {};
39
+ getComputed(): {};
40
+ getWatcher(): {};
41
+ getBeforeRender(): () => void;
42
+ getAfterRender(): () => void;
43
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * This is the component prototype.
3
+ */
4
+ var AbstractComponent = /** @class */ (function () {
5
+ function AbstractComponent(config) {
6
+ //标签名称
7
+ this.name = config.name;
8
+ //标签模板样式
9
+ this.template = config.template;
10
+ //添加box样式
11
+ if (typeof config === "undefined") {
12
+ this.config = {
13
+ boxMode: true
14
+ };
15
+ }
16
+ else {
17
+ this.config = config.config;
18
+ }
19
+ //添加box样式
20
+ if (typeof config.boxStyle === "undefined") {
21
+ this.boxStyle = "";
22
+ }
23
+ else {
24
+ this.boxStyle = config.boxStyle.replace(/^{/, "");
25
+ this.boxStyle = this.boxStyle.replace(/}$/, "");
26
+ this.boxStyle = this.boxStyle.replace(/\n/, "");
27
+ this.boxStyle = this.boxStyle.trim();
28
+ }
29
+ //props validate
30
+ if (typeof config.props === "undefined") {
31
+ this.props = [];
32
+ }
33
+ else {
34
+ this.props = config.props;
35
+ }
36
+ //添加数据
37
+ if (typeof config.data === "undefined") {
38
+ this.data = {};
39
+ }
40
+ else {
41
+ this.data = config.data;
42
+ }
43
+ //添加计算属性
44
+ if (typeof config.computed === "undefined") {
45
+ this.computed = {};
46
+ }
47
+ else {
48
+ this.computed = config.computed;
49
+ }
50
+ //添加方法属性
51
+ if (typeof config.methods === "undefined") {
52
+ this.methods = {};
53
+ }
54
+ else {
55
+ this.methods = config.methods;
56
+ }
57
+ //添加监控属性
58
+ if (typeof config.watcher === "undefined") {
59
+ this.watcher = {};
60
+ }
61
+ else {
62
+ this.watcher = config.watcher;
63
+ }
64
+ //生命周期函数
65
+ if (typeof config.beforeRender === "undefined") {
66
+ this.beforeRender = function () { };
67
+ }
68
+ else {
69
+ this.beforeRender = config.beforeRender;
70
+ }
71
+ if (typeof config.afterRender === "undefined") {
72
+ this.afterRender = function () { };
73
+ }
74
+ else {
75
+ this.afterRender = config.afterRender;
76
+ }
77
+ }
78
+ AbstractComponent.prototype.getName = function () {
79
+ return this.name;
80
+ };
81
+ AbstractComponent.prototype.getTemplate = function () {
82
+ return this.template;
83
+ };
84
+ AbstractComponent.prototype.getConfig = function () {
85
+ return this.config;
86
+ };
87
+ AbstractComponent.prototype.getBoxStyle = function () {
88
+ return this.boxStyle;
89
+ };
90
+ AbstractComponent.prototype.getProps = function () {
91
+ return this.props;
92
+ };
93
+ AbstractComponent.prototype.getData = function () {
94
+ return this.data;
95
+ };
96
+ AbstractComponent.prototype.getMethods = function () {
97
+ return this.methods;
98
+ };
99
+ AbstractComponent.prototype.getComputed = function () {
100
+ return this.computed;
101
+ };
102
+ AbstractComponent.prototype.getWatcher = function () {
103
+ return this.watcher;
104
+ };
105
+ AbstractComponent.prototype.getBeforeRender = function () {
106
+ return this.beforeRender;
107
+ };
108
+ AbstractComponent.prototype.getAfterRender = function () {
109
+ return this.afterRender;
110
+ };
111
+ return AbstractComponent;
112
+ }());
113
+ export { AbstractComponent };
@@ -0,0 +1,6 @@
1
+ import { RouterGeneric } from "../generic/RouterGeneric";
2
+ import { Component } from "../../index";
3
+ export declare class AbstractRouter implements RouterGeneric {
4
+ getComponentByUrl(url: string): Component;
5
+ getQueriesByUrl(url: string): Map<string, any>;
6
+ }
@@ -0,0 +1,12 @@
1
+ var AbstractRouter = /** @class */ (function () {
2
+ function AbstractRouter() {
3
+ }
4
+ AbstractRouter.prototype.getComponentByUrl = function (url) {
5
+ return undefined;
6
+ };
7
+ AbstractRouter.prototype.getQueriesByUrl = function (url) {
8
+ return undefined;
9
+ };
10
+ return AbstractRouter;
11
+ }());
12
+ export { AbstractRouter };
@@ -0,0 +1,7 @@
1
+ import { HooksGeneric } from "../generic/HooksGeneric";
2
+ export declare class HooksAction implements HooksGeneric {
3
+ relocate(position: string): void;
4
+ redirect(url: string, parameters: {}): void;
5
+ changeStyle(tag: string, theme: string): void;
6
+ changeTheme(theme: string): void;
7
+ }
@@ -0,0 +1,24 @@
1
+ import { changeStyle, changeTheme } from "../../system/utility/styleUtility";
2
+ import { redirect, relocate } from "../../system/http/Http";
3
+ var HooksAction = /** @class */ (function () {
4
+ function HooksAction() {
5
+ }
6
+ //文档hash定位
7
+ HooksAction.prototype.relocate = function (position) {
8
+ relocate(position);
9
+ };
10
+ //文档URL跳转
11
+ HooksAction.prototype.redirect = function (url, parameters) {
12
+ redirect(url, parameters);
13
+ };
14
+ //更改tag样式
15
+ HooksAction.prototype.changeStyle = function (tag, theme) {
16
+ changeStyle(tag, theme);
17
+ };
18
+ //更改主题样式
19
+ HooksAction.prototype.changeTheme = function (theme) {
20
+ changeTheme(theme);
21
+ };
22
+ return HooksAction;
23
+ }());
24
+ export { HooksAction };
@@ -0,0 +1,7 @@
1
+ import { PrefaceGeneric } from "../generic/PrefaceGeneric";
2
+ import { AbstractRouter } from "./AbstractRouter";
3
+ import { AbstractPlugin } from "../../index";
4
+ export declare class PrefaceAction implements PrefaceGeneric {
5
+ set_router(router: AbstractRouter): void;
6
+ use_plugin(plugin: AbstractPlugin): void;
7
+ }
@@ -0,0 +1,14 @@
1
+ import { set_router_for_application } from "../../system/recorder/table0/system_func_0";
2
+ import { HooksAction } from "./HooksAction";
3
+ var PrefaceAction = /** @class */ (function () {
4
+ function PrefaceAction() {
5
+ }
6
+ PrefaceAction.prototype.set_router = function (router) {
7
+ set_router_for_application(router);
8
+ };
9
+ PrefaceAction.prototype.use_plugin = function (plugin) {
10
+ plugin.plugin(new PrefaceAction(), new HooksAction());
11
+ };
12
+ return PrefaceAction;
13
+ }());
14
+ export { PrefaceAction };
@@ -0,0 +1,16 @@
1
+ import { RouterGeneric } from "../generic/RouterGeneric";
2
+ import { Component } from "../../index";
3
+ export declare class RouterAction implements RouterGeneric {
4
+ private routerTable;
5
+ constructor(routeTable: {
6
+ mode?: string;
7
+ table?: [
8
+ {
9
+ path: string;
10
+ component: Component;
11
+ }
12
+ ];
13
+ });
14
+ getComponentByUrl(url: string): Component;
15
+ getQueriesByUrl(url: string): Map<string, any>;
16
+ }
@@ -0,0 +1,13 @@
1
+ var RouterAction = /** @class */ (function () {
2
+ function RouterAction(routeTable) {
3
+ this.routerTable = routeTable;
4
+ }
5
+ RouterAction.prototype.getComponentByUrl = function (url) {
6
+ return undefined;
7
+ };
8
+ RouterAction.prototype.getQueriesByUrl = function (url) {
9
+ return undefined;
10
+ };
11
+ return RouterAction;
12
+ }());
13
+ export { RouterAction };
@@ -0,0 +1,7 @@
1
+ import { Component } from "../index";
2
+ /**
3
+ * The entrance of render
4
+ * @param root
5
+ */
6
+ export declare function render_for_mpa(root: string): void;
7
+ export declare function render_for_spa(component?: Component): void;
@@ -0,0 +1,43 @@
1
+ import { themeStyle } from "../system/utility/styleUtility";
2
+ import { renderHtml } from "./RenderProcessor";
3
+ import { get_context_controller, get_style_library, get_tag_library } from "../system/recorder/table0/system_func_0";
4
+ import { router_listener_with_router, router_listener_without_router } from "../system/router/router";
5
+ /**
6
+ * The entrance of render
7
+ * @param root
8
+ */
9
+ export function render_for_mpa(root) {
10
+ //获取styleLib对象
11
+ get_tag_library().forEach(function (component) {
12
+ themeStyle(component, get_style_library());
13
+ });
14
+ if (root == null) {
15
+ //开始渲染
16
+ get_context_controller().componentAttachedRootElement = document.body;
17
+ renderHtml(document.children, get_context_controller());
18
+ }
19
+ else {
20
+ var mountPoint = document.getElementById(root);
21
+ if (mountPoint == null) {
22
+ get_context_controller().componentAttachedRootElement = document.body;
23
+ //开始渲染
24
+ console.warn("Mount point not found");
25
+ console.warn("Mount point was selected to body");
26
+ renderHtml(document.body.children, get_context_controller());
27
+ }
28
+ else {
29
+ //开始渲染
30
+ get_context_controller().componentAttachedRootElement = mountPoint;
31
+ renderHtml(mountPoint.children, get_context_controller());
32
+ }
33
+ }
34
+ }
35
+ export function render_for_spa(component) {
36
+ get_tag_library().forEach(function (component) {
37
+ themeStyle(component, get_style_library());
38
+ });
39
+ if (component == null)
40
+ router_listener_with_router(document.querySelector("webview"));
41
+ else
42
+ router_listener_without_router(component, document.querySelector("webview"));
43
+ }
@@ -0,0 +1,7 @@
1
+ import { ContextController } from "../system/define/ContextController";
2
+ /**
3
+ * This function is used to render element below the mount point.
4
+ * @param collection
5
+ * @param contextController
6
+ */
7
+ export declare function renderHtml(collection: HTMLCollection, contextController: ContextController): void;
@@ -1,31 +1,29 @@
1
- import { isUnKnown } from "../core/utility/checkUtility";
2
- import { delivery } from "./Delivery";
1
+ import { isUnKnown } from "../system/utility/checkUtility";
2
+ import { get_tag_library } from "../system/recorder/table0/system_func_0";
3
+ import { mpa_delivery } from "../kernel/delivery/delivery";
3
4
  /**
4
5
  * This function is used to render element below the mount point.
5
6
  * @param collection
6
7
  * @param contextController
7
- * @param tagLib
8
- * @param styleLib
9
- * @param rjsLib
10
8
  */
11
- export function renderHtml(collection, contextController, tagLib, styleLib, rjsLib) {
9
+ export function renderHtml(collection, contextController) {
12
10
  //遍历element节点,判断是否为自定义标签
13
11
  for (var i = 0; i < collection.length; i++) {
14
12
  if (isUnKnown(collection[i].nodeName.toUpperCase())) {
15
13
  //从tag库中获取该组件的定义
16
- var component = tagLib.get(collection[i].nodeName.toUpperCase());
14
+ var component = get_tag_library().get(collection[i].nodeName.toUpperCase());
17
15
  if (typeof component === undefined) {
18
16
  //没有找到定义,向控制台输出警告
19
17
  console.error(collection[i].nodeName.toUpperCase() + " can't be found in renderJs, you should firstly register in renderJs");
20
18
  }
21
19
  else {
22
20
  //找到,渲染自定义标签
23
- delivery(component, collection[i].parentNode, collection[i], contextController, tagLib, styleLib, rjsLib);
21
+ mpa_delivery(component, collection[i].parentNode, collection[i], contextController);
24
22
  }
25
23
  }
26
24
  else {
27
25
  //非自定义标签,深度解析
28
- renderHtml(collection[i].children, contextController, tagLib, styleLib, rjsLib);
26
+ renderHtml(collection[i].children, contextController);
29
27
  }
30
28
  }
31
29
  }
@@ -0,0 +1,7 @@
1
+ import { Component } from "../index";
2
+ /**
3
+ * This function is used to save the prototype component proto in the window object.
4
+ * So, you can hava a tip that we custom a property named 'tagLib' in the window object.
5
+ * @param component
6
+ */
7
+ export declare function registerTagLib(component: Component | Component[]): void;
@@ -1,15 +1,15 @@
1
+ import { get_tag_library } from "../system/recorder/table0/system_func_0";
1
2
  /**
2
3
  * This function is used to save the prototype component proto in the window object.
3
4
  * So, you can hava a tip that we custom a property named 'tagLib' in the window object.
4
- * @param application
5
5
  * @param component
6
6
  */
7
- export function registerTagLib(application, component) {
7
+ export function registerTagLib(component) {
8
8
  if (Array.isArray(component)) {
9
9
  //if the input parameter is an array of Component,do the code block.
10
10
  component.forEach(function (component) {
11
- if (!application.tagLib.has(component.getName().toUpperCase())) {
12
- application.tagLib.set(component.getName().toUpperCase(), component);
11
+ if (!get_tag_library().has(component.getName().toUpperCase())) {
12
+ get_tag_library().set(component.getName().toUpperCase(), component);
13
13
  }
14
14
  else {
15
15
  console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
@@ -17,8 +17,8 @@ export function registerTagLib(application, component) {
17
17
  });
18
18
  }
19
19
  else {
20
- if (!application.tagLib.has(component.getName().toUpperCase())) {
21
- application.tagLib.set(component.getName().toUpperCase(), component);
20
+ if (!get_tag_library().has(component.getName().toUpperCase())) {
21
+ get_tag_library().set(component.getName().toUpperCase(), component);
22
22
  }
23
23
  else {
24
24
  console.warn("The Tag:" + component.getName().toUpperCase() + "has been registered!");
@@ -1,29 +0,0 @@
1
- import { Component } from "../../render-refer/dist";
2
- import { ControllerGeneric } from "../generic/ControllerGeneric";
3
- import { ContextController } from "./ContextController";
4
- export declare class ComponentController implements ControllerGeneric {
5
- componentAttachedRootElement: ParentNode | Element;
6
- prototypeOfComponent: Component;
7
- parentController: ComponentController | ContextController;
8
- anchor: HTMLElement;
9
- begin: HTMLElement;
10
- componentConfig: {
11
- boxMode: boolean;
12
- plugins?: Map<string, any>;
13
- };
14
- originalData: {};
15
- dataForMethod: {};
16
- dataForComputed: {};
17
- salt: Map<string, any>;
18
- lazyComponent: Map<string, {}>;
19
- slaveComponent: ComponentController[];
20
- method: {};
21
- computed: {};
22
- watcher: {};
23
- constructor(config: {
24
- boxMode: boolean;
25
- $plugins?: Map<string, any>;
26
- });
27
- receiver(method: string, ...args: any[]): any;
28
- flush(): void;
29
- }
@@ -1,30 +0,0 @@
1
- import { update_Render } from "../runtime/update/UpdateRender";
2
- import RenderConfig from "../runtime/config/RenderConfig";
3
- var ComponentController = /** @class */ (function () {
4
- //构造函数
5
- function ComponentController(config) {
6
- this.originalData = {};
7
- this.method = {};
8
- this.dataForMethod = {};
9
- this.computed = {};
10
- this.dataForComputed = {};
11
- this.watcher = {};
12
- this.lazyComponent = new Map();
13
- this.slaveComponent = Array();
14
- this.salt = new Map();
15
- this.componentConfig = config;
16
- }
17
- //接收器
18
- ComponentController.prototype.receiver = function (method) {
19
- var args = [];
20
- for (var _i = 1; _i < arguments.length; _i++) {
21
- args[_i - 1] = arguments[_i];
22
- }
23
- return this.prototypeOfComponent.getMethods()[method].apply(this.dataForMethod, args);
24
- };
25
- ComponentController.prototype.flush = function () {
26
- update_Render(this, RenderConfig["tagLib"], RenderConfig["styleLib"]);
27
- };
28
- return ComponentController;
29
- }());
30
- export { ComponentController };