efront 3.7.6 → 3.8.2
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/kugou/api.js +1 -1
- package/apps/kugou/index.html +3 -0
- package/apps/pivot/api.yml +2 -2
- package/apps/pivot/menu.yml +9 -5
- package/apps/pivot/task/edit.js +1 -0
- package/apps/pivot/task/list.js +6 -0
- package/apps/pivot/tick/list.js +5 -0
- package/apps/pivot/token/edit.js +1 -10
- package/apps/pivot/token/list.js +2 -9
- package/coms/basic/strings.js +1 -1
- package/coms/compile/common.js +24 -6
- package/coms/compile/scanner2.js +129 -28
- package/coms/crypt/encode62.js +1 -1
- package/coms/frame/list.js +36 -34
- package/coms/frame/list.less +3 -1
- package/coms/kugou/buildScroll.less +3 -0
- package/coms/pivot/pedit.js +13 -0
- package/coms/pivot/plist.js +13 -0
- 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/data.js +5 -1
- package/coms/zimoli/model.js +22 -2
- package/coms/zimoli/popup.js +2 -2
- package/coms/zimoli/render.js +2 -1
- 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/coms/zimoli/swap.less +1 -1
- package/coms/zimoli/table.html +2 -2
- package/coms/zimoli/table.js +1 -0
- package/package.json +2 -2
- package/public/efront.js +1 -1
package/coms/zimoli/render.js
CHANGED
|
@@ -565,7 +565,8 @@ function getFromScopes(key, scope, parentScopes) {
|
|
|
565
565
|
if (key in scope) {
|
|
566
566
|
return scope[key];
|
|
567
567
|
}
|
|
568
|
-
if (parentScopes) for (var
|
|
568
|
+
if (parentScopes) for (var cx = parentScopes.length - 1; cx >= 0; cx--) {
|
|
569
|
+
var o = parentScopes[cx];
|
|
569
570
|
if (key in o) {
|
|
570
571
|
return o[key];
|
|
571
572
|
}
|
package/coms/zimoli/select.js
CHANGED
|
@@ -16,7 +16,7 @@ var _remove = function () {
|
|
|
16
16
|
}
|
|
17
17
|
once('blur')(activeElement, function () {
|
|
18
18
|
if (!isMounted(this)) return removing_list.target.focus();
|
|
19
|
-
|
|
19
|
+
_remove();
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -137,8 +137,8 @@ function select(target, list, removeOnSelect, direction) {
|
|
|
137
137
|
}
|
|
138
138
|
var mousedown = function () {
|
|
139
139
|
initList();
|
|
140
|
-
if (saved_list !== list) {
|
|
141
|
-
_remove();
|
|
140
|
+
if (saved_list !== list || !isMounted(list)) {
|
|
141
|
+
if (saved_list && saved_list !== list) _remove();
|
|
142
142
|
if (document.activeElement !== target) target.focus();
|
|
143
143
|
popup(list, target, direction);
|
|
144
144
|
saved_list = list;
|
|
@@ -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/coms/zimoli/swap.less
CHANGED
package/coms/zimoli/table.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<tbody -src="d in data">
|
|
9
9
|
<tr>
|
|
10
10
|
<td -repeat="f in fields">
|
|
11
|
-
<
|
|
12
|
-
<a on-click="o.do(d)" -if="f.options" _type="o.type instanceof Function?o.type(d):o.type"
|
|
11
|
+
<model -if="f.key" :field=f :data=d readonly ></model>
|
|
12
|
+
<a on-click="o.do(d)" -if="!f.key&&f.options" _type="o.type instanceof Function?o.type(d):o.type"
|
|
13
13
|
-repeat="o in f.options">
|
|
14
14
|
<span -text="o.name instanceof Function?o.name(d):o.name"></span>
|
|
15
15
|
</a>
|
package/coms/zimoli/table.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efront",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.2",
|
|
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": {
|