render-core 1.2.29 → 1.3.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.
- package/class/controller/appController.d.ts +11 -0
- package/class/controller/appController.js +16 -0
- package/class/controller/contextController.d.ts +6 -0
- package/class/controller/contextController.js +9 -0
- package/core/cmd/data/v-html.js +3 -3
- package/core/cmd/data/v-txt.js +3 -3
- package/core/cmd/justify/v-if.js +3 -3
- package/core/cmd/justify/v-render.js +4 -4
- package/core/cmd/justify/v-show.js +4 -4
- package/core/cmd/justify/v-switch.js +1 -1
- package/core/cmd/loop/v-for.js +8 -8
- package/core/cmd/loop/v-index.js +12 -12
- package/core/cmd/loop/v-key.js +12 -12
- package/core/cmd/method/v-on.js +2 -2
- package/core/cmd/property/v-bind.js +2 -2
- package/core/cmd/react/v-model.js +3 -3
- package/core/cmd/ref/v-ref.js +2 -2
- package/core/cmd/solt/v-solt.js +3 -3
- package/core/resolver/props.js +6 -3
- package/core/utility/inputType.d.ts +1 -0
- package/core/utility/inputType.js +4 -0
- package/core/utility/sectionUtility.js +2 -2
- package/http/redirect/redirect.d.ts +11 -0
- package/http/redirect/redirect.js +36 -0
- package/package.json +1 -1
|
@@ -25,4 +25,15 @@ export declare class AppController implements AppTip {
|
|
|
25
25
|
* @param filed
|
|
26
26
|
*/
|
|
27
27
|
getFiled(filed: string): any;
|
|
28
|
+
/**
|
|
29
|
+
* 资源定向
|
|
30
|
+
* @param url
|
|
31
|
+
* @param parameters
|
|
32
|
+
*/
|
|
33
|
+
redirect(url: string, parameters: {}): void;
|
|
34
|
+
/**
|
|
35
|
+
* 位置定位
|
|
36
|
+
* @param position
|
|
37
|
+
*/
|
|
38
|
+
locate(position: string): void;
|
|
28
39
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { status_read, status_write } from "render-status";
|
|
3
|
+
import { locate, redirect } from "../../http/redirect/redirect";
|
|
3
4
|
/**
|
|
4
5
|
* This class is associated with localStorage.
|
|
5
6
|
*/
|
|
@@ -90,6 +91,21 @@ var AppController = /** @class */ (function () {
|
|
|
90
91
|
return null;
|
|
91
92
|
}
|
|
92
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* 资源定向
|
|
96
|
+
* @param url
|
|
97
|
+
* @param parameters
|
|
98
|
+
*/
|
|
99
|
+
AppController.prototype.redirect = function (url, parameters) {
|
|
100
|
+
redirect(url, parameters);
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* 位置定位
|
|
104
|
+
* @param position
|
|
105
|
+
*/
|
|
106
|
+
AppController.prototype.locate = function (position) {
|
|
107
|
+
locate(position);
|
|
108
|
+
};
|
|
93
109
|
return AppController;
|
|
94
110
|
}());
|
|
95
111
|
export { AppController };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare class ContextController {
|
|
2
2
|
private fileds;
|
|
3
|
+
private meta;
|
|
3
4
|
constructor();
|
|
4
5
|
saveFileds(fileds: {}): void;
|
|
5
6
|
loadFileds(): void;
|
|
@@ -15,4 +16,9 @@ export declare class ContextController {
|
|
|
15
16
|
* @param filed
|
|
16
17
|
*/
|
|
17
18
|
getFiled(filed: string): any;
|
|
19
|
+
/**
|
|
20
|
+
* 返回系统数据
|
|
21
|
+
* @param filed
|
|
22
|
+
*/
|
|
23
|
+
getMeta(filed: string): string;
|
|
18
24
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { status_read, status_write } from "render-status";
|
|
3
3
|
import { reloadStyle } from "../../core/utility/styleUtility";
|
|
4
|
+
import meta from "../../meta/meta";
|
|
4
5
|
var ContextController = /** @class */ (function () {
|
|
5
6
|
function ContextController() {
|
|
6
7
|
this.fileds = {
|
|
@@ -12,6 +13,7 @@ var ContextController = /** @class */ (function () {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
};
|
|
16
|
+
this.meta = meta;
|
|
15
17
|
}
|
|
16
18
|
ContextController.prototype.saveFileds = function (fileds) {
|
|
17
19
|
for (var filedsKey in fileds) {
|
|
@@ -82,6 +84,13 @@ var ContextController = /** @class */ (function () {
|
|
|
82
84
|
return null;
|
|
83
85
|
}
|
|
84
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* 返回系统数据
|
|
89
|
+
* @param filed
|
|
90
|
+
*/
|
|
91
|
+
ContextController.prototype.getMeta = function (filed) {
|
|
92
|
+
return this.meta[filed];
|
|
93
|
+
};
|
|
85
94
|
return ContextController;
|
|
86
95
|
}());
|
|
87
96
|
export { ContextController };
|
package/core/cmd/data/v-html.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export function resolver_html(elements, data, controller) {
|
|
8
8
|
for (var i = 0; i < elements.length; i++) {
|
|
9
|
-
if (elements[i].hasAttribute("
|
|
10
|
-
var dataName = elements[i].getAttribute("
|
|
11
|
-
elements[i].removeAttribute("
|
|
9
|
+
if (elements[i].hasAttribute("@html")) {
|
|
10
|
+
var dataName = elements[i].getAttribute("@html");
|
|
11
|
+
elements[i].removeAttribute("@html");
|
|
12
12
|
if (data[dataName] === undefined) {
|
|
13
13
|
elements[i].innerHTML = controller.computed[dataName]();
|
|
14
14
|
}
|
package/core/cmd/data/v-txt.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export function resolver_txt(elements, data, controller) {
|
|
8
8
|
for (var i = 0; i < elements.length; i++) {
|
|
9
|
-
var result = elements[i].hasAttribute("
|
|
9
|
+
var result = elements[i].hasAttribute("@txt");
|
|
10
10
|
if (result) {
|
|
11
|
-
var dataName = elements[i].getAttribute("
|
|
12
|
-
elements[i].removeAttribute("
|
|
11
|
+
var dataName = elements[i].getAttribute("@txt");
|
|
12
|
+
elements[i].removeAttribute("@txt");
|
|
13
13
|
if (data[dataName] === undefined) {
|
|
14
14
|
// @ts-ignore
|
|
15
15
|
elements[i].innerText = controller.computed[dataName].call();
|
package/core/cmd/justify/v-if.js
CHANGED
|
@@ -7,10 +7,10 @@ export function resolver_if(elements, data) {
|
|
|
7
7
|
var tag = false;
|
|
8
8
|
//在当前级别下寻找到v-if
|
|
9
9
|
for (var i = 0; i < elements.length; i++) {
|
|
10
|
-
var result = elements[i].hasAttribute("
|
|
10
|
+
var result = elements[i].hasAttribute("@if");
|
|
11
11
|
if (result) {
|
|
12
|
-
var dataName = elements[i].getAttribute("
|
|
13
|
-
elements[i].removeAttribute("
|
|
12
|
+
var dataName = elements[i].getAttribute("@if");
|
|
13
|
+
elements[i].removeAttribute("@if");
|
|
14
14
|
if (data[dataName] === true) {
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
break;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function resolver_render(elements, data) {
|
|
7
7
|
for (var i = 0; i < elements.length; i++) {
|
|
8
|
-
var result = elements[i].hasAttribute("
|
|
8
|
+
var result = elements[i].hasAttribute("@render");
|
|
9
9
|
if (result) {
|
|
10
|
-
var dataName = elements[i].getAttribute("
|
|
11
|
-
elements[i].removeAttribute("
|
|
10
|
+
var dataName = elements[i].getAttribute("@render");
|
|
11
|
+
elements[i].removeAttribute("@render");
|
|
12
12
|
if (data[dataName] === true) {
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
elements[i].style.display = "block";
|
|
@@ -18,7 +18,7 @@ export function resolver_render(elements, data) {
|
|
|
18
18
|
elements[i].style.display = "none";
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
|
-
console.log("
|
|
21
|
+
console.log("@render instruct should be used with boolean!");
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
resolver_render(elements[i].children, data);
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function resolver_show(elements, data) {
|
|
7
7
|
for (var i = 0; i < elements.length; i++) {
|
|
8
|
-
var result = elements[i].hasAttribute("
|
|
8
|
+
var result = elements[i].hasAttribute("@show");
|
|
9
9
|
if (result) {
|
|
10
|
-
var dataName = elements[i].getAttribute("
|
|
11
|
-
elements[i].removeAttribute("
|
|
10
|
+
var dataName = elements[i].getAttribute("@show");
|
|
11
|
+
elements[i].removeAttribute("@show");
|
|
12
12
|
if (data[dataName] === true) {
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
elements[i].style.visibility = "visible";
|
|
@@ -18,7 +18,7 @@ export function resolver_show(elements, data) {
|
|
|
18
18
|
elements[i].style.visibility = "hidden";
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
|
-
console.log("
|
|
21
|
+
console.log("@show instruct should be used with boolean!");
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
resolver_show(elements[i].children, data);
|
|
@@ -11,7 +11,7 @@ export function resolver_switch(elements, data) {
|
|
|
11
11
|
//解析元素的所有属性
|
|
12
12
|
for (var j = 0; j < attributes.length; j++) {
|
|
13
13
|
//检查属性名称以及匹配绑定方法
|
|
14
|
-
var result = attributes[j].match(
|
|
14
|
+
var result = attributes[j].match(/^@switch:([a-z]+)$/g);
|
|
15
15
|
//如何属性匹配
|
|
16
16
|
if (result !== null) {
|
|
17
17
|
//属性
|
package/core/cmd/loop/v-for.js
CHANGED
|
@@ -6,10 +6,10 @@ import { extractForArray, extractForMap } from "../../utility/vForUtility";
|
|
|
6
6
|
*/
|
|
7
7
|
export function resolver_for_of(elements, data) {
|
|
8
8
|
var _loop_1 = function (i) {
|
|
9
|
-
var result = elements[i].hasAttribute("
|
|
9
|
+
var result = elements[i].hasAttribute("@for-of");
|
|
10
10
|
if (result) {
|
|
11
|
-
var dataName = elements[i].getAttribute("
|
|
12
|
-
elements[i].removeAttribute("
|
|
11
|
+
var dataName = elements[i].getAttribute("@for-of");
|
|
12
|
+
elements[i].removeAttribute("@for-of");
|
|
13
13
|
if (data[dataName] instanceof Array) {
|
|
14
14
|
data[dataName].forEach(function (value, index) {
|
|
15
15
|
extractForArray(elements[i].parentNode, elements[i], index, value);
|
|
@@ -19,7 +19,7 @@ export function resolver_for_of(elements, data) {
|
|
|
19
19
|
elements[i].parentNode.removeChild(elements[i]);
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
console.log("Instruction
|
|
22
|
+
console.log("Instruction @for-of need an array datatype to extract!");
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
if (elements[i]) {
|
|
@@ -40,16 +40,16 @@ export function resolver_for_of(elements, data) {
|
|
|
40
40
|
*/
|
|
41
41
|
export function resolver_for_each(elements, data) {
|
|
42
42
|
for (var i = 0; i < elements.length; i++) {
|
|
43
|
-
var result = elements[i].hasAttribute("
|
|
43
|
+
var result = elements[i].hasAttribute("@for-each");
|
|
44
44
|
if (result) {
|
|
45
|
-
var dataName = elements[i].getAttribute("
|
|
46
|
-
elements[i].removeAttribute("
|
|
45
|
+
var dataName = elements[i].getAttribute("@for-each");
|
|
46
|
+
elements[i].removeAttribute("@for-each");
|
|
47
47
|
if (data[dataName] instanceof Object) {
|
|
48
48
|
extractForMap(elements[i].parentNode, elements[i], data[dataName]);
|
|
49
49
|
i++;
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
|
-
console.log("Instruction
|
|
52
|
+
console.log("Instruction @for-of need an object datatype to extract!");
|
|
53
53
|
}
|
|
54
54
|
//将模板节点删除
|
|
55
55
|
elements[i].parentNode.removeChild(elements[i]);
|
package/core/cmd/loop/v-index.js
CHANGED
|
@@ -8,14 +8,14 @@ import { extractForArray } from "../../utility/vForUtility";
|
|
|
8
8
|
*/
|
|
9
9
|
export function resolver_array_single(element, index, data) {
|
|
10
10
|
//解析data
|
|
11
|
-
if (element.hasAttribute("
|
|
12
|
-
element.removeAttribute("
|
|
11
|
+
if (element.hasAttribute("@data")) {
|
|
12
|
+
element.removeAttribute("@data");
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
element.innerText = data;
|
|
15
15
|
}
|
|
16
16
|
//解析index
|
|
17
|
-
if (element.hasAttribute("
|
|
18
|
-
element.removeAttribute("
|
|
17
|
+
if (element.hasAttribute("@index")) {
|
|
18
|
+
element.removeAttribute("@index");
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
element.innerText = index;
|
|
21
21
|
}
|
|
@@ -30,21 +30,21 @@ export function resolver_array_single(element, index, data) {
|
|
|
30
30
|
export function resolver_array_multi(elements, index, data) {
|
|
31
31
|
var _loop_1 = function (i) {
|
|
32
32
|
//解析data
|
|
33
|
-
if (elements[i].hasAttribute("
|
|
34
|
-
elements[i].removeAttribute("
|
|
33
|
+
if (elements[i].hasAttribute("@data")) {
|
|
34
|
+
elements[i].removeAttribute("@data");
|
|
35
35
|
// @ts-ignore
|
|
36
36
|
elements[i].innerText = data;
|
|
37
37
|
}
|
|
38
38
|
//解析index
|
|
39
|
-
if (elements[i].hasAttribute("
|
|
40
|
-
elements[i].removeAttribute("
|
|
39
|
+
if (elements[i].hasAttribute("@index")) {
|
|
40
|
+
elements[i].removeAttribute("@index");
|
|
41
41
|
// @ts-ignore
|
|
42
42
|
elements[i].innerText = index;
|
|
43
43
|
}
|
|
44
44
|
if (elements[i]) {
|
|
45
45
|
//检查v-for-item,该指令不可以用在根元素上
|
|
46
|
-
if (elements[i].hasAttribute("
|
|
47
|
-
elements[i].removeAttribute("
|
|
46
|
+
if (elements[i].hasAttribute("@for-item")) {
|
|
47
|
+
elements[i].removeAttribute("@for-item");
|
|
48
48
|
part_render_map(elements[i].parentNode, elements[i], data);
|
|
49
49
|
i++;
|
|
50
50
|
//删除节点
|
|
@@ -53,8 +53,8 @@ export function resolver_array_multi(elements, index, data) {
|
|
|
53
53
|
}
|
|
54
54
|
if (elements[i]) {
|
|
55
55
|
//检查v-for-array
|
|
56
|
-
if (elements[i].hasAttribute("
|
|
57
|
-
elements[i].removeAttribute("
|
|
56
|
+
if (elements[i].hasAttribute("@for-index")) {
|
|
57
|
+
elements[i].removeAttribute("@for-index");
|
|
58
58
|
data.forEach(function (value, index) {
|
|
59
59
|
extractForArray(elements[i].parentNode, elements[i], index, value);
|
|
60
60
|
i++;
|
package/core/cmd/loop/v-key.js
CHANGED
|
@@ -7,9 +7,9 @@ import { extractForArray } from "../../utility/vForUtility";
|
|
|
7
7
|
*/
|
|
8
8
|
export function resolver_map_single(element, data) {
|
|
9
9
|
//检查v-data
|
|
10
|
-
if (element.hasAttribute("
|
|
11
|
-
var property = element.getAttribute("
|
|
12
|
-
element.removeAttribute("
|
|
10
|
+
if (element.hasAttribute("@key")) {
|
|
11
|
+
var property = element.getAttribute("@key");
|
|
12
|
+
element.removeAttribute("@key");
|
|
13
13
|
// @ts-ignore
|
|
14
14
|
element.innerText = data[property];
|
|
15
15
|
}
|
|
@@ -24,17 +24,17 @@ export function resolver_map_single(element, data) {
|
|
|
24
24
|
export function resolver_map_multi(elements, data) {
|
|
25
25
|
var _loop_1 = function (i) {
|
|
26
26
|
//检查v-key
|
|
27
|
-
if (elements[i].hasAttribute("
|
|
28
|
-
var property = elements[i].getAttribute("
|
|
29
|
-
elements[i].removeAttribute("
|
|
27
|
+
if (elements[i].hasAttribute("@key")) {
|
|
28
|
+
var property = elements[i].getAttribute("@key");
|
|
29
|
+
elements[i].removeAttribute("@key");
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
elements[i].innerText = data[property];
|
|
32
32
|
}
|
|
33
33
|
if (elements[i]) {
|
|
34
34
|
//检查v-for-item
|
|
35
|
-
if (elements[i].hasAttribute("
|
|
36
|
-
var property = elements[i].getAttribute("
|
|
37
|
-
elements[i].removeAttribute("
|
|
35
|
+
if (elements[i].hasAttribute("@for-item")) {
|
|
36
|
+
var property = elements[i].getAttribute("@for-item");
|
|
37
|
+
elements[i].removeAttribute("@for-item");
|
|
38
38
|
part_render_map(elements[i].parentNode, elements[i], data[property]);
|
|
39
39
|
i++;
|
|
40
40
|
//删除节点
|
|
@@ -43,9 +43,9 @@ export function resolver_map_multi(elements, data) {
|
|
|
43
43
|
}
|
|
44
44
|
if (elements[i]) {
|
|
45
45
|
//检查v-for-array
|
|
46
|
-
if (elements[i].hasAttribute("
|
|
47
|
-
var property = elements[i].getAttribute("
|
|
48
|
-
elements[i].removeAttribute("
|
|
46
|
+
if (elements[i].hasAttribute("@for-index")) {
|
|
47
|
+
var property = elements[i].getAttribute("@for-index");
|
|
48
|
+
elements[i].removeAttribute("@for-index");
|
|
49
49
|
data[property].forEach(function (value, index) {
|
|
50
50
|
extractForArray(elements[i].parentNode, elements[i], index, value);
|
|
51
51
|
i++;
|
package/core/cmd/method/v-on.js
CHANGED
|
@@ -12,11 +12,11 @@ export function resolver_event(elements, methods, data) {
|
|
|
12
12
|
//解析元素的所有属性
|
|
13
13
|
for (var j = 0; j < attributes.length; j++) {
|
|
14
14
|
//检查属性名称以及匹配绑定方法
|
|
15
|
-
var result = attributes[j].match(
|
|
15
|
+
var result = attributes[j].match(/^@on:([a-z]+)$/g);
|
|
16
16
|
//如何属性匹配
|
|
17
17
|
if (result !== null) {
|
|
18
18
|
for (var k = 0; k < result.length; k++) {
|
|
19
|
-
var action = result[k].substring(
|
|
19
|
+
var action = result[k].substring(4);
|
|
20
20
|
var method = elements[i].getAttribute(result[k]);
|
|
21
21
|
elements[i].removeAttribute(result[k]);
|
|
22
22
|
elements[i].addEventListener(action, methods[method].bind(data));
|
|
@@ -10,12 +10,12 @@ export function resolver_bind(nodes, data) {
|
|
|
10
10
|
if (isUnKnown(nodes[i].nodeName)) {
|
|
11
11
|
var attributes = nodes[i].getAttributeNames();
|
|
12
12
|
for (var j = 0; j < attributes.length; j++) {
|
|
13
|
-
var result = attributes[j].match(
|
|
13
|
+
var result = attributes[j].match(/^@bind:([a-z]+)$/g);
|
|
14
14
|
if (result === null) {
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
17
|
for (var k = 0; k < result.length; k++) {
|
|
18
|
-
var property = result[k].substring(
|
|
18
|
+
var property = result[k].substring(6);
|
|
19
19
|
var dataName = nodes[i].getAttribute(result[k]);
|
|
20
20
|
nodes[i].removeAttribute(result[k]);
|
|
21
21
|
try {
|
|
@@ -6,9 +6,9 @@ import { compositionend, compositionstart, listerner } from "../../utility/model
|
|
|
6
6
|
*/
|
|
7
7
|
export function resolver_model(nodes, data) {
|
|
8
8
|
for (var i = 0; i < nodes.length; i++) {
|
|
9
|
-
if (nodes[i].hasAttribute("
|
|
10
|
-
var dataName = nodes[i].getAttribute("
|
|
11
|
-
nodes[i].removeAttribute("
|
|
9
|
+
if (nodes[i].hasAttribute("@model")) {
|
|
10
|
+
var dataName = nodes[i].getAttribute("@model");
|
|
11
|
+
nodes[i].removeAttribute("@model");
|
|
12
12
|
var tagName = nodes[i].tagName;
|
|
13
13
|
nodes[i].setAttribute("name", dataName);
|
|
14
14
|
if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
|
package/core/cmd/ref/v-ref.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function resolver_Refs(el, refs) {
|
|
7
7
|
for (var i = 0; i < el.length; i++) {
|
|
8
|
-
if (el[i].hasAttribute("ref")) {
|
|
9
|
-
refs.set(el[i].getAttribute("ref"), el[i]);
|
|
8
|
+
if (el[i].hasAttribute("@ref")) {
|
|
9
|
+
refs.set(el[i].getAttribute("@ref"), el[i]);
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
12
|
resolver_Refs(el[i].children, refs);
|
package/core/cmd/solt/v-solt.js
CHANGED
|
@@ -29,10 +29,10 @@ export function resolver_solt(tagTemplate, controller) {
|
|
|
29
29
|
*/
|
|
30
30
|
export function extract_solt(elements, controller) {
|
|
31
31
|
for (var i = 0; i < elements.length; i++) {
|
|
32
|
-
var result = elements[i].hasAttribute("
|
|
32
|
+
var result = elements[i].hasAttribute("@solt");
|
|
33
33
|
if (result) {
|
|
34
|
-
var dataName = elements[i].getAttribute("
|
|
35
|
-
elements[i].removeAttribute("
|
|
34
|
+
var dataName = elements[i].getAttribute("@solt");
|
|
35
|
+
elements[i].removeAttribute("@solt");
|
|
36
36
|
if (!dataName) {
|
|
37
37
|
elements[i].innerHTML = controller.solt.get("default");
|
|
38
38
|
}
|
package/core/resolver/props.js
CHANGED
|
@@ -41,10 +41,13 @@ export function getAllPropsByObject(node, object) {
|
|
|
41
41
|
case "float":
|
|
42
42
|
props.set(objectKey, parseFloat(node.getAttribute(objectKey)));
|
|
43
43
|
break;
|
|
44
|
-
case "
|
|
45
|
-
props.set(objectKey,
|
|
44
|
+
case "boole":
|
|
45
|
+
props.set(objectKey, parseFloat(node.getAttribute(objectKey)));
|
|
46
|
+
break;
|
|
47
|
+
case "string":
|
|
48
|
+
props.set(objectKey, node.getAttribute(objectKey));
|
|
46
49
|
break;
|
|
47
|
-
case "
|
|
50
|
+
case "json":
|
|
48
51
|
props.set(objectKey, JSON.parse(node.getAttribute(objectKey)));
|
|
49
52
|
break;
|
|
50
53
|
default:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ComponentController } from "../../class/controller/componentController";
|
|
2
2
|
export declare function textType(target: any, doc: any, controller: ComponentController): void;
|
|
3
3
|
export declare function assignType(target: any, doc: any, controller: ComponentController): void;
|
|
4
|
+
export declare function checkType(target: any): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assignType, textType } from "./inputType";
|
|
1
|
+
import { assignType, checkType, textType } from "./inputType";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param controller
|
|
@@ -54,7 +54,7 @@ function locateInput(target, doc, controller) {
|
|
|
54
54
|
assignType(target, doc, controller);
|
|
55
55
|
break;
|
|
56
56
|
case "radio":
|
|
57
|
-
|
|
57
|
+
checkType(target);
|
|
58
58
|
break;
|
|
59
59
|
case "password":
|
|
60
60
|
textType(target, doc, controller);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 资源定向
|
|
3
|
+
* @param url
|
|
4
|
+
* @param parameters
|
|
5
|
+
*/
|
|
6
|
+
export function redirect(url, parameters) {
|
|
7
|
+
if (parameters !== null) {
|
|
8
|
+
var params = Object.getOwnPropertyNames(parameters);
|
|
9
|
+
if (params.length !== 0) {
|
|
10
|
+
var querys_1 = "";
|
|
11
|
+
params.forEach(function (value) {
|
|
12
|
+
if (querys_1 === "") {
|
|
13
|
+
querys_1 = querys_1 + value + "=" + parameters[value].toString();
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
querys_1 = querys_1 + "&" + value + "=" + parameters[value].toString();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
querys_1 = encodeURI(querys_1);
|
|
20
|
+
location.href = url + "?" + querys_1;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
location.href = url;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
location.href = url;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* locate the position
|
|
32
|
+
* @param position
|
|
33
|
+
*/
|
|
34
|
+
export function locate(position) {
|
|
35
|
+
location.hash = position;
|
|
36
|
+
}
|