render-core 1.3.36 → 1.3.37

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.
@@ -10,6 +10,11 @@ export declare function inject(controller: ComponentController): void;
10
10
  * @param controller
11
11
  */
12
12
  export declare function injectRefs(controller: ComponentController): void;
13
+ /**
14
+ *
15
+ * @param controller
16
+ */
17
+ export declare function injectRoot(controller: ComponentController): void;
13
18
  /**
14
19
  *
15
20
  * @param controller
@@ -23,6 +23,13 @@ export function injectRefs(controller) {
23
23
  resolver_Refs(controller.root.children, refs);
24
24
  getCodeSpaceForRef(controller.raw_data, refs);
25
25
  }
26
+ /**
27
+ *
28
+ * @param controller
29
+ */
30
+ export function injectRoot(controller) {
31
+ Reflect.set(controller.raw_data, "$root", controller.root);
32
+ }
26
33
  /**
27
34
  *
28
35
  * @param controller
@@ -10,7 +10,8 @@ import { Component } from "../../class/component/component";
10
10
  */
11
11
  export declare function mount(controller: ComponentController, proto: Component, parent: ParentNode, child: Element, tagTemplate: Element): void;
12
12
  /**
13
- * insert elements without div elment
13
+ * insert elements without div element
14
14
  * @param root
15
+ * @param controller
15
16
  */
16
- export declare function unBox(root: ParentNode): void;
17
+ export declare function unBox(root: ParentNode, controller: ComponentController): void;
@@ -20,12 +20,15 @@ export function mount(controller, proto, parent, child, tagTemplate) {
20
20
  }
21
21
  }
22
22
  /**
23
- * insert elements without div elment
23
+ * insert elements without div element
24
24
  * @param root
25
+ * @param controller
25
26
  */
26
- export function unBox(root) {
27
+ export function unBox(root, controller) {
27
28
  while (root.hasChildNodes()) {
28
29
  root.parentNode.insertBefore(root.firstChild, root);
29
30
  }
31
+ controller.root = root.parentNode;
32
+ Reflect.set(controller.raw_data, "$root", root.parentNode);
30
33
  root.parentNode.removeChild(root);
31
34
  }
@@ -2,7 +2,7 @@ import { ComponentController } from "../../class/controller/componentController"
2
2
  import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
3
3
  import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
4
  import { mount, unBox } from "../lifecycle/mount";
5
- import { injectRefs } from "../inject/inject";
5
+ import { injectRefs, injectRoot } from "../inject/inject";
6
6
  import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
7
7
  import { findComponent } from "./delivery";
8
8
  import { resolver_solt } from "../cmd/solt/v-solt";
@@ -27,7 +27,10 @@ export function post_render(proto, parent, child, link, tagTemplate) {
27
27
  cmdUtility(tagTemplate, proto, controller);
28
28
  //mount
29
29
  mount(controller, proto, parent, child, tagTemplate);
30
+ //注入引用
30
31
  injectRefs(controller);
32
+ //注入root
33
+ injectRoot(controller);
31
34
  //渲染后处理
32
35
  afterCmd(controller.root, controller.proto, controller);
33
36
  //后处理
@@ -37,6 +40,6 @@ export function post_render(proto, parent, child, link, tagTemplate) {
37
40
  //深度渲染
38
41
  findComponent(controller.root.children, controller);
39
42
  if (proto.getMode() === "insert") {
40
- unBox(controller.root);
43
+ unBox(controller.root, controller);
41
44
  }
42
45
  }
@@ -2,7 +2,7 @@ import { ComponentController } from "../../class/controller/componentController"
2
2
  import { controllerCycleTypeOne } from "../lifecycle/controllerCycle";
3
3
  import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
4
  import { mount, unBox } from "../lifecycle/mount";
5
- import { injectRefs } from "../inject/inject";
5
+ import { injectRefs, injectRoot } from "../inject/inject";
6
6
  import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
7
7
  import { findComponent } from "./delivery";
8
8
  import { resolver_solt } from "../cmd/solt/v-solt";
@@ -27,6 +27,8 @@ export function init_render(proto, parent, child, link, tagTemplate) {
27
27
  mount(controller, proto, parent, child, tagTemplate);
28
28
  //获取
29
29
  injectRefs(controller);
30
+ //注入root
31
+ injectRoot(controller);
30
32
  //渲染后数据处理
31
33
  afterCmd(controller.root, proto, controller);
32
34
  //后处理
@@ -34,6 +36,6 @@ export function init_render(proto, parent, child, link, tagTemplate) {
34
36
  //深度渲染
35
37
  findComponent(tagTemplate.children, controller);
36
38
  if (proto.getMode() === "insert") {
37
- unBox(controller.root);
39
+ unBox(controller.root, controller);
38
40
  }
39
41
  }
@@ -2,7 +2,7 @@ import { ComponentController } from "../../class/controller/componentController"
2
2
  import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
3
3
  import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
4
  import { mount, unBox } from "../lifecycle/mount";
5
- import { injectRefs } from "../inject/inject";
5
+ import { injectRefs, injectRoot } from "../inject/inject";
6
6
  import { afterMethodsTypeTwo } from "../lifecycle/afterMethods";
7
7
  import { findComponent } from "./delivery";
8
8
  import { resolver_solt } from "../cmd/solt/v-solt";
@@ -29,6 +29,8 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
29
29
  mount(controller, proto, parent, child, tagTemplate);
30
30
  //获取注入引用资源
31
31
  injectRefs(controller);
32
+ //注入root
33
+ injectRoot(controller);
32
34
  //渲染后处理
33
35
  afterCmd(controller.root, proto, controller);
34
36
  //后处理(数据渲染)
@@ -38,6 +40,6 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
38
40
  //深度渲染
39
41
  findComponent(controller.root.children, controller);
40
42
  if (proto.getMode() === "insert") {
41
- unBox(controller.root);
43
+ unBox(controller.root, controller);
42
44
  }
43
45
  }
@@ -1,5 +1,5 @@
1
1
  import { afterCmd, cmdUtility, } from "../utility/cmdUtility";
2
- import { injectRefs } from "../inject/inject";
2
+ import { injectRefs, injectRoot } from "../inject/inject";
3
3
  import { findComponent } from "./delivery";
4
4
  import { getTemplate } from "../utility/templateUtility";
5
5
  /**
@@ -21,7 +21,10 @@ export function update_Render(controller) {
21
21
  while (tagTemplate.hasChildNodes()) {
22
22
  controller.root.appendChild(tagTemplate.firstChild);
23
23
  }
24
+ //注入引用
24
25
  injectRefs(controller);
26
+ //注入root
27
+ injectRoot(controller);
25
28
  //渲染后处理
26
29
  afterCmd(controller.root, controller.proto, controller);
27
30
  //深度渲染
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.3.36",
3
+ "version": "1.3.37",
4
4
  "description": "The core of render-js",
5
5
  "keywords": [
6
6
  "render",