render-core 1.2.26 → 1.2.28
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.
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ComponentController } from "../../class/controller/componentController";
|
|
2
2
|
export declare function textType(target: any, doc: any, controller: ComponentController): void;
|
|
3
|
+
export declare function assignType(target: any, doc: any, controller: ComponentController): void;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export function textType(target, doc, controller) {
|
|
2
2
|
// @ts-ignore
|
|
3
|
-
target.value = controller.proxyForMethods[
|
|
3
|
+
target.value = controller.proxyForMethods[target.getAttribute("name")];
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
target.focus();
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
target.setSelectionRange(doc.start, doc.start);
|
|
8
8
|
}
|
|
9
|
+
export function assignType(target, doc, controller) {
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
target.value = controller.proxyForMethods[target.getAttribute("name")];
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function inputUtility(element, space) {
|
|
2
2
|
switch (element.getAttribute("type")) {
|
|
3
3
|
case "text":
|
|
4
|
-
Reflect.set(
|
|
4
|
+
Reflect.set(space, "origin", {
|
|
5
5
|
tag: element.tagName,
|
|
6
6
|
type: element.getAttribute("type"),
|
|
7
7
|
id: element.getAttribute("id"),
|
|
@@ -12,18 +12,17 @@ export function inputUtility(element, space) {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export function selectUtility(element, space) {
|
|
15
|
-
Reflect.set(
|
|
15
|
+
Reflect.set(space, "origin", {
|
|
16
16
|
tag: element.tagName,
|
|
17
|
+
id: element.getAttribute("id"),
|
|
17
18
|
// @ts-ignore
|
|
18
|
-
selected: element.
|
|
19
|
-
id: element.getAttribute("id")
|
|
19
|
+
selected: element.value
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
export function textareaUtiltiy(element, space) {
|
|
23
|
-
Reflect.set(
|
|
23
|
+
Reflect.set(space, "origin", {
|
|
24
24
|
tag: element.tagName,
|
|
25
25
|
id: element.getAttribute("id"),
|
|
26
|
-
name: element.getAttribute("name"),
|
|
27
26
|
// @ts-ignore
|
|
28
27
|
start: element.selectionStart
|
|
29
28
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { textType } from "./inputType";
|
|
1
|
+
import { assignType, textType } from "./inputType";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param controller
|
|
@@ -26,11 +26,23 @@ function locateInput(target, doc, controller) {
|
|
|
26
26
|
case "text":
|
|
27
27
|
textType(target, doc, controller);
|
|
28
28
|
break;
|
|
29
|
+
case "date":
|
|
30
|
+
assignType(target, doc, controller);
|
|
31
|
+
break;
|
|
32
|
+
case "datetime":
|
|
33
|
+
assignType(target, doc, controller);
|
|
34
|
+
break;
|
|
35
|
+
case "color":
|
|
36
|
+
assignType(target, doc, controller);
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
console.log("can`t deal with this type input!");
|
|
40
|
+
break;
|
|
29
41
|
}
|
|
30
42
|
}
|
|
31
43
|
function locateTextArea(target, doc, controller) {
|
|
32
44
|
// @ts-ignore
|
|
33
|
-
target.value = controller.proxyForMethods[
|
|
45
|
+
target.value = controller.proxyForMethods[target.getAttribute("name")];
|
|
34
46
|
// @ts-ignore
|
|
35
47
|
target.focus();
|
|
36
48
|
// @ts-ignore
|
|
@@ -38,5 +50,10 @@ function locateTextArea(target, doc, controller) {
|
|
|
38
50
|
}
|
|
39
51
|
function locateSelect(target, doc, controller) {
|
|
40
52
|
// @ts-ignore
|
|
41
|
-
|
|
53
|
+
var list = target.getElementsByTagName("option");
|
|
54
|
+
for (var i = 0; i < list.length; i++) {
|
|
55
|
+
if (list[i].value === doc.selected) {
|
|
56
|
+
list[i].selected = true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
42
59
|
}
|