efront 4.11.5 → 4.11.8
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/apps/pivot/cert/main.xht +12 -0
- package/apps/pivot/task/invoke.html +1 -1
- package/apps/pivot/task/invoke.js +1 -0
- package/apps/pivot/task/invoke.less +7 -4
- package/apps/pivot/task/list.js +24 -17
- package/coms/compile/Javascript_test.js +3 -1
- package/coms/compile/Program.js +8 -3
- package/coms/compile/powermap.js +1 -1
- package/coms/compile/unstruct.js +20 -7
- package/coms/compile/unstruct_test.js +1 -0
- package/coms/zimoli/field.js +82 -17
- package/coms/zimoli/field.less +49 -25
- package/coms/zimoli/getTypedChildren.js +26 -0
- package/coms/zimoli/model.js +12 -2
- package/coms/zimoli/render.js +15 -6
- package/coms/zimoli/view.js +13 -18
- package/coms//350/214/250/350/217/260//344/270/212/350/211/262.xht +1 -1
- package/coms//350/214/250/350/217/260//346/270/262/346/237/223.js +1 -1
- package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +28 -6
- package/coms//350/214/250/350/217/260//350/277/275/345/212/240/345/205/211/346/240/207.js +1 -1
- package/docs//345/267/245/345/205/267//345/255/227/347/254/246/351/233/206/346/243/200/346/237/245.xht +0 -9
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/readme-en.md +7 -0
- package/readme.md +7 -0
|
@@ -1,17 +1,36 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
& {
|
|
3
|
+
overflow: auto;
|
|
4
|
+
border: 6px solid transparent;
|
|
5
|
+
border-top: 0;
|
|
6
|
+
border-bottom: 0;
|
|
7
|
+
display: block;
|
|
8
|
+
padding: 6px 0;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
1
11
|
<编辑框 e-class="上色.className" e-style="{whiteSpace:'pre'}" onkeyup="!event.isComposing&&updatecode(event)"
|
|
2
12
|
onkeydown.tab="keytab(event)" onkeyup.enter="tab(false)">
|
|
3
13
|
</编辑框>
|
|
4
14
|
<script>
|
|
5
15
|
var coder = this;
|
|
6
|
-
|
|
16
|
+
var coderid = 0;
|
|
17
|
+
care(coder, async function ([text, type]) {
|
|
7
18
|
try {
|
|
8
|
-
var colored = 上色.text(type, text);
|
|
9
|
-
coder.innerHTML = colored;
|
|
10
19
|
coder.type = type;
|
|
20
|
+
await coder.setValue(text);
|
|
11
21
|
} catch {
|
|
12
22
|
if (typeof text === 'string') coder.innerHTML = 渲染.encode(text);
|
|
13
23
|
}
|
|
14
|
-
})
|
|
24
|
+
});
|
|
25
|
+
coder.setValue = async function (text) {
|
|
26
|
+
var id = ++coderid;
|
|
27
|
+
var colored = await 上色.text(this.type, text);
|
|
28
|
+
if (id !== coderid) return;
|
|
29
|
+
coder.innerHTML = colored;
|
|
30
|
+
};
|
|
31
|
+
coder.getValue = function () {
|
|
32
|
+
return coder.innerText;
|
|
33
|
+
};
|
|
15
34
|
var markAnchorOffset = function () {
|
|
16
35
|
var { anchorNode, anchorOffset } = document.getSelection();
|
|
17
36
|
if (!anchorNode || !coder) return;
|
|
@@ -111,7 +130,8 @@
|
|
|
111
130
|
coder.scrollTop = scrollTop;
|
|
112
131
|
coder.scrollLeft = scrollLeft;
|
|
113
132
|
};
|
|
114
|
-
var updatecode = lazy(function (event) {
|
|
133
|
+
var updatecode = lazy(async function (event) {
|
|
134
|
+
var id = ++coderid;
|
|
115
135
|
var trimreg = /[\s\u00a0\u2002\u0080]+([\}\{\;\[\]\(\)\,\>\<\+\-\*\&\^\/%!~:?])*/g;
|
|
116
136
|
var innerText = coder.innerText;
|
|
117
137
|
if (jstext.replace(trimreg, trimspace).trim() === innerText.replace(trimreg, trimspace).trim()) return;
|
|
@@ -119,9 +139,11 @@
|
|
|
119
139
|
markAnchorOffset();
|
|
120
140
|
var innerText = coder.innerText;
|
|
121
141
|
unmarkAnchorOffset();
|
|
122
|
-
var text = 上色.text(coder.type, innerText);
|
|
142
|
+
var text = await 上色.text(coder.type, innerText);
|
|
143
|
+
if (coderid !== id) return;
|
|
123
144
|
更新(text);
|
|
124
145
|
unmarkAnchorOffset();
|
|
146
|
+
dispatch(coder, 'change');
|
|
125
147
|
return;
|
|
126
148
|
});
|
|
127
149
|
var keytab = function (event) {
|
|
@@ -13,7 +13,7 @@ var patchBlink = function (code, index, blink) {
|
|
|
13
13
|
}
|
|
14
14
|
return true;
|
|
15
15
|
}
|
|
16
|
-
else if (c.start < index && c.end > index) {
|
|
16
|
+
else if (c.start < index && (c.end > index || c.end === undefined)) {
|
|
17
17
|
if (haschildren(c)) {
|
|
18
18
|
return patchBlink(c, index, blink);
|
|
19
19
|
}
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
display: inline-block;
|
|
11
11
|
position: relative;
|
|
12
12
|
vertical-align: top;
|
|
13
|
-
padding-bottom: 44px;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
field:nth-child(n+2) [textarea] {
|
|
@@ -18,16 +17,8 @@
|
|
|
18
17
|
outline: none;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
label {
|
|
22
|
-
margin-top: -44px;
|
|
23
|
-
padding: 0 20px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
20
|
.padding {
|
|
27
21
|
border: none;
|
|
28
|
-
padding: 0 20px;
|
|
29
|
-
width: 100%;
|
|
30
|
-
display: block;
|
|
31
22
|
}
|
|
32
23
|
|
|
33
24
|
[textarea] {
|