render-core 1.0.99 → 1.0.100

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.
@@ -0,0 +1,3 @@
1
+ export declare class ContextController {
2
+ constructor();
3
+ }
@@ -0,0 +1,6 @@
1
+ var ContextController = /** @class */ (function () {
2
+ function ContextController() {
3
+ }
4
+ return ContextController;
5
+ }());
6
+ export { ContextController };
@@ -0,0 +1,3 @@
1
+ export interface RenderTip {
2
+ use(callable: any): void;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -10,7 +10,7 @@ export function resolver_model(nodes, data) {
10
10
  nodes[i].removeAttribute("v-model");
11
11
  var tagName = nodes[i].tagName;
12
12
  nodes[i].setAttribute("name", dataName);
13
- if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
13
+ if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA" || tagName === "DATALIST") {
14
14
  var listener = function (evt) {
15
15
  if (!evt.target.hasAttribute("flag")) {
16
16
  //Get the event element
@@ -1,6 +1,6 @@
1
- import { inject, injectComputed, injectMethod, injectWatcher } from "../../core/inject/inject";
2
- import { getProxyObject } from "../../core/proxy/getProxy";
3
- import { getCodeSpaceForCommit, getCodeSpaceForProperty, getCodeSpaceForPublish, getCommitMethod, getPublishMethod, getSetterMethod } from "../../core/utility/injectUtility";
1
+ import { inject, injectComputed, injectMethod, injectWatcher } from "../inject/inject";
2
+ import { getProxyObject } from "../proxy/getProxy";
3
+ import { getCodeSpaceForCommit, getCodeSpaceForProperty, getCodeSpaceForPublish, getCommitMethod, getPublishMethod, getSetterMethod } from "../utility/injectUtility";
4
4
  /**
5
5
  * This function is used to initiate the component controller object.
6
6
  * @param controller
@@ -1,4 +1,4 @@
1
- import { checkStyleLabel } from "../../core/utility/styleUtility";
1
+ import { checkStyleLabel } from "../utility/styleUtility";
2
2
  /**
3
3
  * 加载自定义标签样式
4
4
  * @param tag
@@ -1,9 +1,9 @@
1
1
  import { ComponentController } from "../../class/controller/componentController";
2
- import { controllerCycleTypeTwo } from "../../library/lifecycle/controllerCycle";
3
- import { afterCmd, cmd } from "../../library/cmd/cmd";
4
- import { mount } from "../../library/lifecycle/mount";
2
+ import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
3
+ import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
+ import { mount } from "../lifecycle/mount";
5
5
  import { injectRefs } from "../inject/inject";
6
- import { afterMethodsTypeOne } from "../../library/lifecycle/afterMethods";
6
+ import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
7
7
  import { findComponent } from "./delivery";
8
8
  import { resolver_solt } from "../cmd/solt/v-solt";
9
9
  /**
@@ -25,7 +25,7 @@ export function post_render(proto, parent, child, link, tagTemplate) {
25
25
  var beforeRender = proto.getBeforeRender().bind(controller.raw_data);
26
26
  beforeRender();
27
27
  //解析指令
28
- cmd(tagTemplate, proto, controller);
28
+ cmdUtility(tagTemplate, proto, controller);
29
29
  //beforeMount
30
30
  var beforeMount = proto.getBeforeMount().bind(controller.raw_data);
31
31
  beforeMount();
@@ -1,9 +1,9 @@
1
1
  import { ComponentController } from "../../class/controller/componentController";
2
- import { controllerCycleTypeOne } from "../../library/lifecycle/controllerCycle";
3
- import { afterCmd, cmd } from "../../library/cmd/cmd";
4
- import { mount } from "../../library/lifecycle/mount";
2
+ import { controllerCycleTypeOne } from "../lifecycle/controllerCycle";
3
+ import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
+ import { mount } from "../lifecycle/mount";
5
5
  import { injectRefs } from "../inject/inject";
6
- import { afterMethodsTypeOne } from "../../library/lifecycle/afterMethods";
6
+ import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
7
7
  import { findComponent } from "./delivery";
8
8
  import { resolver_solt } from "../cmd/solt/v-solt";
9
9
  /**
@@ -25,7 +25,7 @@ export function init_render(proto, parent, child, link, tagTemplate) {
25
25
  var beforeRender = proto.getBeforeRender().bind(controller.raw_data);
26
26
  beforeRender();
27
27
  //内存中数据渲染
28
- cmd(tagTemplate, proto, controller);
28
+ cmdUtility(tagTemplate, proto, controller);
29
29
  //beforeMount
30
30
  var beforeMount = proto.getBeforeMount().bind(controller.raw_data);
31
31
  beforeMount();
@@ -1,9 +1,9 @@
1
1
  import { ComponentController } from "../../class/controller/componentController";
2
- import { controllerCycleTypeTwo } from "../../library/lifecycle/controllerCycle";
3
- import { afterCmd, cmd } from "../../library/cmd/cmd";
4
- import { mount } from "../../library/lifecycle/mount";
2
+ import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
3
+ import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
+ import { mount } from "../lifecycle/mount";
5
5
  import { injectRefs } from "../inject/inject";
6
- import { afterMethodsTypeTwo } from "../../library/lifecycle/afterMethods";
6
+ import { afterMethodsTypeTwo } from "../lifecycle/afterMethods";
7
7
  import { findComponent } from "./delivery";
8
8
  import { resolver_solt } from "../cmd/solt/v-solt";
9
9
  /**
@@ -25,7 +25,7 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
25
25
  var beforeRender = proto.getBeforeRender().bind(controller.raw_data);
26
26
  beforeRender();
27
27
  //解析指令
28
- cmd(tagTemplate, proto, controller);
28
+ cmdUtility(tagTemplate, proto, controller);
29
29
  //beforeMount
30
30
  var beforeMount = proto.getBeforeMount().bind(controller.raw_data);
31
31
  beforeMount();
@@ -1,4 +1,4 @@
1
- import { afterCmd, cmdForUpdate } from "../../library/cmd/cmd";
1
+ import { afterCmd, cmdUtility, } from "../utility/cmdUtility";
2
2
  import { injectRefs } from "../inject/inject";
3
3
  import { findComponent } from "./delivery";
4
4
  import { getTemplate } from "../utility/templateUtility";
@@ -17,7 +17,7 @@ export function update_Render(controller) {
17
17
  var beforeRender = controller.proto.getBeforeRender().bind(controller.raw_data);
18
18
  beforeRender();
19
19
  //解析指令
20
- cmdForUpdate(tagTemplate, controller.proto, controller);
20
+ cmdUtility(tagTemplate, controller.proto, controller);
21
21
  //beforeUnmount
22
22
  var beforeUnmount = controller.proto.getBeforeUnmount().bind(controller.raw_data);
23
23
  beforeUnmount();
@@ -1,4 +1,4 @@
1
- import metaTagLib from "../../runtime/database/metaTagLib";
1
+ import metaTagLib from "../../runtime/metaTagLib";
2
2
  export function isUnKnown(element) {
3
3
  return !metaTagLib.some(function (ele) { return ele == element; });
4
4
  }
@@ -6,7 +6,7 @@ import { ComponentController } from "../../class/controller/componentController"
6
6
  * @param proto
7
7
  * @param controller
8
8
  */
9
- export declare function cmd(tagTemplate: Element, proto: Component, controller: ComponentController): void;
9
+ export declare function cmdUtility(tagTemplate: Element, proto: Component, controller: ComponentController): void;
10
10
  /**
11
11
  * This function is used to resolver those commands which should be executed after mount.
12
12
  * @param templateSpace
@@ -14,10 +14,3 @@ export declare function cmd(tagTemplate: Element, proto: Component, controller:
14
14
  * @param controller
15
15
  */
16
16
  export declare function afterCmd(templateSpace: ParentNode, proto: Component, controller: ComponentController): void;
17
- /**
18
- *
19
- * @param tagTemplate
20
- * @param proto
21
- * @param controller
22
- */
23
- export declare function cmdForUpdate(tagTemplate: Element, proto: Component, controller: ComponentController): void;
@@ -0,0 +1,57 @@
1
+ import { addLabel } from "./miscUtility";
2
+ import { resolver_event } from "../cmd/method/v-on";
3
+ import { resolver_html } from "../cmd/data/v-html";
4
+ import { resolver_txt } from "../cmd/data/v-txt";
5
+ import { resolver_model } from "../cmd/react/v-model";
6
+ import { resolver_bind } from "../cmd/property/v-bind";
7
+ import { resolver_show } from "../cmd/justify/v-show";
8
+ import { resolver_render } from "../cmd/justify/v-render";
9
+ import { resolver_if } from "../cmd/justify/v-if";
10
+ import { resolver_switch } from "../cmd/justify/v-switch";
11
+ import { resolver_for_each, resolver_for_of } from "../cmd/loop/v-for";
12
+ import { extract_solt } from "../cmd/solt/v-solt";
13
+ import { resolver_experssion } from "../cmd/data/v-el";
14
+ /**
15
+ * This function is used to resolver those commands which should be executed before mount.
16
+ * @param tagTemplate
17
+ * @param proto
18
+ * @param controller
19
+ */
20
+ export function cmdUtility(tagTemplate, proto, controller) {
21
+ //给所有元素添加上npm=tag标志
22
+ addLabel(tagTemplate.children, proto.getName());
23
+ //将元素事件绑定到元素上
24
+ resolver_event(tagTemplate.children, proto.getMethods(), controller.proxyForMethods);
25
+ //渲染html
26
+ resolver_html(tagTemplate.children, controller.proxyForMethods, controller);
27
+ //渲染text
28
+ resolver_txt(tagTemplate.children, controller.proxyForMethods, controller);
29
+ //绑定数据
30
+ resolver_model(tagTemplate.children, controller.proxyForMethods);
31
+ //渲染属性
32
+ resolver_bind(tagTemplate.children, controller.proxyForMethods);
33
+ //solt
34
+ extract_solt(tagTemplate.children, controller);
35
+ }
36
+ /**
37
+ * This function is used to resolver those commands which should be executed after mount.
38
+ * @param templateSpace
39
+ * @param proto
40
+ * @param controller
41
+ */
42
+ export function afterCmd(templateSpace, proto, controller) {
43
+ //v-show
44
+ resolver_show(templateSpace.children, controller.proxyForMethods);
45
+ //v-render
46
+ resolver_render(templateSpace.children, controller.proxyForMethods);
47
+ //v-if
48
+ resolver_if(templateSpace.children, controller.proxyForMethods);
49
+ //v-switch
50
+ resolver_switch(templateSpace.children, controller.proxyForMethods);
51
+ //v-for-each
52
+ resolver_for_each(templateSpace.children, controller.proxyForMethods);
53
+ //v-for-of
54
+ resolver_for_of(templateSpace.children, controller.proxyForMethods);
55
+ //v-el
56
+ resolver_experssion(controller.root, controller.proxyForMethods, controller);
57
+ }
@@ -1,4 +1,4 @@
1
- import { loadStyle } from "../../library/loader/loader";
1
+ import { loadStyle } from "../loader/loader";
2
2
  // @ts-ignore
3
3
  import { sessionStorageEngin_read } from "render-status/read/read";
4
4
  /**
@@ -1,2 +1,15 @@
1
+ /**
2
+ *
3
+ * @param baseRoot
4
+ * @param temp
5
+ * @param index
6
+ * @param data
7
+ */
1
8
  export declare function extractForArray(baseRoot: ParentNode, temp: Node, index: number, data: any): void;
9
+ /**
10
+ *
11
+ * @param baseRoot
12
+ * @param temp
13
+ * @param data
14
+ */
2
15
  export declare function extractForMap(baseRoot: ParentNode, temp: Node, data: any): void;
@@ -1,7 +1,20 @@
1
1
  import { part_render_array, part_render_map } from "../render/partRender";
2
+ /**
3
+ *
4
+ * @param baseRoot
5
+ * @param temp
6
+ * @param index
7
+ * @param data
8
+ */
2
9
  export function extractForArray(baseRoot, temp, index, data) {
3
10
  part_render_array(baseRoot, temp, index, data);
4
11
  }
12
+ /**
13
+ *
14
+ * @param baseRoot
15
+ * @param temp
16
+ * @param data
17
+ */
5
18
  export function extractForMap(baseRoot, temp, data) {
6
19
  part_render_map(baseRoot, temp, data);
7
20
  }
package/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { Component } from "./class/component/component";
2
2
  import { routerController } from "render-security/class/Router";
3
3
  import { PageController } from "./class/controller/pageController";
4
+ import { RenderTip } from "./class/tips/renderTip";
4
5
  /**
5
6
  * This class is the application class.
6
7
  */
7
- export declare class RenderJS {
8
+ export declare class RenderJS implements RenderTip {
8
9
  readonly config: {};
9
10
  readonly tagLib: Map<string, Component>;
10
11
  readonly styleLib: Map<string, Map<string, string>>;
@@ -23,6 +24,11 @@ export declare class RenderJS {
23
24
  * @param component
24
25
  */
25
26
  addTag(component: Component | Component[]): void;
27
+ /**
28
+ *
29
+ * @param callable
30
+ */
31
+ use(callable: any): void;
26
32
  /**
27
33
  * This method is the boster method of the render.
28
34
  */
package/index.js CHANGED
@@ -37,6 +37,13 @@ var RenderJS = /** @class */ (function () {
37
37
  RenderJS.prototype.addTag = function (component) {
38
38
  registerTagLib(this, component);
39
39
  };
40
+ /**
41
+ *
42
+ * @param callable
43
+ */
44
+ RenderJS.prototype.use = function (callable) {
45
+ callable(this);
46
+ };
40
47
  /**
41
48
  * This method is the boster method of the render.
42
49
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.0.99",
3
+ "version": "1.0.100",
4
4
  "description": "The core of render-js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,77 +0,0 @@
1
- import { addLabel } from "../../core/utility/miscUtility";
2
- import { resolver_event } from "../../core/cmd/method/v-on";
3
- import { resolver_html } from "../../core/cmd/data/v-html";
4
- import { resolver_txt } from "../../core/cmd/data/v-txt";
5
- import { resolver_model } from "../../core/cmd/react/v-model";
6
- import { resolver_bind } from "../../core/cmd/property/v-bind";
7
- import { resolver_show } from "../../core/cmd/justify/v-show";
8
- import { resolver_render } from "../../core/cmd/justify/v-render";
9
- import { resolver_if } from "../../core/cmd/justify/v-if";
10
- import { resolver_switch } from "../../core/cmd/justify/v-switch";
11
- import { resolver_for_each, resolver_for_of } from "../../core/cmd/loop/v-for";
12
- import { extract_solt } from "../../core/cmd/solt/v-solt";
13
- import { resolver_experssion } from "../../core/cmd/data/v-el";
14
- /**
15
- * This function is used to resolver those commands which should be executed before mount.
16
- * @param tagTemplate
17
- * @param proto
18
- * @param controller
19
- */
20
- export function cmd(tagTemplate, proto, controller) {
21
- //给所有元素添加上npm=tag标志
22
- addLabel(tagTemplate.children, proto.getName());
23
- //将元素事件绑定到元素上
24
- resolver_event(tagTemplate.children, proto.getMethods(), controller.proxyForMethods);
25
- //渲染html
26
- resolver_html(tagTemplate.children, controller.proxyForMethods, controller);
27
- //渲染text
28
- resolver_txt(tagTemplate.children, controller.proxyForMethods, controller);
29
- //绑定数据
30
- resolver_model(tagTemplate.children, controller.proxyForMethods);
31
- //渲染属性
32
- resolver_bind(tagTemplate.children, controller.proxyForMethods);
33
- //solt
34
- extract_solt(tagTemplate.children, controller);
35
- }
36
- /**
37
- * This function is used to resolver those commands which should be executed after mount.
38
- * @param templateSpace
39
- * @param proto
40
- * @param controller
41
- */
42
- export function afterCmd(templateSpace, proto, controller) {
43
- //v-show
44
- resolver_show(templateSpace.children, controller.proxyForMethods);
45
- //v-render
46
- resolver_render(templateSpace.children, controller.proxyForMethods);
47
- //v-if
48
- resolver_if(templateSpace.children, controller.proxyForMethods);
49
- //v-switch
50
- resolver_switch(templateSpace.children, controller.proxyForMethods);
51
- //v-for-each
52
- resolver_for_each(templateSpace.children, controller.proxyForMethods);
53
- //v-for-of
54
- resolver_for_of(templateSpace.children, controller.proxyForMethods);
55
- //v-el
56
- resolver_experssion(controller.root, controller.proxyForMethods, controller);
57
- }
58
- /**
59
- *
60
- * @param tagTemplate
61
- * @param proto
62
- * @param controller
63
- */
64
- export function cmdForUpdate(tagTemplate, proto, controller) {
65
- //给所有元素添加上npm=tag标志
66
- addLabel(tagTemplate.children, proto.getName());
67
- //将元素事件绑定到元素上
68
- resolver_event(tagTemplate.children, proto.getMethods(), controller.proxyForMethods);
69
- //渲染html
70
- resolver_html(tagTemplate.children, controller.proxyForMethods, controller);
71
- //渲染text
72
- resolver_txt(tagTemplate.children, controller.proxyForMethods, controller);
73
- //v-show
74
- resolver_show(tagTemplate.children, controller.proxyForMethods);
75
- //v-render
76
- resolver_render(tagTemplate.children, controller.proxyForMethods);
77
- }
File without changes
File without changes
File without changes
File without changes
File without changes