render-core 1.0.97 → 1.0.99
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.
package/core/proxy/getProxy.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { bindModelForUpdater } from "../utility/miscUtility";
|
|
2
1
|
import { afterCmd, cmdForUpdate } from "../../library/cmd/cmd";
|
|
3
2
|
import { injectRefs } from "../inject/inject";
|
|
4
3
|
import { findComponent } from "./delivery";
|
|
5
4
|
import { getTemplate } from "../utility/templateUtility";
|
|
5
|
+
import { resolver_model } from "../cmd/react/v-model";
|
|
6
|
+
import { locateInputAddress } from "../utility/sectionUtility";
|
|
6
7
|
/**
|
|
7
8
|
* 更新渲染方法
|
|
8
9
|
* @param controller
|
|
@@ -37,8 +38,9 @@ export function update_Render(controller) {
|
|
|
37
38
|
//afterRender
|
|
38
39
|
var afterRender = controller.proto.getAfterRender().bind(controller.raw_data);
|
|
39
40
|
afterRender();
|
|
41
|
+
resolver_model(controller.root.children, controller.proxyForMethods);
|
|
40
42
|
//获取定位
|
|
41
|
-
|
|
43
|
+
locateInputAddress(controller);
|
|
42
44
|
//深度渲染
|
|
43
45
|
findComponent(controller.root.children, controller);
|
|
44
46
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
1
|
/**
|
|
3
2
|
* 给组件元素添加cpn标签
|
|
4
3
|
* @param nodes
|
|
5
4
|
* @param component
|
|
6
5
|
*/
|
|
7
6
|
export declare function addLabel(nodes: HTMLCollection, component: string): void;
|
|
8
|
-
export declare function bindModelForUpdater(nodes: HTMLCollection, data: {}, controller: ComponentController): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { locateInputAddress } from "./sectionUtility";
|
|
2
1
|
/**
|
|
3
2
|
* 给组件元素添加cpn标签
|
|
4
3
|
* @param nodes
|
|
@@ -11,51 +10,3 @@ export function addLabel(nodes, component) {
|
|
|
11
10
|
addLabel(kk, component);
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
|
-
export function bindModelForUpdater(nodes, data, controller) {
|
|
15
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
16
|
-
if (nodes[i].hasAttribute("v-model")) {
|
|
17
|
-
var dataName = nodes[i].getAttribute("v-model");
|
|
18
|
-
nodes[i].removeAttribute("v-model");
|
|
19
|
-
var tagName = nodes[i].tagName;
|
|
20
|
-
nodes[i].setAttribute("name", dataName);
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
nodes[i].setAttribute("value", data[dataName]);
|
|
23
|
-
if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
|
|
24
|
-
nodes[i].setAttribute("name", dataName);
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
nodes[i].setAttribute("value", data[dataName]);
|
|
27
|
-
//光标定位
|
|
28
|
-
var listener = function (evt) {
|
|
29
|
-
if (!evt.target.hasAttribute("flag")) {
|
|
30
|
-
//Get the event element
|
|
31
|
-
var element = evt.target;
|
|
32
|
-
//Get the name attribute
|
|
33
|
-
var dataName_1 = element.name;
|
|
34
|
-
Reflect.set(this, "origin", {
|
|
35
|
-
cpn: element.getAttribute("cpn"),
|
|
36
|
-
tag: element.nodeName,
|
|
37
|
-
name: element.getAttribute("name")
|
|
38
|
-
});
|
|
39
|
-
//Update the value
|
|
40
|
-
this[dataName_1] = element.value;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var compositionstart = function (evt) {
|
|
44
|
-
evt.target.setAttribute("flag", "false");
|
|
45
|
-
};
|
|
46
|
-
var compositionend = function (evt) {
|
|
47
|
-
evt.target.setAttribute("flag", "true");
|
|
48
|
-
var element = evt.target;
|
|
49
|
-
var dataName = element.name;
|
|
50
|
-
this[dataName] = element.value;
|
|
51
|
-
};
|
|
52
|
-
nodes[i].addEventListener("input", listener.bind(data));
|
|
53
|
-
nodes[i].addEventListener("compositionstart", compositionstart);
|
|
54
|
-
nodes[i].addEventListener("compositionend", compositionend.bind(data));
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
locateInputAddress(controller);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
bindModelForUpdater(nodes[i].children, data, controller);
|
|
60
|
-
}
|
|
61
|
-
}
|