efront 3.18.2 → 3.19.1
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 +32 -23
- package/coms/zimoli/contextmenu.js +6 -23
- package/coms/zimoli/createItemTarget.js +8 -2
- package/coms/zimoli/drag.js +0 -1
- 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 +5 -4
- package/coms/zimoli/menuList.less +5 -0
- package/coms/zimoli/move.js +5 -23
- package/coms/zimoli/oncemount.js +1 -1
- package/coms/zimoli/onmousewheel.js +1 -0
- package/coms/zimoli/popup.js +2 -1
- package/coms/zimoli/render.js +38 -27
- package/coms/zimoli/resize.js +1 -4
- 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,7 +17,6 @@ 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;
|
|
@@ -28,30 +28,38 @@ Item.prototype = extend([], {
|
|
|
28
28
|
if (value.href) this.href = value.href;
|
|
29
29
|
if (value.src) this.src = value.src;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
this.name = value;
|
|
33
|
-
}
|
|
34
|
-
},
|
|
31
|
+
}
|
|
35
32
|
|
|
36
33
|
valueOf() {
|
|
37
34
|
return this.value;
|
|
38
|
-
}
|
|
35
|
+
}
|
|
39
36
|
toString() {
|
|
40
37
|
return String(this.value);
|
|
41
|
-
}
|
|
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
|
+
|
|
42
50
|
isClosed() {
|
|
43
51
|
return !!this.value.closed;
|
|
44
|
-
}
|
|
52
|
+
}
|
|
45
53
|
setClosed(value) {
|
|
46
54
|
this.value.closed = value;
|
|
47
|
-
}
|
|
55
|
+
}
|
|
48
56
|
isActive() {
|
|
49
57
|
if (isObject(this.value)) {
|
|
50
58
|
if ("active" in this.value) return this.value.active;
|
|
51
59
|
if ('actived' in this.value) return this.value.actived;
|
|
52
60
|
}
|
|
53
61
|
return !!this.actived;
|
|
54
|
-
}
|
|
62
|
+
}
|
|
55
63
|
setActive(value) {
|
|
56
64
|
if (isObject(this.value)) {
|
|
57
65
|
if ('active' in this.value) {
|
|
@@ -61,15 +69,16 @@ Item.prototype = extend([], {
|
|
|
61
69
|
}
|
|
62
70
|
}
|
|
63
71
|
this.actived = value;
|
|
64
|
-
}
|
|
72
|
+
}
|
|
65
73
|
isSelected() {
|
|
66
74
|
return !!this.value.selected;
|
|
67
|
-
}
|
|
75
|
+
}
|
|
68
76
|
isChecked() {
|
|
69
77
|
return !!this.value.checked;
|
|
70
|
-
}
|
|
78
|
+
}
|
|
71
79
|
getClass() {
|
|
72
80
|
return !!this.value.class;
|
|
73
81
|
}
|
|
74
|
-
|
|
82
|
+
|
|
83
|
+
}
|
|
75
84
|
Item.prototype.isActived = Item.prototype.isActive;
|
|
@@ -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/drag.js
CHANGED
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();
|