efront 3.18.1 → 3.19.0
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/pivot/api.yml +2 -0
- package/apps/pivot/link/chat.js +8 -11
- package/apps/pivot/link/index.html +2 -0
- package/apps/pivot/link/index.js +13 -0
- package/apps/pivot/link/room.html +0 -0
- package/apps/pivot/link/room.js +10 -0
- package/apps/pivot/main.js +7 -1
- package/apps/pivot/menu.yml +1 -1
- package/apps/pivot/wow/edit.js +3 -0
- package/apps/pivot/wow/root.js +33 -4
- package/coms/basic/cross_.js +8 -1
- package/coms/frame/chat.html +1 -1
- package/coms/frame/chat.js +15 -2
- package/coms/frame/chat.less +3 -3
- package/coms/frame/list.js +13 -4
- package/coms/maps/baidu.js +6 -1
- package/coms/maps/gaode.js +3 -0
- package/coms/maps/google.js +2 -2
- package/coms/maps/osm.js +1 -1
- package/coms/pivot/pedit.less +3 -0
- package/coms/pivot/plist.js +7 -1
- package/coms/random//350/272/253/344/273/275/350/257/201.js +154 -0
- package/coms/reptile/cross.js +9 -4
- package/coms/zimoli/Item.js +37 -23
- package/coms/zimoli/container.js +12 -7
- package/coms/zimoli/contextmenu.js +6 -23
- package/coms/zimoli/createItemTarget.js +8 -2
- package/coms/zimoli/list.js +1 -1
- package/coms/zimoli/maps.js +323 -144
- package/coms/zimoli/maps.less +8 -0
- package/coms/zimoli/maps_test.html +2 -0
- package/coms/zimoli/maps_test.js +37 -28
- package/coms/zimoli/maps_test.less +4 -6
- package/coms/zimoli/menu.js +2 -2
- package/coms/zimoli/menuItem.html +1 -1
- package/coms/zimoli/menuItem.js +2 -4
- package/coms/zimoli/menuList.html +1 -1
- package/coms/zimoli/menuList.js +6 -5
- package/coms/zimoli/menuList.less +5 -0
- package/coms/zimoli/onmousewheel.js +1 -0
- package/coms/zimoli/popup.js +2 -1
- package/coms/zimoli/render.js +9 -3
- package/coms/zimoli/zimoli.js +12 -2
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/zimoli/Item.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
var id = 0;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
class Item extends Array {
|
|
3
|
+
constructor(value) {
|
|
4
|
+
super();
|
|
5
|
+
this.children = this;
|
|
6
|
+
this.count = 0;//子项中的叶子节点数
|
|
7
|
+
this.total = 0;//子项中的节点数
|
|
8
|
+
this.crack = 0;
|
|
9
|
+
this.id = ++id;
|
|
10
|
+
this.extends(value);
|
|
11
|
+
}
|
|
11
12
|
extends(value) {
|
|
12
13
|
this.value = value;
|
|
13
14
|
if (value.children instanceof Array) {
|
|
@@ -16,37 +17,49 @@ Item.prototype = extend([], {
|
|
|
16
17
|
this.push.apply(this, children);
|
|
17
18
|
}
|
|
18
19
|
if (isObject(value)) {
|
|
19
|
-
this.name = value.name;
|
|
20
20
|
this.tab = value.tab;
|
|
21
21
|
this.icon = value.icon;
|
|
22
22
|
this.color = value.color;
|
|
23
23
|
this.test = value.test;
|
|
24
24
|
this.line = value.line;
|
|
25
|
+
if (value.path) this.path = value.path;
|
|
26
|
+
if (value.id) this.id = value.id;
|
|
27
|
+
if (value.url) this.url = value.url;
|
|
28
|
+
if (value.href) this.href = value.href;
|
|
29
|
+
if (value.src) this.src = value.src;
|
|
25
30
|
}
|
|
26
|
-
|
|
27
|
-
this.name = value;
|
|
28
|
-
}
|
|
29
|
-
},
|
|
31
|
+
}
|
|
30
32
|
|
|
31
33
|
valueOf() {
|
|
32
34
|
return this.value;
|
|
33
|
-
}
|
|
35
|
+
}
|
|
34
36
|
toString() {
|
|
35
37
|
return String(this.value);
|
|
36
|
-
}
|
|
38
|
+
}
|
|
39
|
+
get warn() {
|
|
40
|
+
if (isObject(this.value)) {
|
|
41
|
+
return /danger|red|warn/.test(this.value.type) || this.value.warn;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
get name() {
|
|
46
|
+
if (isObject(this.value)) return this.value.name;
|
|
47
|
+
return this.value;
|
|
48
|
+
}
|
|
49
|
+
|
|
37
50
|
isClosed() {
|
|
38
51
|
return !!this.value.closed;
|
|
39
|
-
}
|
|
52
|
+
}
|
|
40
53
|
setClosed(value) {
|
|
41
54
|
this.value.closed = value;
|
|
42
|
-
}
|
|
55
|
+
}
|
|
43
56
|
isActive() {
|
|
44
57
|
if (isObject(this.value)) {
|
|
45
58
|
if ("active" in this.value) return this.value.active;
|
|
46
59
|
if ('actived' in this.value) return this.value.actived;
|
|
47
60
|
}
|
|
48
61
|
return !!this.actived;
|
|
49
|
-
}
|
|
62
|
+
}
|
|
50
63
|
setActive(value) {
|
|
51
64
|
if (isObject(this.value)) {
|
|
52
65
|
if ('active' in this.value) {
|
|
@@ -56,15 +69,16 @@ Item.prototype = extend([], {
|
|
|
56
69
|
}
|
|
57
70
|
}
|
|
58
71
|
this.actived = value;
|
|
59
|
-
}
|
|
72
|
+
}
|
|
60
73
|
isSelected() {
|
|
61
74
|
return !!this.value.selected;
|
|
62
|
-
}
|
|
75
|
+
}
|
|
63
76
|
isChecked() {
|
|
64
77
|
return !!this.value.checked;
|
|
65
|
-
}
|
|
78
|
+
}
|
|
66
79
|
getClass() {
|
|
67
80
|
return !!this.value.class;
|
|
68
81
|
}
|
|
69
|
-
|
|
82
|
+
|
|
83
|
+
}
|
|
70
84
|
Item.prototype.isActived = Item.prototype.isActive;
|
package/coms/zimoli/container.js
CHANGED
|
@@ -2,17 +2,22 @@ var change = function (data) {
|
|
|
2
2
|
zimoli.go(data, this.params, this);
|
|
3
3
|
};
|
|
4
4
|
var gosrc = function () {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var { src } = this;
|
|
6
|
+
if (this.hasAttribute && this.hasAttribute('src')) {
|
|
7
|
+
src = this.getAttribute('src');
|
|
8
|
+
}
|
|
9
|
+
if (src !== this._src) {
|
|
10
|
+
change.call(this, src);
|
|
11
|
+
this._src = src;
|
|
11
12
|
}
|
|
12
13
|
};
|
|
13
14
|
function container(element) {
|
|
15
|
+
var src;
|
|
16
|
+
if (element && element.hasAttribute('src')) {
|
|
17
|
+
src = element.getAttribute('src');
|
|
18
|
+
}
|
|
14
19
|
element = document.createComment('container');
|
|
15
|
-
|
|
20
|
+
element.src = src;
|
|
16
21
|
element.renders = [gosrc];
|
|
17
22
|
return element;
|
|
18
23
|
}
|
|
@@ -8,10 +8,11 @@ var createMenu = function (event, items) {
|
|
|
8
8
|
if (!item.when(event)) return false;
|
|
9
9
|
return true;
|
|
10
10
|
});
|
|
11
|
-
var elem = menuList(menulist, items,
|
|
12
|
-
|
|
13
|
-
remove(elem);
|
|
14
|
-
}
|
|
11
|
+
var elem = menuList(menulist, items, function (item) {
|
|
12
|
+
action.call(this, item, event.target).then(function (e) {
|
|
13
|
+
if (e !== false) remove(elem);
|
|
14
|
+
});
|
|
15
|
+
return false;
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
return elem;
|
|
@@ -30,26 +31,8 @@ function contextmenu(target, menuItems) {
|
|
|
30
31
|
css(menu, {
|
|
31
32
|
position: "absolute",
|
|
32
33
|
});
|
|
33
|
-
popup(menu);
|
|
34
|
+
popup(menu, event);
|
|
34
35
|
menu.focus();
|
|
35
|
-
var { offsetWidth, offsetHeight } = menu;
|
|
36
|
-
var left = event.clientX, top = event.clientY;
|
|
37
|
-
if (offsetWidth + left > innerWidth) {
|
|
38
|
-
left = left - offsetWidth;
|
|
39
|
-
}
|
|
40
|
-
if (left < 0) {
|
|
41
|
-
left = 0;
|
|
42
|
-
}
|
|
43
|
-
if (offsetHeight + top > innerHeight) {
|
|
44
|
-
top = top - offsetHeight;
|
|
45
|
-
}
|
|
46
|
-
if (top < 0) {
|
|
47
|
-
top = 0;
|
|
48
|
-
}
|
|
49
|
-
css(menu, {
|
|
50
|
-
left: left + "px",
|
|
51
|
-
top: top + "px"
|
|
52
|
-
});
|
|
53
36
|
onmousedown(menu, e => e.preventDefault());
|
|
54
37
|
onblur(menu, lazy(e => remove(menu)));
|
|
55
38
|
});
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
function createItemTarget(item) {
|
|
1
|
+
function createItemTarget(item, target) {
|
|
2
2
|
var $scope = {};
|
|
3
|
-
var { itemName } = this.$src;
|
|
3
|
+
var { itemName, indexName, keyName } = this.$src;
|
|
4
4
|
if (itemName) $scope[itemName] = item;
|
|
5
5
|
else $scope.$item = item;
|
|
6
|
+
if (target && target.$scope) {
|
|
7
|
+
if (indexName) $scope[indexName] = target.$scope[indexName];
|
|
8
|
+
if (keyName) $scope[keyName] = target.$scope[keyName];
|
|
9
|
+
$scope.$index = target.$scope.$index;
|
|
10
|
+
$scope.$key = target.$scope.$key;
|
|
11
|
+
}
|
|
6
12
|
return { $scope };
|
|
7
13
|
}
|
package/coms/zimoli/list.js
CHANGED
|
@@ -351,7 +351,7 @@ function ylist(container, generator, $Y) {
|
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
list.getLastVisibleElement = getLastVisibleElement;
|
|
355
355
|
list.stopY = function (count, spd) {
|
|
356
356
|
var firstElement = getFirstVisibleElement();
|
|
357
357
|
var lastElement = getLastVisibleElement();
|