efront 3.7.8 → 3.8.5
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 +7 -5
- package/coms/basic/strings.js +1 -1
- package/coms/compile/common.js +76 -10
- package/coms/compile/downLevel.js +11 -0
- package/coms/compile/scanner2.js +192 -34
- package/coms/zimoli/bggrid-func.less +16 -0
- package/coms/zimoli/color.js +18 -4
- package/coms/zimoli/colorlabel.js +3 -2
- package/coms/zimoli/colorlabel.less +24 -3
- package/coms/zimoli/colorpad.html +4 -0
- package/coms/zimoli/colorpad.js +120 -103
- package/coms/zimoli/colorpad.less +49 -47
- package/coms/zimoli/colorpicker.js +1 -1
- package/coms/zimoli/createElement.js +1 -1
- package/coms/zimoli/popup.js +2 -2
- package/coms/zimoli/select.js +3 -3
- package/coms/zimoli/selectList.js +35 -24
- package/coms/zimoli/selectList.less +4 -0
- package/coms/zimoli/selectListEdit.js +0 -1
- package/package.json +2 -2
- package/public/efront.js +1 -1
|
@@ -24,8 +24,8 @@ var multipleClick = function () {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
function main(children, multiple, addable) {
|
|
27
|
-
var
|
|
28
|
-
|
|
27
|
+
var page = div();
|
|
28
|
+
page.value = multiple ? [] : "";
|
|
29
29
|
var firstValue = false;
|
|
30
30
|
var clicker = multiple ? multipleClick : singleClick;
|
|
31
31
|
var itemMap = Object.create(null);
|
|
@@ -33,7 +33,6 @@ function main(children, multiple, addable) {
|
|
|
33
33
|
var key = option.key || option.value;
|
|
34
34
|
if (key in itemMap) return itemMap[key];
|
|
35
35
|
var item = itemMap[option.value] = document.createElement('div');
|
|
36
|
-
|
|
37
36
|
item.setAttribute("item", '');
|
|
38
37
|
item.innerHTML = option.innerHTML || option.name;
|
|
39
38
|
item.name = option.name || option.innerHTML;
|
|
@@ -47,12 +46,12 @@ function main(children, multiple, addable) {
|
|
|
47
46
|
iconed = icon;
|
|
48
47
|
if (multiple) {
|
|
49
48
|
item.setAttribute("selected", "");
|
|
50
|
-
|
|
49
|
+
page.value.push(option.value);
|
|
51
50
|
} else if (!firstValue) {
|
|
52
51
|
item.setAttribute("selected", "");
|
|
53
|
-
|
|
52
|
+
page.activeNode = item;
|
|
54
53
|
firstValue = true;
|
|
55
|
-
|
|
54
|
+
page.value = option.value
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
if (option.disabled) {
|
|
@@ -64,10 +63,22 @@ function main(children, multiple, addable) {
|
|
|
64
63
|
|
|
65
64
|
}
|
|
66
65
|
var hasIcon = false, iconed = '';
|
|
67
|
-
|
|
66
|
+
var page = list(page, function (i) {
|
|
67
|
+
if (i < 0 || i >= children.length) return;
|
|
68
|
+
return createItem(children[i]);
|
|
69
|
+
});
|
|
70
|
+
on("append")(page, function () {
|
|
71
|
+
page.clean();
|
|
72
|
+
page.go(0);
|
|
73
|
+
if (adder) {
|
|
74
|
+
remove(adder);
|
|
75
|
+
appendChild(page, adder);
|
|
76
|
+
}
|
|
77
|
+
})
|
|
68
78
|
if (addable) {
|
|
69
79
|
var adder = document.createElement("div");;
|
|
70
80
|
adder.innerHTML = "<a>添加</a><a>管理</a>";
|
|
81
|
+
adder.setAttribute('insert', '');
|
|
71
82
|
button(adder.firstChild);
|
|
72
83
|
button(adder.children[1]);
|
|
73
84
|
on("click")(adder, async function (event) {
|
|
@@ -81,43 +92,43 @@ function main(children, multiple, addable) {
|
|
|
81
92
|
return false;
|
|
82
93
|
}
|
|
83
94
|
});
|
|
84
|
-
|
|
95
|
+
page.with = a;
|
|
85
96
|
on('remove')(a, function () {
|
|
86
|
-
|
|
97
|
+
page.with = null;
|
|
87
98
|
});
|
|
88
99
|
a = await a;
|
|
89
100
|
if (a in itemMap) return false;
|
|
90
|
-
cast(
|
|
101
|
+
cast(page.target, "add-option", a);
|
|
91
102
|
children.push({ name: a, key: a });
|
|
92
|
-
|
|
103
|
+
page.insertBefore(createItem({
|
|
93
104
|
name: a,
|
|
94
105
|
value: a,
|
|
95
106
|
}), adder);
|
|
96
107
|
break;
|
|
97
108
|
case this.children[1]:
|
|
98
|
-
var options = [].slice.call(
|
|
109
|
+
var options = [].slice.call(children, 0, children.length);
|
|
99
110
|
var edit = selectListEdit(options.slice(0));
|
|
100
|
-
|
|
101
|
-
list.with = edit;
|
|
111
|
+
page.with = edit;
|
|
102
112
|
on("remove")(edit, function () {
|
|
103
|
-
|
|
104
|
-
remove([].slice.call(list.children, 0, list.children.length - 1));
|
|
113
|
+
page.with = null;
|
|
105
114
|
children.splice(0, children.length);
|
|
106
115
|
children.push.apply(children, edit.$scope.options.map(o => ({ key: o.key || o.value, name: o.name || o.innerHTML })))
|
|
107
|
-
|
|
108
|
-
|
|
116
|
+
cast(page.target, 'set-options', edit.$scope.options);
|
|
117
|
+
page.clean();
|
|
118
|
+
remove(adder);
|
|
119
|
+
page.go(0);
|
|
120
|
+
appendChild(page, adder);
|
|
109
121
|
});
|
|
110
122
|
popup(edit, [.5, .5]);
|
|
111
123
|
break;
|
|
112
124
|
}
|
|
113
|
-
})
|
|
125
|
+
});
|
|
114
126
|
adder.setAttribute("adder", '');
|
|
115
|
-
list.appendChild(adder)
|
|
116
127
|
}
|
|
117
128
|
if (hasIcon) {
|
|
118
|
-
|
|
129
|
+
page.setAttribute('iconed', '');
|
|
119
130
|
}
|
|
120
|
-
|
|
121
|
-
on('mousedown')(
|
|
122
|
-
return
|
|
131
|
+
page.icon = iconed;
|
|
132
|
+
on('mousedown')(page, e => e.preventDefault());
|
|
133
|
+
return page;
|
|
123
134
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efront",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.5",
|
|
4
4
|
"description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
|
|
5
5
|
"main": "public/efront.js",
|
|
6
6
|
"directories": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"efront": "public/efront.js"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"prepare": "node tools/build-efront.js",
|
|
13
|
+
"prepare": "node tools/build-efront.js --uplevel",
|
|
14
14
|
"start": "efront ./efront/ --libs=typescript,esprima,escodegen,esmangle,pngjs,less-node"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|