efront 4.0.53 → 4.0.55
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/#loader.js +1 -0
- package/coms/basic/Table.js +1 -1
- package/coms/basic/parseCSV.js +54 -0
- package/coms/basic_/exec_.js +3 -2
- package/coms/compile/Program.js +8 -5
- package/coms/compile/autoenum.js +2 -1
- package/coms/compile/autoenum_test.js +1 -0
- package/coms/compile/common.js +6 -1
- package/coms/compile/richcss.js +89 -26
- package/coms/compile/richcss_test.js +13 -1
- package/coms/compile/scanner2_test.js +6 -1
- package/coms/docs/codetext.xht +1 -1
- package/coms/docs/markdown.js +28 -15
- package/coms/zimoli/AudioContext_test.less +38 -5
- package/coms/zimoli/autodragchildren.js +13 -0
- package/coms/zimoli/button.less +0 -1
- package/coms/zimoli/cloneVisible.js +1 -1
- package/coms/zimoli/contextmenu.less +1 -0
- package/coms/zimoli/drag.js +1 -0
- package/coms/zimoli/maps_test.less +7 -2
- package/coms/zimoli/model.js +1 -1
- package/coms/zimoli/table.html +2 -2
- package/coms/zimoli/table.js +28 -24
- package/docs/main.xht +1 -1
- package/docs/mark.xht +45 -2
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
@@ -340,6 +340,17 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
340
340
|
offdragend();
|
|
341
341
|
};
|
|
342
342
|
var offdragstart = on('dragstart')(targetChild, function () {
|
|
343
|
+
var c = drag.shadow;
|
|
344
|
+
var zIndex = c.style.zIndex - 1;
|
|
345
|
+
var copyZIndex = function (e) {
|
|
346
|
+
e.style.zIndex = zIndex;
|
|
347
|
+
var z = zIndex - 1;
|
|
348
|
+
if (e.with) for (var w of e.with) w.style.zIndex = z;
|
|
349
|
+
};
|
|
350
|
+
if (zIndex > 2) {
|
|
351
|
+
previousElements.forEach(copyZIndex);
|
|
352
|
+
followedElements.forEach(copyZIndex);
|
|
353
|
+
}
|
|
343
354
|
setOpacity(targetBox, draggingSourceOpacity);
|
|
344
355
|
});
|
|
345
356
|
var offdragend = on("dragend")(targetChild, function () {
|
|
@@ -350,6 +361,8 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
350
361
|
remove(followedElements);
|
|
351
362
|
previousElements.map(recover);
|
|
352
363
|
followedElements.map(recover);
|
|
364
|
+
previousElements.splice(0, previousElements.length);
|
|
365
|
+
followedElements.splice(0, followedElements.length);
|
|
353
366
|
});
|
|
354
367
|
var offdragmove = on("dragmove")(targetChild, dragmove);
|
|
355
368
|
}
|
package/coms/zimoli/button.less
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var cloneProperties = "fontWeight,fontSize,fontFamily,color,textShadow,opacity,writingMode,blockSize,wordSpacing,letterSpacing,whiteSpace
|
|
1
|
+
var cloneProperties = "fontWeight,fontSize,fontFamily,color,textShadow,opacity,writingMode,blockSize,wordSpacing,letterSpacing,whiteSpace".split(",");// text-node
|
|
2
2
|
var cloneProperties2 = "position,backdropFilter,filter,float,clear,margin,color,verticalAlign,textAlign,textShadow,opacity,boxShadow,overflow,textOverflow,wordBreak,webkitLineClamp,webkitBoxOrient,writingMode,blockSize,wordSpacing,letterSpacing,textIndent,lineHeight,display,appearance,webkitAppearance,MozAppearance".split(",");// element
|
|
3
3
|
var pushProperty = function (key, props) {
|
|
4
4
|
props.split(",").forEach(k => {
|
package/coms/zimoli/drag.js
CHANGED
|
@@ -76,6 +76,7 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
|
|
|
76
76
|
extraTargets = [];
|
|
77
77
|
if (target.style) css(target, { zIndex: z });
|
|
78
78
|
}
|
|
79
|
+
drag.shadow = clone;
|
|
79
80
|
var [clone_left, clone_top] = getOffset(clone);
|
|
80
81
|
extraClones = extraTargets.map(toCloneTarget);
|
|
81
82
|
extraClones.forEach(addZIndex);
|
|
@@ -7,9 +7,14 @@
|
|
|
7
7
|
background-position: 0 0, @background-size/2 @background-size/2;
|
|
8
8
|
height: 200px;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
menu{
|
|
11
|
+
left: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
appearance: none;
|
|
14
|
+
display: block;
|
|
15
|
+
}
|
|
11
16
|
canvas {
|
|
12
17
|
width: 100%;
|
|
13
|
-
height:
|
|
18
|
+
height: 300px;
|
|
14
19
|
background-color: #035;
|
|
15
20
|
}
|
package/coms/zimoli/model.js
CHANGED
|
@@ -257,7 +257,7 @@ function main(elem) {
|
|
|
257
257
|
elem.innerHTML = '<span ng-bind=get()></span>';
|
|
258
258
|
render(elem, {
|
|
259
259
|
get() {
|
|
260
|
-
if (
|
|
260
|
+
if (isEmpty(field.key)) return;
|
|
261
261
|
var value = seek(data, field.key);
|
|
262
262
|
if (field.options) {
|
|
263
263
|
if (!field.optionsMap) {
|
package/coms/zimoli/table.html
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
<td fixed row-index -bind="i+1" :style="adapter.firstChild.getAttribute('style')">
|
|
14
14
|
</td>
|
|
15
15
|
<td fixed:="f.fixed" -repeat="(f,i) in fields" :style="adapter.children[i+1].getAttribute('style')">
|
|
16
|
-
<model -if="f.key&&!isEmpty(d[f.key])" :field=f :data=d readonly></model>
|
|
16
|
+
<model -if="!isEmpty(f.key)&&!isEmpty(d[f.key])" :field=f :data=d readonly></model>
|
|
17
17
|
<template -else> </template>
|
|
18
|
-
<a on-click="o.do(d)" -if="
|
|
18
|
+
<a on-click="o.do(d)" -if="isEmpty(f.key)&&f.options&&(!o.when||o.when(d))"
|
|
19
19
|
_type="o.type instanceof Function?o.type(d):o.type" -repeat="o in f.options">
|
|
20
20
|
<span -text="o.name instanceof Function?o.name(d):o.name"></span>
|
|
21
21
|
</a>
|
package/coms/zimoli/table.js
CHANGED
|
@@ -371,28 +371,23 @@ var getTdsOfSameRow = function (td) {
|
|
|
371
371
|
return tds;
|
|
372
372
|
};
|
|
373
373
|
function setContextMenu(thead) {
|
|
374
|
-
var fields = this.
|
|
375
|
-
var
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
var width = thead.scrollWidth / scope.fields.length;
|
|
386
|
-
if (!width || width < 200) width = 200;
|
|
387
|
-
forEachRow(thead, function (tr) {
|
|
388
|
-
for (var td of tr.children) {
|
|
389
|
-
if (td.offsetWidth > width) css(td, { width });
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
setLazyFixedColumn.call(thead.parentNode, true)
|
|
374
|
+
var fields = this.originFields.slice();
|
|
375
|
+
var _do = function () {
|
|
376
|
+
this.checked = !this.checked;
|
|
377
|
+
var f = fields[this.index];
|
|
378
|
+
f.hidden = !this.checked;
|
|
379
|
+
scope.fields = fields.filter(f => !f.hidden);
|
|
380
|
+
var width = thead.scrollWidth / scope.fields.length;
|
|
381
|
+
if (!width || width < 200) width = 200;
|
|
382
|
+
forEachRow(thead, function (tr) {
|
|
383
|
+
for (var td of tr.children) {
|
|
384
|
+
if (td.offsetWidth > width) css(td, { width });
|
|
393
385
|
}
|
|
394
|
-
}
|
|
395
|
-
|
|
386
|
+
});
|
|
387
|
+
setLazyFixedColumn.call(thead.parentNode, true)
|
|
388
|
+
};
|
|
389
|
+
var menuItems = fields.map((f, i) => ({ name: f.name || " ", index: i, width: f.width, key: f.key, checked: !f.hidden, do: _do }));
|
|
390
|
+
var scope = this;
|
|
396
391
|
contextmenu(thead, menuItems);
|
|
397
392
|
}
|
|
398
393
|
function table(elem) {
|
|
@@ -468,11 +463,19 @@ function table(elem) {
|
|
|
468
463
|
};
|
|
469
464
|
vbox(table, 'x');
|
|
470
465
|
};
|
|
471
|
-
care(table, async function (
|
|
466
|
+
care(table, async function (src) {
|
|
467
|
+
if (src instanceof Table) {
|
|
468
|
+
data = src;
|
|
469
|
+
fields = data.fields;
|
|
470
|
+
}
|
|
471
|
+
else if (src instanceof Array) {
|
|
472
|
+
var [fields, data] = src;
|
|
473
|
+
}
|
|
474
|
+
else throw new Error("table组件源数据错误!");
|
|
472
475
|
if (_vbox) _vbox(), _vbox = null;
|
|
473
476
|
watch(table, {
|
|
474
477
|
find(text) {
|
|
475
|
-
if ($scope.data.constructor === Table){
|
|
478
|
+
if ($scope.data.constructor === Table) {
|
|
476
479
|
$scope.data.searchText = text;
|
|
477
480
|
$scope.data.update();
|
|
478
481
|
}
|
|
@@ -485,7 +488,8 @@ function table(elem) {
|
|
|
485
488
|
markedRows = false;
|
|
486
489
|
this.style.display = 'block';
|
|
487
490
|
var $scope = {
|
|
488
|
-
fields,
|
|
491
|
+
originFields: fields,
|
|
492
|
+
fields: fields.filter(f => !f.hidden),
|
|
489
493
|
isEmpty,
|
|
490
494
|
hasFoot: true,
|
|
491
495
|
setContextMenu,
|
package/docs/main.xht
CHANGED
package/docs/mark.xht
CHANGED
|
@@ -2,8 +2,52 @@
|
|
|
2
2
|
:scope {
|
|
3
3
|
line-height: 1.8;
|
|
4
4
|
display: block;
|
|
5
|
-
padding: 0 20px;
|
|
6
5
|
font-family: Times, "宋体", sans-serif;
|
|
6
|
+
|
|
7
|
+
@media screen and (max-width:830px) {
|
|
8
|
+
padding: 20px 40px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media screen and (min-width:1160px) {
|
|
12
|
+
margin: 20px auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media screen and (min-width:830px) {
|
|
16
|
+
max-width: 890px;
|
|
17
|
+
border: 1px solid #000;
|
|
18
|
+
padding: 60px 80px;
|
|
19
|
+
box-shadow: 0 0 20px -6px #0006;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
code {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
table {
|
|
28
|
+
margin-top: 12px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
thead {
|
|
32
|
+
font-weight: 900;
|
|
33
|
+
text-align: center;
|
|
34
|
+
|
|
35
|
+
td {
|
|
36
|
+
border-bottom: 1px solid #000;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ol,
|
|
41
|
+
ul {
|
|
42
|
+
padding-left: 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h1,
|
|
46
|
+
h2,
|
|
47
|
+
h3,
|
|
48
|
+
h4,
|
|
49
|
+
h5 {
|
|
50
|
+
border-bottom: 1px solid #000;
|
|
7
51
|
}
|
|
8
52
|
|
|
9
53
|
[type="xml"] stamp,
|
|
@@ -54,7 +98,6 @@
|
|
|
54
98
|
border-collapse: collapse;
|
|
55
99
|
border: 1.2px solid #0007;
|
|
56
100
|
}
|
|
57
|
-
|
|
58
101
|
</style>
|
|
59
102
|
<script>
|
|
60
103
|
var history = [];
|