render-core 1.3.38 → 1.3.39
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/class/component/component.d.ts +41 -41
- package/class/component/component.js +108 -108
- package/class/controller/appController.d.ts +44 -44
- package/class/controller/appController.js +132 -132
- package/class/controller/componentController.d.ts +15 -15
- package/class/controller/componentController.js +22 -22
- package/class/controller/contextController.d.ts +18 -18
- package/class/controller/contextController.js +79 -79
- package/class/controller/pageController.d.ts +23 -23
- package/class/controller/pageController.js +40 -40
- package/class/tips/appTip.d.ts +2 -2
- package/class/tips/appTip.js +1 -1
- package/class/tips/componentTip.d.ts +13 -13
- package/class/tips/componentTip.js +1 -1
- package/class/tips/renderTip.d.ts +5 -5
- package/class/tips/renderTip.js +1 -1
- package/core/cmd/data/v-el.d.ts +8 -8
- package/core/cmd/data/v-el.js +28 -28
- package/core/cmd/data/v-html.d.ts +8 -8
- package/core/cmd/data/v-html.js +26 -26
- package/core/cmd/data/v-txt.d.ts +8 -8
- package/core/cmd/data/v-txt.js +29 -29
- package/core/cmd/justify/v-if.d.ts +6 -6
- package/core/cmd/justify/v-if.js +43 -43
- package/core/cmd/justify/v-render.d.ts +6 -6
- package/core/cmd/justify/v-render.js +26 -26
- package/core/cmd/justify/v-show.d.ts +6 -6
- package/core/cmd/justify/v-show.js +26 -26
- package/core/cmd/justify/v-switch.d.ts +6 -6
- package/core/cmd/justify/v-switch.js +35 -35
- package/core/cmd/loop/v-for.d.ts +12 -12
- package/core/cmd/loop/v-for.js +63 -63
- package/core/cmd/loop/v-index.d.ts +14 -14
- package/core/cmd/loop/v-index.js +80 -79
- package/core/cmd/loop/v-key.d.ts +12 -12
- package/core/cmd/loop/v-key.js +70 -70
- package/core/cmd/method/v-on.d.ts +8 -8
- package/core/cmd/method/v-on.js +40 -40
- package/core/cmd/property/v-bind.d.ts +6 -6
- package/core/cmd/property/v-bind.js +33 -33
- package/core/cmd/react/v-model.d.ts +6 -6
- package/core/cmd/react/v-model.js +22 -22
- package/core/cmd/ref/v-ref.d.ts +6 -6
- package/core/cmd/ref/v-ref.js +16 -16
- package/core/cmd/solt/v-solt.d.ts +14 -14
- package/core/cmd/solt/v-solt.js +46 -46
- package/core/inject/inject.d.ts +30 -35
- package/core/inject/inject.js +63 -70
- package/core/lifecycle/afterMethods.d.ts +16 -16
- package/core/lifecycle/afterMethods.js +22 -22
- package/core/lifecycle/controllerCycle.d.ts +13 -13
- package/core/lifecycle/controllerCycle.js +42 -42
- package/core/lifecycle/mount.d.ts +16 -17
- package/core/lifecycle/mount.js +31 -34
- package/core/loader/loader.d.ts +7 -7
- package/core/loader/loader.js +18 -18
- package/core/proxy/getProxy.d.ts +13 -13
- package/core/proxy/getProxy.js +42 -42
- package/core/render/PostRender.d.ts +12 -12
- package/core/render/PostRender.js +42 -45
- package/core/render/delivery.d.ts +5 -5
- package/core/render/delivery.js +42 -42
- package/core/render/initRender.d.ts +12 -12
- package/core/render/initRender.js +39 -41
- package/core/render/partRender.d.ts +15 -15
- package/core/render/partRender.js +31 -31
- package/core/render/rawRender.d.ts +12 -12
- package/core/render/rawRender.js +43 -45
- package/core/render/updateRender.d.ts +6 -6
- package/core/render/updateRender.js +29 -32
- package/core/resolver/props.d.ts +18 -18
- package/core/resolver/props.js +60 -60
- package/core/resolver/query.d.ts +4 -4
- package/core/resolver/query.js +15 -15
- package/core/utility/checkUtility.d.ts +1 -1
- package/core/utility/checkUtility.js +4 -4
- package/core/utility/cmdUtility.d.ts +16 -16
- package/core/utility/cmdUtility.js +57 -57
- package/core/utility/dataUtility.d.ts +1 -1
- package/core/utility/dataUtility.js +8 -8
- package/core/utility/errorUtility.d.ts +3 -3
- package/core/utility/errorUtility.js +9 -9
- package/core/utility/injectUtility.d.ts +13 -13
- package/core/utility/injectUtility.js +58 -58
- package/core/utility/inputType.d.ts +5 -5
- package/core/utility/inputType.js +20 -20
- package/core/utility/inputUtility.d.ts +4 -4
- package/core/utility/inputUtility.js +100 -100
- package/core/utility/miscUtility.d.ts +6 -6
- package/core/utility/miscUtility.js +12 -12
- package/core/utility/modelUtility.d.ts +15 -15
- package/core/utility/modelUtility.js +66 -66
- package/core/utility/sectionUtility.d.ts +6 -6
- package/core/utility/sectionUtility.js +104 -104
- package/core/utility/styleUtility.d.ts +29 -29
- package/core/utility/styleUtility.js +114 -114
- package/core/utility/templateUtility.d.ts +6 -6
- package/core/utility/templateUtility.js +13 -13
- package/core/utility/vForUtility.d.ts +15 -15
- package/core/utility/vForUtility.js +20 -20
- package/func/Theme.d.ts +16 -16
- package/func/Theme.js +27 -27
- package/http/redirect/redirect.d.ts +11 -11
- package/http/redirect/redirect.js +36 -36
- package/index.d.ts +71 -71
- package/index.js +130 -130
- package/package.json +3 -8
- package/runtime/metaTagLib.d.ts +2 -2
- package/runtime/metaTagLib.js +27 -27
- package/runtime/runtime.d.ts +7 -7
- package/runtime/runtime.js +26 -26
- package/runtime/tools.d.ts +14 -14
- package/runtime/tools.js +49 -49
- package/status/read/read.d.ts +10 -10
- package/status/read/read.js +26 -26
- package/status/write/write.d.ts +12 -12
- package/status/write/write.js +92 -92
- package/README.md +0 -2
package/core/cmd/loop/v-key.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 展开数据
|
|
3
|
-
* @param element
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_map_single(element: Element, data: any): void;
|
|
7
|
-
/**
|
|
8
|
-
* 向根元素子元素展开数据
|
|
9
|
-
* @param elements
|
|
10
|
-
* @param data
|
|
11
|
-
*/
|
|
12
|
-
export declare function resolver_map_multi(elements: HTMLCollection, data: any): void;
|
|
1
|
+
/**
|
|
2
|
+
* 展开数据
|
|
3
|
+
* @param element
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_map_single(element: Element, data: any): void;
|
|
7
|
+
/**
|
|
8
|
+
* 向根元素子元素展开数据
|
|
9
|
+
* @param elements
|
|
10
|
+
* @param data
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolver_map_multi(elements: HTMLCollection, data: any): void;
|
package/core/cmd/loop/v-key.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { part_render_map } from "../../render/partRender";
|
|
2
|
-
import { extractForArray } from "../../utility/vForUtility";
|
|
3
|
-
/**
|
|
4
|
-
* 展开数据
|
|
5
|
-
* @param element
|
|
6
|
-
* @param data
|
|
7
|
-
*/
|
|
8
|
-
export function resolver_map_single(element, data) {
|
|
9
|
-
//检查v-data
|
|
10
|
-
if (element.hasAttribute("@section")) {
|
|
11
|
-
var property = element.getAttribute("@section");
|
|
12
|
-
element.removeAttribute("@section");
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
element.innerText = data[property];
|
|
15
|
-
}
|
|
16
|
-
//深度展开
|
|
17
|
-
resolver_map_multi(element.children, data);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* 向根元素子元素展开数据
|
|
21
|
-
* @param elements
|
|
22
|
-
* @param data
|
|
23
|
-
*/
|
|
24
|
-
export function resolver_map_multi(elements, data) {
|
|
25
|
-
var _loop_1 = function (i) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
elements[i].
|
|
49
|
-
i
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
//深度展开
|
|
60
|
-
if (elements[i]) {
|
|
61
|
-
resolver_map_multi(elements[i].children, data);
|
|
62
|
-
}
|
|
63
|
-
out_i_1 = i;
|
|
64
|
-
};
|
|
65
|
-
var out_i_1;
|
|
66
|
-
for (var i = 0; i < elements.length; i++) {
|
|
67
|
-
_loop_1(i);
|
|
68
|
-
i = out_i_1;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
import { part_render_map } from "../../render/partRender";
|
|
2
|
+
import { extractForArray } from "../../utility/vForUtility";
|
|
3
|
+
/**
|
|
4
|
+
* 展开数据
|
|
5
|
+
* @param element
|
|
6
|
+
* @param data
|
|
7
|
+
*/
|
|
8
|
+
export function resolver_map_single(element, data) {
|
|
9
|
+
//检查v-data
|
|
10
|
+
if (element.hasAttribute("@section")) {
|
|
11
|
+
var property = element.getAttribute("@section");
|
|
12
|
+
element.removeAttribute("@section");
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
element.innerText = data[property];
|
|
15
|
+
}
|
|
16
|
+
//深度展开
|
|
17
|
+
resolver_map_multi(element.children, data);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 向根元素子元素展开数据
|
|
21
|
+
* @param elements
|
|
22
|
+
* @param data
|
|
23
|
+
*/
|
|
24
|
+
export function resolver_map_multi(elements, data) {
|
|
25
|
+
var _loop_1 = function (i) {
|
|
26
|
+
//检查v-key
|
|
27
|
+
if (elements[i].hasAttribute("@section")) {
|
|
28
|
+
var property = elements[i].getAttribute("@section");
|
|
29
|
+
elements[i].removeAttribute("@section");
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
elements[i].innerText = data[property];
|
|
32
|
+
}
|
|
33
|
+
if (elements[i]) {
|
|
34
|
+
//检查v-for-item
|
|
35
|
+
if (elements[i].hasAttribute("@document-document")) {
|
|
36
|
+
var property = elements[i].getAttribute("@document-document");
|
|
37
|
+
elements[i].removeAttribute("@document-document");
|
|
38
|
+
part_render_map(elements[i].parentNode, elements[i], data[property]);
|
|
39
|
+
i++;
|
|
40
|
+
//删除节点
|
|
41
|
+
elements[i].parentNode.removeChild(elements[i]);
|
|
42
|
+
i--;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (elements[i]) {
|
|
46
|
+
//检查v-for-array
|
|
47
|
+
if (elements[i].hasAttribute("@document-list")) {
|
|
48
|
+
var property = elements[i].getAttribute("@document-list");
|
|
49
|
+
elements[i].removeAttribute("@document-list");
|
|
50
|
+
data[property].forEach(function (value, index) {
|
|
51
|
+
extractForArray(elements[i].parentNode, elements[i], index, value);
|
|
52
|
+
i++;
|
|
53
|
+
});
|
|
54
|
+
//删除节点
|
|
55
|
+
elements[i].parentNode.removeChild(elements[i]);
|
|
56
|
+
i--;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//深度展开
|
|
60
|
+
if (elements[i]) {
|
|
61
|
+
resolver_map_multi(elements[i].children, data);
|
|
62
|
+
}
|
|
63
|
+
out_i_1 = i;
|
|
64
|
+
};
|
|
65
|
+
var out_i_1;
|
|
66
|
+
for (var i = 0; i < elements.length; i++) {
|
|
67
|
+
_loop_1(i);
|
|
68
|
+
i = out_i_1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param methods
|
|
5
|
-
* @param data
|
|
6
|
-
* @param rawData
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_event(elements: HTMLCollection, methods: {}, data: {}, rawData: {}): void;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param methods
|
|
5
|
+
* @param data
|
|
6
|
+
* @param rawData
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolver_event(elements: HTMLCollection, methods: {}, data: {}, rawData: {}): void;
|
package/core/cmd/method/v-on.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param methods
|
|
5
|
-
* @param data
|
|
6
|
-
* @param rawData
|
|
7
|
-
*/
|
|
8
|
-
export function resolver_event(elements, methods, data, rawData) {
|
|
9
|
-
//遍历所有的元素节点
|
|
10
|
-
for (var i = 0; i < elements.length; i++) {
|
|
11
|
-
//获取元素节点所有属性
|
|
12
|
-
var attributes = elements[i].getAttributeNames();
|
|
13
|
-
//解析元素的所有属性
|
|
14
|
-
for (var j = 0; j < attributes.length; j++) {
|
|
15
|
-
//检查属性名称以及匹配绑定方法
|
|
16
|
-
var result = attributes[j].match(/^@on:([a-z]+)$/g);
|
|
17
|
-
//如何属性匹配
|
|
18
|
-
if (result !== null) {
|
|
19
|
-
for (var k = 0; k < result.length; k++) {
|
|
20
|
-
var action = result[k].substring(4);
|
|
21
|
-
var method = elements[i].getAttribute(result[k]);
|
|
22
|
-
elements[i].removeAttribute(result[k]);
|
|
23
|
-
try {
|
|
24
|
-
if (method.match(/^\$\$[a-zA-Z0-9_]*/) !== null) {
|
|
25
|
-
elements[i].addEventListener(action, methods[method].bind(rawData));
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
elements[i].addEventListener(action, methods[method].bind(data));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
console.error("Can not find method:" + method + " in the component");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//深度解析属性
|
|
38
|
-
resolver_event(elements[i].children, methods, data, rawData);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param methods
|
|
5
|
+
* @param data
|
|
6
|
+
* @param rawData
|
|
7
|
+
*/
|
|
8
|
+
export function resolver_event(elements, methods, data, rawData) {
|
|
9
|
+
//遍历所有的元素节点
|
|
10
|
+
for (var i = 0; i < elements.length; i++) {
|
|
11
|
+
//获取元素节点所有属性
|
|
12
|
+
var attributes = elements[i].getAttributeNames();
|
|
13
|
+
//解析元素的所有属性
|
|
14
|
+
for (var j = 0; j < attributes.length; j++) {
|
|
15
|
+
//检查属性名称以及匹配绑定方法
|
|
16
|
+
var result = attributes[j].match(/^@on:([a-z]+)$/g);
|
|
17
|
+
//如何属性匹配
|
|
18
|
+
if (result !== null) {
|
|
19
|
+
for (var k = 0; k < result.length; k++) {
|
|
20
|
+
var action = result[k].substring(4);
|
|
21
|
+
var method = elements[i].getAttribute(result[k]);
|
|
22
|
+
elements[i].removeAttribute(result[k]);
|
|
23
|
+
try {
|
|
24
|
+
if (method.match(/^\$\$[a-zA-Z0-9_]*/) !== null) {
|
|
25
|
+
elements[i].addEventListener(action, methods[method].bind(rawData));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
elements[i].addEventListener(action, methods[method].bind(data));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
console.error("Can not find method:" + method + " in the component");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//深度解析属性
|
|
38
|
+
resolver_event(elements[i].children, methods, data, rawData);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param nodes
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_bind(nodes: HTMLCollection, data: {}): void;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param nodes
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_bind(nodes: HTMLCollection, data: {}): void;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { isUnKnown } from "../../utility/checkUtility";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param nodes
|
|
5
|
-
* @param data
|
|
6
|
-
*/
|
|
7
|
-
export function resolver_bind(nodes, data) {
|
|
8
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
9
|
-
//对系统元素进行属性绑定
|
|
10
|
-
if (!isUnKnown(nodes[i].nodeName)) {
|
|
11
|
-
var attributes = nodes[i].getAttributeNames();
|
|
12
|
-
for (var j = 0; j < attributes.length; j++) {
|
|
13
|
-
var result = attributes[j].match(/^@bind:([a-z]+)$/g);
|
|
14
|
-
if (result === null) {
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
for (var k = 0; k < result.length; k++) {
|
|
18
|
-
var property = result[k].substring(6);
|
|
19
|
-
var dataName = nodes[i].getAttribute(result[k]);
|
|
20
|
-
nodes[i].removeAttribute(result[k]);
|
|
21
|
-
try {
|
|
22
|
-
nodes[i].setAttribute(property, data[dataName]);
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
console.error(e.message);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
resolver_bind(nodes[i].children, data);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
import { isUnKnown } from "../../utility/checkUtility";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param nodes
|
|
5
|
+
* @param data
|
|
6
|
+
*/
|
|
7
|
+
export function resolver_bind(nodes, data) {
|
|
8
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
9
|
+
//对系统元素进行属性绑定
|
|
10
|
+
if (!isUnKnown(nodes[i].nodeName)) {
|
|
11
|
+
var attributes = nodes[i].getAttributeNames();
|
|
12
|
+
for (var j = 0; j < attributes.length; j++) {
|
|
13
|
+
var result = attributes[j].match(/^@bind:([a-z]+)$/g);
|
|
14
|
+
if (result === null) {
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
for (var k = 0; k < result.length; k++) {
|
|
18
|
+
var property = result[k].substring(6);
|
|
19
|
+
var dataName = nodes[i].getAttribute(result[k]);
|
|
20
|
+
nodes[i].removeAttribute(result[k]);
|
|
21
|
+
try {
|
|
22
|
+
nodes[i].setAttribute(property, data[dataName]);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
console.error(e.message);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
resolver_bind(nodes[i].children, data);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 绑定数据模型
|
|
3
|
-
* @param nodes
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_model(nodes: HTMLCollection, data: {}): void;
|
|
1
|
+
/**
|
|
2
|
+
* 绑定数据模型
|
|
3
|
+
* @param nodes
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_model(nodes: HTMLCollection, data: {}): void;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { compositionend, compositionstart, listener } from "../../utility/modelUtility";
|
|
2
|
-
/**
|
|
3
|
-
* 绑定数据模型
|
|
4
|
-
* @param nodes
|
|
5
|
-
* @param data
|
|
6
|
-
*/
|
|
7
|
-
export function resolver_model(nodes, data) {
|
|
8
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
9
|
-
if (nodes[i].hasAttribute("@model")) {
|
|
10
|
-
var dataName = nodes[i].getAttribute("@model");
|
|
11
|
-
nodes[i].removeAttribute("@model");
|
|
12
|
-
var tagName = nodes[i].tagName;
|
|
13
|
-
nodes[i].setAttribute("name", dataName);
|
|
14
|
-
if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
|
|
15
|
-
nodes[i].addEventListener("compositionstart", compositionstart);
|
|
16
|
-
nodes[i].addEventListener("input", listener.bind(data));
|
|
17
|
-
nodes[i].addEventListener("compositionend", compositionend.bind(data));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
resolver_model(nodes[i].children, data);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import { compositionend, compositionstart, listener } from "../../utility/modelUtility";
|
|
2
|
+
/**
|
|
3
|
+
* 绑定数据模型
|
|
4
|
+
* @param nodes
|
|
5
|
+
* @param data
|
|
6
|
+
*/
|
|
7
|
+
export function resolver_model(nodes, data) {
|
|
8
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
9
|
+
if (nodes[i].hasAttribute("@model")) {
|
|
10
|
+
var dataName = nodes[i].getAttribute("@model");
|
|
11
|
+
nodes[i].removeAttribute("@model");
|
|
12
|
+
var tagName = nodes[i].tagName;
|
|
13
|
+
nodes[i].setAttribute("name", dataName);
|
|
14
|
+
if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
|
|
15
|
+
nodes[i].addEventListener("compositionstart", compositionstart);
|
|
16
|
+
nodes[i].addEventListener("input", listener.bind(data));
|
|
17
|
+
nodes[i].addEventListener("compositionend", compositionend.bind(data));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
resolver_model(nodes[i].children, data);
|
|
21
|
+
}
|
|
22
|
+
}
|
package/core/cmd/ref/v-ref.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param el
|
|
4
|
-
* @param refs
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_Refs(el: HTMLCollection, refs: Map<string, Element>): void;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param el
|
|
4
|
+
* @param refs
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_Refs(el: HTMLCollection, refs: Map<string, Element>): void;
|
package/core/cmd/ref/v-ref.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param el
|
|
4
|
-
* @param refs
|
|
5
|
-
*/
|
|
6
|
-
export function resolver_Refs(el, refs) {
|
|
7
|
-
for (var i = 0; i < el.length; i++) {
|
|
8
|
-
if (el[i].hasAttribute("@ref")) {
|
|
9
|
-
refs.set(el[i].getAttribute("@ref"), el[i]);
|
|
10
|
-
el[i].removeAttribute("@ref");
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
resolver_Refs(el[i].children, refs);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param el
|
|
4
|
+
* @param refs
|
|
5
|
+
*/
|
|
6
|
+
export function resolver_Refs(el, refs) {
|
|
7
|
+
for (var i = 0; i < el.length; i++) {
|
|
8
|
+
if (el[i].hasAttribute("@ref")) {
|
|
9
|
+
refs.set(el[i].getAttribute("@ref"), el[i]);
|
|
10
|
+
el[i].removeAttribute("@ref");
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
resolver_Refs(el[i].children, refs);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
-
import { PageController } from "../../../class/controller/pageController";
|
|
3
|
-
/**
|
|
4
|
-
* 此函数用于解析自定义元素solt
|
|
5
|
-
* @param tagTemplate
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_solt(tagTemplate: Element, controller: ComponentController | PageController): void;
|
|
9
|
-
/**
|
|
10
|
-
* 此函数用于展开solt
|
|
11
|
-
* @param elements
|
|
12
|
-
* @param controller
|
|
13
|
-
*/
|
|
14
|
-
export declare function extract_solt(elements: HTMLCollection, controller: ComponentController | PageController): void;
|
|
1
|
+
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
+
import { PageController } from "../../../class/controller/pageController";
|
|
3
|
+
/**
|
|
4
|
+
* 此函数用于解析自定义元素solt
|
|
5
|
+
* @param tagTemplate
|
|
6
|
+
* @param controller
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolver_solt(tagTemplate: Element, controller: ComponentController | PageController): void;
|
|
9
|
+
/**
|
|
10
|
+
* 此函数用于展开solt
|
|
11
|
+
* @param elements
|
|
12
|
+
* @param controller
|
|
13
|
+
*/
|
|
14
|
+
export declare function extract_solt(elements: HTMLCollection, controller: ComponentController | PageController): void;
|
package/core/cmd/solt/v-solt.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 此函数用于解析自定义元素solt
|
|
3
|
-
* @param tagTemplate
|
|
4
|
-
* @param controller
|
|
5
|
-
*/
|
|
6
|
-
export function resolver_solt(tagTemplate, controller) {
|
|
7
|
-
if (tagTemplate.hasChildNodes()) {
|
|
8
|
-
var list = tagTemplate.querySelectorAll("solt");
|
|
9
|
-
if (list.length !== 0) {
|
|
10
|
-
list.forEach(function (value) {
|
|
11
|
-
if (value.hasAttribute("name")) {
|
|
12
|
-
controller.solt.set(value.getAttribute("name"), value.innerHTML);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
controller.solt.set("default", value.innerHTML);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
controller.solt.set("default", tagTemplate.innerHTML);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* 此函数用于展开solt
|
|
26
|
-
* @param elements
|
|
27
|
-
* @param controller
|
|
28
|
-
*/
|
|
29
|
-
export function extract_solt(elements, controller) {
|
|
30
|
-
for (var i = 0; i < elements.length; i++) {
|
|
31
|
-
var result = elements[i].hasAttribute("@solt");
|
|
32
|
-
if (result) {
|
|
33
|
-
var dataName = elements[i].getAttribute("@solt");
|
|
34
|
-
elements[i].removeAttribute("@solt");
|
|
35
|
-
if (!dataName) {
|
|
36
|
-
elements[i].innerHTML = controller.solt.get("default");
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
elements[i].innerHTML = controller.solt.get(dataName);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
//深度解析
|
|
44
|
-
extract_solt(elements[i].children, controller);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 此函数用于解析自定义元素solt
|
|
3
|
+
* @param tagTemplate
|
|
4
|
+
* @param controller
|
|
5
|
+
*/
|
|
6
|
+
export function resolver_solt(tagTemplate, controller) {
|
|
7
|
+
if (tagTemplate.hasChildNodes()) {
|
|
8
|
+
var list = tagTemplate.querySelectorAll("solt");
|
|
9
|
+
if (list.length !== 0) {
|
|
10
|
+
list.forEach(function (value) {
|
|
11
|
+
if (value.hasAttribute("name")) {
|
|
12
|
+
controller.solt.set(value.getAttribute("name"), value.innerHTML);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
controller.solt.set("default", value.innerHTML);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
controller.solt.set("default", tagTemplate.innerHTML);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 此函数用于展开solt
|
|
26
|
+
* @param elements
|
|
27
|
+
* @param controller
|
|
28
|
+
*/
|
|
29
|
+
export function extract_solt(elements, controller) {
|
|
30
|
+
for (var i = 0; i < elements.length; i++) {
|
|
31
|
+
var result = elements[i].hasAttribute("@solt");
|
|
32
|
+
if (result) {
|
|
33
|
+
var dataName = elements[i].getAttribute("@solt");
|
|
34
|
+
elements[i].removeAttribute("@solt");
|
|
35
|
+
if (!dataName) {
|
|
36
|
+
elements[i].innerHTML = controller.solt.get("default");
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
elements[i].innerHTML = controller.solt.get(dataName);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//深度解析
|
|
44
|
+
extract_solt(elements[i].children, controller);
|
|
45
|
+
}
|
|
46
|
+
}
|
package/core/inject/inject.d.ts
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
-
import { Component } from "../../class/component/component";
|
|
3
|
-
/**
|
|
4
|
-
* 向raw_data中注入props和Query
|
|
5
|
-
* @param controller
|
|
6
|
-
*/
|
|
7
|
-
export declare function inject(controller: ComponentController): void;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param controller
|
|
11
|
-
*/
|
|
12
|
-
export declare function injectRefs(controller: ComponentController): void;
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param controller
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
* @param
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*
|
|
27
|
-
* @param
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
* @param controller
|
|
33
|
-
* @param proto
|
|
34
|
-
*/
|
|
35
|
-
export declare function injectComputed(controller: ComponentController, proto: Component): void;
|
|
1
|
+
import { ComponentController } from "../../class/controller/componentController";
|
|
2
|
+
import { Component } from "../../class/component/component";
|
|
3
|
+
/**
|
|
4
|
+
* 向raw_data中注入props和Query
|
|
5
|
+
* @param controller
|
|
6
|
+
*/
|
|
7
|
+
export declare function inject(controller: ComponentController): void;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param controller
|
|
11
|
+
*/
|
|
12
|
+
export declare function injectRefs(controller: ComponentController): void;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param controller
|
|
16
|
+
* @param proto
|
|
17
|
+
*/
|
|
18
|
+
export declare function injectMethod(controller: ComponentController, proto: Component): void;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param controller
|
|
22
|
+
* @param proto
|
|
23
|
+
*/
|
|
24
|
+
export declare function injectWatcher(controller: ComponentController, proto: Component): void;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param controller
|
|
28
|
+
* @param proto
|
|
29
|
+
*/
|
|
30
|
+
export declare function injectComputed(controller: ComponentController, proto: Component): void;
|