efront 4.0.55 → 4.0.56
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/coms/basic/color.js +97 -2
- package/coms/compile/Javascript.js +121 -0
- package/coms/compile/Program.js +1 -109
- package/coms/compile/autoenum_test.js +4 -0
- package/coms/compile/common.js +13 -12
- package/coms/compile/richcss.js +395 -105
- package/coms/compile/richcss_test.js +24 -11
- package/coms/compile/scanner2.js +1 -0
- package/coms/zimoli/HexEditor.less +3 -3
- package/coms/zimoli/gallery_test.less +1 -1
- package/coms/zimoli/getGenerator.js +6 -4
- package/coms/zimoli/lattice_test.less +1 -0
- package/coms/zimoli/list.js +16 -4
- package/coms/zimoli/mediaDevices.less +1 -2
- package/docs//347/273/204/344/273/266.xht +1 -1
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/compile/scanner2.js
CHANGED
|
@@ -208,6 +208,7 @@ function scan(text, type = "js", lastIndex = 0) {
|
|
|
208
208
|
program.Code = Code;
|
|
209
209
|
program.lastIndex = lastIndex;
|
|
210
210
|
var res = program.exec(text);
|
|
211
|
+
res.autospace = !program.keepspace;
|
|
211
212
|
Object.defineProperty(res, "program", { value: program, enumerable: false })
|
|
212
213
|
return res;
|
|
213
214
|
}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
font-size: 16px;
|
|
9
9
|
position: relative;
|
|
10
10
|
min-height: 100px;
|
|
11
|
-
padding: 0
|
|
11
|
+
padding: 0 6px 10px 16px;
|
|
12
12
|
font-family: 宋体;
|
|
13
|
-
width:
|
|
13
|
+
width: 438px;
|
|
14
14
|
|
|
15
15
|
>a {
|
|
16
16
|
display: inline-block;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
word-spacing: 2px;
|
|
41
41
|
font-size: inherit;
|
|
42
42
|
line-height: 30px;
|
|
43
|
-
margin: 0
|
|
43
|
+
margin: 0 -6px 10px -16px;
|
|
44
44
|
padding: 0 16px 0 16px;
|
|
45
45
|
position: sticky;
|
|
46
46
|
top: 0;
|
|
@@ -23,20 +23,22 @@ var getGenerator = function (container, tagName = 'item') {
|
|
|
23
23
|
if (container.$generator) return container.$generator;
|
|
24
24
|
var template = document.createElement(container.tagName);
|
|
25
25
|
var templates = [];
|
|
26
|
+
var hasAfter = false;
|
|
26
27
|
for (let a of container.childNodes) {
|
|
27
28
|
if (a.nodeType === 1 && a.hasAttribute('insert')) {
|
|
28
29
|
if (!templates.length) a.$isbefore = true;
|
|
29
|
-
else a.$isafter = true;
|
|
30
|
+
else { a.$isafter = true; hasAfter = true; }
|
|
30
31
|
}
|
|
31
|
-
else
|
|
32
|
+
else if (hasAfter);
|
|
33
|
+
else if (a.nodeType === 1 || templates.length) {
|
|
32
34
|
templates.push(a);
|
|
33
35
|
}
|
|
34
36
|
}
|
|
37
|
+
while (templates.length > 1 && templates[templates.length - 1].nodeType !== 1) templates.pop();
|
|
35
38
|
if (templates.length < container.childNodes.length && templates.length >= 1) {
|
|
36
|
-
var c = document.createComment('
|
|
39
|
+
var c = document.createComment('generator');
|
|
37
40
|
c.index = null;
|
|
38
41
|
container.insertBefore(c, templates[0]);
|
|
39
|
-
templates.splice(1, templates.length - 1);
|
|
40
42
|
var paddingCount = [].indexOf.call(container.childNodes, c);
|
|
41
43
|
container.paddingCount = paddingCount;
|
|
42
44
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
>lattice {
|
|
7
|
+
max-height: 300px;
|
|
7
8
|
height: 100%;
|
|
8
9
|
@mask-color: rgba(0, 0, 0, .4);
|
|
9
10
|
// background: linear-gradient(45deg, @mask-color, 25%, @mask-color, 25%, rgba(0, 0, 0, 0), 75%, rgba(0, 0, 0, 0), 75%, @mask-color), linear-gradient(135deg, @mask-color, 25%, @mask-color, 25%, rgba(0, 0, 0, 0), 75%, rgba(0, 0, 0, 0), 75%, @mask-color);
|
package/coms/zimoli/list.js
CHANGED
|
@@ -169,9 +169,9 @@ function ylist(container, generator, $Y) {
|
|
|
169
169
|
delete childrenMap[offset];
|
|
170
170
|
}
|
|
171
171
|
if (last_index > offset) {
|
|
172
|
-
if (item.nextElementSibling !== last_item)
|
|
172
|
+
if (item.nextElementSibling !== last_item) insertBeforeList(item, last_item);
|
|
173
173
|
} else {
|
|
174
|
-
if (item.previousElementSibling !== item)
|
|
174
|
+
if (item.previousElementSibling !== item) insertBeforeList(item, getNextSibling(last_item));
|
|
175
175
|
}
|
|
176
176
|
last_index = offset;
|
|
177
177
|
item = getNodeTarget(item);
|
|
@@ -229,6 +229,17 @@ function ylist(container, generator, $Y) {
|
|
|
229
229
|
} while (next.offsetTop === element.offsetTop);
|
|
230
230
|
return next.offsetTop - element.offsetTop;
|
|
231
231
|
};
|
|
232
|
+
var insertBeforeList = function (elem, flag) {
|
|
233
|
+
if(flag){
|
|
234
|
+
var w = elem.with;
|
|
235
|
+
if (w) {
|
|
236
|
+
if (w[w.length - 1].nextSibling === flag) return;
|
|
237
|
+
}
|
|
238
|
+
else if (elem.nextSibling === flag) return;
|
|
239
|
+
}
|
|
240
|
+
list.insertBefore(elem, flag);
|
|
241
|
+
if (elem.with) for (var w of elem.with) list.insertBefore(w, flag);
|
|
242
|
+
};
|
|
232
243
|
var patchBottom = function (deltaY = 0) {
|
|
233
244
|
var cache_height = list.offsetHeight;
|
|
234
245
|
var childrenMap = getChildrenMap();
|
|
@@ -250,7 +261,7 @@ function ylist(container, generator, $Y) {
|
|
|
250
261
|
} else if (!restHeight) {
|
|
251
262
|
restHeight = cache_height;
|
|
252
263
|
}
|
|
253
|
-
|
|
264
|
+
insertBeforeList(item, getNextSibling(last_element));
|
|
254
265
|
}
|
|
255
266
|
item = getNodeTarget(item);
|
|
256
267
|
if (!item.offsetHeight) {
|
|
@@ -315,7 +326,7 @@ function ylist(container, generator, $Y) {
|
|
|
315
326
|
if (!item) {
|
|
316
327
|
item = createItem(offset);
|
|
317
328
|
if (!item) break;
|
|
318
|
-
|
|
329
|
+
insertBeforeList(item, first_element);
|
|
319
330
|
item = getNodeTarget(item);
|
|
320
331
|
scrollTop += flag_element.offsetTop - offsetTop;
|
|
321
332
|
offsetTop = flag_element.offsetTop;
|
|
@@ -648,6 +659,7 @@ function list() {
|
|
|
648
659
|
list.clean = function (src, old) {
|
|
649
660
|
var children = (container || list).childNodes;
|
|
650
661
|
children = Array.prototype.filter.call(children, c => {
|
|
662
|
+
if (c.index === null) return false;
|
|
651
663
|
if (isFinite(c.index)) return true;
|
|
652
664
|
if (c.nodeType === 1 && c.$comment && isFinite(c.$comment.index)) return true;
|
|
653
665
|
return false;
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
if (envs[templateName]) {
|
|
226
226
|
delete envs[templateName];
|
|
227
227
|
var template = await cross("get", './components:' + modName + ".html");
|
|
228
|
-
codetext = `var ${templateName}={toString(){return \`${template.responseText}\`}};\r\n` + codetext;
|
|
228
|
+
codetext = `var ${templateName}={toString(){return \`${template.responseText.replace(/>\s+</g, '><')}\`}};\r\n` + codetext;
|
|
229
229
|
}
|
|
230
230
|
initcode(codetext);
|
|
231
231
|
}
|