efront 3.34.8 → 3.34.12
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/moue/home/index2.vue +3 -3
- package/apps/moue/index.html +8 -0
- package/coms/basic/#loader.js +1 -9
- package/coms/basic/assert.js +1 -1
- package/coms/basic_/readme.md +29 -7
- package/coms/kugou/song.less +9 -3
- package/coms/zimoli/button.js +1 -1
- package/coms/zimoli/grid.js +2 -2
- package/coms/zimoli/moue.js +1 -1
- package/coms/zimoli/on.js +1 -1
- package/coms/zimoli/text.js +8 -3
- package/coms/zimoli/transition.js +4 -4
- package/coms/zimoli/tree.js +2 -0
- package/data/packexe-setup.sfx +0 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/apps/speak/index.html +0 -21
- package/apps/speak/main.js +0 -5
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
}
|
|
41
41
|
</style>
|
|
42
42
|
<template>
|
|
43
|
-
<
|
|
43
|
+
<div1 editable>
|
|
44
44
|
<div class="nav" solid></div>
|
|
45
45
|
<div class="menu"></div>
|
|
46
46
|
<div class="main">
|
|
47
47
|
<btn @click="alert('你好')">abc</btn>
|
|
48
48
|
</div>
|
|
49
|
-
</
|
|
49
|
+
</div1>
|
|
50
50
|
</template>
|
|
51
51
|
<script>
|
|
52
52
|
export default {
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
components: {
|
|
57
57
|
btn: button_test,
|
|
58
58
|
btn: moue(button, "click"),
|
|
59
|
-
|
|
59
|
+
div1: moue(grid)
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
</script>
|
package/apps/moue/index.html
CHANGED
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
<link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
|
|
12
12
|
<meta name="viewport" content="initial-scale=1,maximum-scale=1,width=device-width" />
|
|
13
13
|
<title>Efront 项目</title>
|
|
14
|
+
<style>
|
|
15
|
+
body,
|
|
16
|
+
html {
|
|
17
|
+
margin: 0;
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
14
22
|
<script deleteoncompile efrontloader>
|
|
15
23
|
// 若要在开发环境使用内置组件,请保留此script标签中的代码,在编译发布时,这里的代码会自动删除
|
|
16
24
|
</script>
|
package/coms/basic/#loader.js
CHANGED
|
@@ -244,7 +244,7 @@ var killCircle = function () {
|
|
|
244
244
|
// -->
|
|
245
245
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
246
246
|
var loadModule = function (name, then, prebuilds = {}) {
|
|
247
|
-
if (/^(?:module|exports|define|require|window|global|undefined
|
|
247
|
+
if (/^(?:module|exports|define|require|window|global|undefined)$/.test(name)) return then();
|
|
248
248
|
if ((hasOwnProperty.call(prebuilds, name)) || hasOwnProperty.call(modules, name) || (!/^on/.test(name) && window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name))
|
|
249
249
|
) return then();
|
|
250
250
|
preLoad(name);
|
|
@@ -369,7 +369,6 @@ var getArgs = function (text) {
|
|
|
369
369
|
}
|
|
370
370
|
var [, isAsync, isYield] = /^(@?)(\*?)/.exec(functionBody);
|
|
371
371
|
if (isAsync || isYield) functionBody = functionBody.slice(+!!isAsync + +!!isYield);
|
|
372
|
-
functionBody = functionBody.replace(/^(?:\s*(["'])user? strict\1;?[\r\n]*)*/i, "\"use strict\";\r\n");
|
|
373
372
|
return [argNames || [], functionBody, args || [], required || '', strs || [], !!isAsync, !!isYield];
|
|
374
373
|
};
|
|
375
374
|
var get_relatives = function (name, required, prefix = "") {
|
|
@@ -446,13 +445,6 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
|
|
|
446
445
|
for (let k in window.require) r[k] = window.require[k];
|
|
447
446
|
return r;
|
|
448
447
|
}
|
|
449
|
-
var filename = location.pathname + exec.file.replace(/([\s\S])[\$]/g, '$1/').replace(/\\/g, '/');
|
|
450
|
-
if (argName === "__dirname") {
|
|
451
|
-
return filename.replace(/[^\/]+$/, '');
|
|
452
|
-
}
|
|
453
|
-
if (argName === "__filename") {
|
|
454
|
-
return filename;
|
|
455
|
-
}
|
|
456
448
|
if (argName === "define") return window[argName] || function (m_name, requires, exec) {
|
|
457
449
|
if (m_name instanceof Function) {
|
|
458
450
|
exec = m_name;
|
package/coms/basic/assert.js
CHANGED
|
@@ -19,7 +19,7 @@ var assert = function (result, expect, log = dump) {
|
|
|
19
19
|
var [r, e] = mark.pair(result, expect);
|
|
20
20
|
r = String(r).trim().replace(/><\//g, "> </");
|
|
21
21
|
e = String(e).trim().replace(/><\//g, "> </");
|
|
22
|
-
errors = `<cyan>结果 </cyan
|
|
22
|
+
errors = `<cyan>结果 </cyan><${color1}>${r}</${color1}>\r\n <cyan>应为 </cyan><${color2}>${e}</${color2}>\r\n`;
|
|
23
23
|
};
|
|
24
24
|
return function (error) {
|
|
25
25
|
if (error instanceof Object) {
|
package/coms/basic_/readme.md
CHANGED
|
@@ -7,6 +7,28 @@
|
|
|
7
7
|
因为如果增加一级原型,数组的特性便会消失,`efront`暂时并没有实现完美的降级方案,未来实现的可能性也不大。类似语句经`typescript`转换后新定义的方法会丢失, `efront` 在降级编译期使用 `class ... extends Array2 {...}` 进行替换,`Array2`会将定义的方法挂载到新生成的对象上。
|
|
8
8
|
|
|
9
9
|
2. ```javascript
|
|
10
|
+
import(...)
|
|
11
|
+
```
|
|
12
|
+
用`import(...)`导入的结果,efront不会主动包装一层Promise,如果你在模块的根作用域中中使用了`await`,返回结果就是一个`Promise`的实例,否则你在导入的文件内导出了什么,这个`import(...)`的结果就是什么。如果你不确定导入文件的内容,不盲目使用`import(...).then(...)`这类的方法,可以使用`await import(...)`等待导入完成。
|
|
13
|
+
3. ```javascript
|
|
14
|
+
(function (a){
|
|
15
|
+
if (a === void 0) a = 1;
|
|
16
|
+
a = 1;
|
|
17
|
+
console.log(arguments[0])// 1
|
|
18
|
+
}(0));
|
|
19
|
+
(function (a){"use strict"
|
|
20
|
+
if (a === void 0) a = 1;
|
|
21
|
+
a = 1;
|
|
22
|
+
console.log(arguments[0])// 0
|
|
23
|
+
}(0));
|
|
24
|
+
(function (a = 1){
|
|
25
|
+
a = 1;
|
|
26
|
+
console.log(arguments[0])// 0
|
|
27
|
+
}(0));
|
|
28
|
+
```
|
|
29
|
+
非严格模式且没有默认值的`arguments`是会被代码中的语句改掉的,而其他两种情况不会。`efront`和`typescript`在把默认值赋值的语句移动到函数体内时,都没有处理这一细节,即原来只读的`arguments`可能被函数内的语句改掉。`efront`内提供的一些组件,可能也会有一部分有无法降级使用的问题,如果您发现的相关的问题,可以向我反馈,我会尽快处理。
|
|
30
|
+
|
|
31
|
+
4. ```javascript
|
|
10
32
|
async function () {
|
|
11
33
|
await ...;
|
|
12
34
|
arguments; // typescript 转换后arguments对象的内容有误
|
|
@@ -19,7 +41,7 @@
|
|
|
19
41
|
```
|
|
20
42
|
这不是一个难解决的问题,应该只是`typescript`已发现但不愿解决的问题。`efront`在降级编译时临时使用变量重命名的方法对代码中的`arguments`进行替换使其内容与原生高级代码一致。
|
|
21
43
|
|
|
22
|
-
|
|
44
|
+
5. ```javascript
|
|
23
45
|
Object.keys
|
|
24
46
|
Object.create
|
|
25
47
|
Array.prototype.map
|
|
@@ -30,7 +52,7 @@
|
|
|
30
52
|
Function.prototype.bind
|
|
31
53
|
```
|
|
32
54
|
以上几个方法`ie9+`系列浏览器已支持,但`ie8`及以下版本不支持,如果没有指定`--no-polyfill`参数`efront`在降级编译期会使用`[]map.js`中提供的方法进行修补,这些方法会在加载器检测到浏览器不支持`[].map`时进行初始化
|
|
33
|
-
|
|
55
|
+
6. ```javascript
|
|
34
56
|
Array.prototype.fill
|
|
35
57
|
Array(3).fill(0) // 类似这种的将变成[0,0,0]一个常量数组
|
|
36
58
|
var [a,b,c]=Array(3).fill(0).map((_,i)=>i+1) // 类似这种用于生成常量并赋值的,将直接变成赋值语句 var a=1,b=2,c=3
|
|
@@ -38,11 +60,11 @@
|
|
|
38
60
|
```
|
|
39
61
|
`Array(...).fill(...).map(...)`这种写法经常被`efront`开发者用来生成自增赋值序列,并且非所有运行环境都支持,所以包括其它显式用到`Array.prototype.fill`的几种写法都会被替换。为了目标代码的性能考虑,这种替换在自动常量化之前就要执行,所以不再支持用`polyfill`的开关进行关闭。如果要关闭,请使用参数`--no-autoeval`将自动常量化的功能一同关闭。
|
|
40
62
|
|
|
41
|
-
|
|
63
|
+
7. ```javascript
|
|
42
64
|
Object.assign
|
|
43
65
|
```
|
|
44
66
|
Object.assign,`ie`系列浏览器均不支持,由于经常被`efront`开发者使用,在降级编译期,如果没有指定`--no-polyfill`参数,将由`efront`处理成替代品[extend](../basic/extend.js)
|
|
45
|
-
|
|
67
|
+
8. ```javascript
|
|
46
68
|
Promise
|
|
47
69
|
Promise.prototype.then
|
|
48
70
|
Promise.prototype.catch
|
|
@@ -52,13 +74,13 @@
|
|
|
52
74
|
Promise.resolve
|
|
53
75
|
```
|
|
54
76
|
`Promise`对象也是`ie`系列浏览器均不支持的。`efront`实现的`Promise`与原生的特性并不一致,仅在运行环境不支持的时候进行替代。比如由`.then`触发的方法与`setTimeout`触发的方法执行的先后顺序会与高级的运行环境有所区别,但也会保持在当前语境执行后再执行相关的语句。以上没有提到的`Promise`相关的方法均不支持,如`Promise.prototype.finally`,如果您使用了这些缺失的特性,就只能自己实现或找类似[core-js](https://github.com/zloirock/core-js)的库填充了
|
|
55
|
-
|
|
77
|
+
9. ```javascript
|
|
56
78
|
obj.if
|
|
57
79
|
obj.catch
|
|
58
80
|
obj.for
|
|
59
81
|
```
|
|
60
82
|
类似这种用`.`取属性的语句,由于属性名与`js`的保留字一样,`ie6`等浏览器会报错,但您可以在`efront`提供的环境中放心使用。因为`efront`本身就会把取属性的语句处理掉。
|
|
61
|
-
|
|
83
|
+
10. `ie8`及以下浏览器中存在的一些与现代`js`标准不同的特性,`efront`提供的组件可能不兼容,在处理为这类环境进行应用开发时,应避免使用。
|
|
62
84
|
```javascript
|
|
63
85
|
Object.defineProperty(...);
|
|
64
86
|
({
|
|
@@ -74,7 +96,7 @@
|
|
|
74
96
|
```javascript
|
|
75
97
|
Array.prototype.slice.call(objNodeList,...)
|
|
76
98
|
```
|
|
77
|
-
`ie8
|
|
99
|
+
`ie8`及以下浏览器不支持call`NodeList`等dom对象,而当前`efront`和内部使用的`typescript`转换的代码都没有处理这一细节,所以暂时不要在dom操作相关的语句中使用类似`[...aaa]`,`{...aaa}`,`function(...args){}`的高级语法,以避免转换后的代码出问题。
|
|
78
100
|
```javascript
|
|
79
101
|
var div = document.createElement("div");
|
|
80
102
|
div.innerHTML = `<abcd><span></span></abcd>`;
|
package/coms/kugou/song.less
CHANGED
|
@@ -96,9 +96,11 @@
|
|
|
96
96
|
[type=kuwo] {
|
|
97
97
|
background-image: url("icons/kuwo.png");
|
|
98
98
|
}
|
|
99
|
+
|
|
99
100
|
[type=yyyy] {
|
|
100
101
|
background-image: url("icons/yyyy.ico");
|
|
101
102
|
}
|
|
103
|
+
|
|
102
104
|
[type=qqjt] {
|
|
103
105
|
background-image: url("icons/qqjt.ico");
|
|
104
106
|
}
|
|
@@ -106,6 +108,10 @@
|
|
|
106
108
|
|
|
107
109
|
&[group]>.song {
|
|
108
110
|
white-space: normal;
|
|
111
|
+
|
|
112
|
+
>span {
|
|
113
|
+
display: inline-block;
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
>.song {
|
|
@@ -113,13 +119,13 @@
|
|
|
113
119
|
padding-top: 2px;
|
|
114
120
|
padding-bottom: 12px;
|
|
115
121
|
width: 100%;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
display: inline-block;
|
|
124
|
+
text-overflow: ellipsis;
|
|
116
125
|
|
|
117
126
|
>span {
|
|
118
127
|
margin-right: 6px;
|
|
119
128
|
vertical-align: top;
|
|
120
|
-
display: inline-block;
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
text-overflow: ellipsis;
|
|
123
129
|
}
|
|
124
130
|
}
|
|
125
131
|
|
package/coms/zimoli/button.js
CHANGED
package/coms/zimoli/grid.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
var grids = [];
|
|
3
3
|
|
|
4
4
|
var getFirstPoints = function (point, side, direction) {
|
|
@@ -747,7 +747,7 @@ var createPointsWithChildren = function () {
|
|
|
747
747
|
range[3] = Math.floor(range[3]);
|
|
748
748
|
return range;
|
|
749
749
|
};
|
|
750
|
-
var elements =
|
|
750
|
+
var elements = Array.apply(null, grid.children).map(a => [a,
|
|
751
751
|
+Math.max(0, a.offsetLeft * grid.width / grid.clientWidth).toFixed(0),
|
|
752
752
|
+(Math.min(a.offsetLeft + a.offsetWidth, grid.clientWidth) * grid.width / grid.clientWidth).toFixed(0),
|
|
753
753
|
+Math.max(0, a.offsetTop * grid.height / grid.clientHeight).toFixed(0),
|
package/coms/zimoli/moue.js
CHANGED
package/coms/zimoli/on.js
CHANGED
package/coms/zimoli/text.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
function text(node, text) {
|
|
2
2
|
if (arguments.length === 2) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
if (isFunction(text)) text = text();
|
|
4
|
+
if (isFunction(node.setText)) {
|
|
5
|
+
node.setText(text)
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
node.innerHTML = "";
|
|
9
|
+
node.appendChild(document.createTextNode(text));
|
|
10
|
+
}
|
|
6
11
|
}
|
|
7
12
|
return isFunction(node.getText) ? node.getText() : node.innerText;
|
|
8
13
|
}
|
|
@@ -17,8 +17,9 @@ function transition(target, isLeave, _initialStyle = target.initialStyle || targ
|
|
|
17
17
|
isLeave = parseKV(isLeave, ';', ":");
|
|
18
18
|
}
|
|
19
19
|
if (isObject(isLeave) && (_initialStyle === true || !_initialStyle)) {
|
|
20
|
+
var temp = _initialStyle;
|
|
20
21
|
_initialStyle = isLeave;
|
|
21
|
-
isLeave =
|
|
22
|
+
isLeave = temp;
|
|
22
23
|
}
|
|
23
24
|
if (isLeave) {
|
|
24
25
|
_initialStyle = target.leavingStyle || target.leaveStyle || _initialStyle;
|
|
@@ -30,7 +31,6 @@ function transition(target, isLeave, _initialStyle = target.initialStyle || targ
|
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
if (!target.style) return;
|
|
33
|
-
|
|
34
34
|
var initialStyle = _initialStyle || target.initialStyle;
|
|
35
35
|
var { recoverStyle, transitionTimerStart, transitionTimerEnd } = target;
|
|
36
36
|
clearTimeout(transitionTimerStart);
|
|
@@ -39,7 +39,7 @@ function transition(target, isLeave, _initialStyle = target.initialStyle || targ
|
|
|
39
39
|
initialStyle = parseKV(initialStyle, ";", ":");
|
|
40
40
|
}
|
|
41
41
|
if (isObject(initialStyle)) {
|
|
42
|
-
|
|
42
|
+
var transitionDuration = 100;
|
|
43
43
|
if (!initialStyle.transition) {
|
|
44
44
|
initialStyle.transition = "all .3s ease";
|
|
45
45
|
}
|
|
@@ -53,7 +53,7 @@ function transition(target, isLeave, _initialStyle = target.initialStyle || targ
|
|
|
53
53
|
if (!recoverStyle) {
|
|
54
54
|
recoverStyle = {};
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
var savedStyle = Object.create(null);
|
|
57
57
|
{
|
|
58
58
|
let originalStyle = target.style;
|
|
59
59
|
for (let k in initialStyle) {
|
package/coms/zimoli/tree.js
CHANGED
|
@@ -216,7 +216,9 @@ function tree() {
|
|
|
216
216
|
}
|
|
217
217
|
setState(false);
|
|
218
218
|
z0();
|
|
219
|
+
console.log(change_elem.getAttribute("style"),margin_top)
|
|
219
220
|
var res = transition(change_elem, { transition: `margin-top ${time(margin_top)}s ease-out`, marginTop: fromOffset(margin_top) }, false);
|
|
221
|
+
console.log(change_elem.getAttribute("style"),margin_top)
|
|
220
222
|
timeout(z1, res);
|
|
221
223
|
}
|
|
222
224
|
});
|
package/data/packexe-setup.sfx
CHANGED
|
Binary file
|