efront 4.11.4 → 4.11.6
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/#/345/233/275/351/231/205/345/214/226.yml +1 -1
- package/apps/pivot/cert/list.js +3 -7
- package/apps/pivot/cert/main.xht +12 -0
- package/apps/pivot/task/list.js +24 -17
- package/coms/basic/#loader.js +13 -14
- package/coms/basic/JSAM.js +2 -1
- package/coms/basic/cookie.js +9 -9
- package/coms/basic/data.js +1 -1
- package/coms/basic/i18n.js +4 -2
- package/coms/basic_/Array2.js +4 -1
- package/coms/compile/Javascript_test.js +3 -1
- package/coms/compile/Program.js +8 -3
- package/coms/compile/powermap.js +1 -1
- package/coms/pivot/pedit.less +23 -1
- package/coms/zimoli/cless.js +2 -1
- package/coms/zimoli/field.js +82 -17
- package/coms/zimoli/field.less +43 -26
- package/coms/zimoli/forceUpdate.js +1 -1
- package/coms/zimoli/getTypedChildren.js +26 -0
- package/coms/zimoli/model.js +12 -2
- package/coms/zimoli/render.js +5 -4
- package/coms/zimoli/view.js +2 -12
- package/coms//350/214/250/350/217/260/tab.js +3 -2
- 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//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 +4 -5
- package/readme.md +2 -5
package/coms/zimoli/render.js
CHANGED
|
@@ -711,6 +711,11 @@ function getFromScopes(key, scope, parentScopes) {
|
|
|
711
711
|
|
|
712
712
|
function renderRest(element, struct, replacer = element) {
|
|
713
713
|
var renders = element.$renders;
|
|
714
|
+
if (element.renders) {
|
|
715
|
+
if (!renders) renders = [];
|
|
716
|
+
renders.push.apply(renders, element.renders);
|
|
717
|
+
delete element.renders;
|
|
718
|
+
}
|
|
714
719
|
element.$renders = [];
|
|
715
720
|
var { binds, attrs, props } = struct;
|
|
716
721
|
for (var k in binds) {
|
|
@@ -802,7 +807,6 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
802
807
|
if (replacer.children && replacer.children.length) renderElement(replacer.children, replacer.$scope, replacer.$parentScopes, once);
|
|
803
808
|
renderRest(replacer, replacer.$struct);
|
|
804
809
|
}
|
|
805
|
-
|
|
806
810
|
copyAttribute(replacer, copys);
|
|
807
811
|
if (nextSibling) appendChild.before(nextSibling, replacer);
|
|
808
812
|
else if (parentNode) appendChild(parentNode, replacer);
|
|
@@ -822,9 +826,6 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
822
826
|
if (isNode(replacer) && replacer !== element) {
|
|
823
827
|
if (!replacer.$renders) replacer.$renders = [];
|
|
824
828
|
replacer.$renders.push.apply(replacer.$renders, element.$renders);
|
|
825
|
-
if (replacer.$struct && replacer.$struct !== element.$struct) {
|
|
826
|
-
element.$struct.ons.forEach(([on, key, value]) => on.call(element, replacer, key, value));
|
|
827
|
-
}
|
|
828
829
|
element = replacer;
|
|
829
830
|
}
|
|
830
831
|
if (element.$renders.length) {
|
package/coms/zimoli/view.js
CHANGED
|
@@ -90,18 +90,8 @@ var init = function () {
|
|
|
90
90
|
marginRight: -getScrollbarWidth() + "px"
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
|
-
var isType = function (target, type) {
|
|
94
|
-
// 记得小时候,不论是苍蝇还是蚊子,飞起来都是有声音的。最近看到的一种像蚊子一样小的飞虫,喜欢像苍蝇一样趴在食物上,飞起来却听不到声音。
|
|
95
|
-
// 是我的听力下降了?还是外界太过嘈杂?还是飞虫拍打翅膀的频率超出了我的听觉范围?还是飞行可以不产生声音?
|
|
96
|
-
return target.hasAttribute(type) || hasClass(target, type);
|
|
97
|
-
}
|
|
98
93
|
var resize2 = function () {
|
|
99
|
-
var head, body, foot;
|
|
100
|
-
for (var c of this.children) {
|
|
101
|
-
if (isType(c, "head")) head = c;
|
|
102
|
-
else if (isType(c, "body")) body = c;
|
|
103
|
-
else if (isType(c, "foot")) foot = c;
|
|
104
|
-
}
|
|
94
|
+
var [head, body, foot] = getTypedChildren(this, ["head", "body", "foot"]);
|
|
105
95
|
if (head && body) {
|
|
106
96
|
var height = head.offsetHeight + head.offsetTop;
|
|
107
97
|
css(head, {
|
|
@@ -121,7 +111,7 @@ var resize2 = function () {
|
|
|
121
111
|
})
|
|
122
112
|
}
|
|
123
113
|
if (body) {
|
|
124
|
-
if (body.scrollHeight + body.offsetTop > this.clientHeight) {
|
|
114
|
+
if (body.scrollHeight + body.offsetTop > this.clientHeight + 1) {
|
|
125
115
|
css(body, { height: fromOffset(this.clientHeight) });
|
|
126
116
|
}
|
|
127
117
|
else {
|
|
@@ -27,8 +27,9 @@ return function (forcetab) {
|
|
|
27
27
|
}
|
|
28
28
|
else if (anchorNode.nodeType === 3) {
|
|
29
29
|
if (forcetab === 0) return;
|
|
30
|
-
|
|
31
|
-
anchorOffset
|
|
30
|
+
var spaceSize = (4 - anchorOffset % 4);
|
|
31
|
+
anchorNode.nodeValue = anchorNode.nodeValue.slice(0, anchorOffset) + ensp(spaceSize) + anchorNode.nodeValue.slice(anchorOffset);
|
|
32
|
+
anchorOffset += spaceSize;
|
|
32
33
|
selection.setBaseAndExtent(anchorNode, anchorOffset, anchorNode, anchorOffset);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
@@ -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] {
|