efront 3.18.2 → 3.18.3
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/link/chat.js +2 -8
- package/coms/basic/cross_.js +8 -1
- package/coms/frame/chat.html +1 -1
- package/coms/frame/chat.js +13 -1
- 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/sfz.js +154 -0
- package/coms/reptile/cross.js +9 -4
- package/coms/zimoli/contextmenu.js +1 -19
- 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/menuList.js +3 -2
- package/coms/zimoli/onmousewheel.js +1 -0
- package/coms/zimoli/popup.js +2 -1
- package/coms/zimoli/render.js +3 -1
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/zimoli/maps_test.js
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
1
|
function maps_test() {
|
|
2
|
-
var
|
|
2
|
+
var config = {
|
|
3
3
|
center: [/*兰考*/114.834364, 34.82138],
|
|
4
|
-
center: [/*蒙古*/104.751074, 44.163022],
|
|
5
|
-
center: [/*西亚*/48.068813, 29.321316],
|
|
6
|
-
zoom:
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
// center: [/*蒙古*/104.751074, 44.163022],
|
|
5
|
+
// center: [/*西亚*/48.068813, 29.321316],
|
|
6
|
+
zoom: 3
|
|
7
|
+
};
|
|
8
|
+
var page = document.createElement('map-test');
|
|
9
|
+
page.innerHTML = template;
|
|
10
|
+
renderWithDefaults(page, {
|
|
11
|
+
menus: ["高德", "百度", "谷歌", "OSM", { name: "Default", actived: true }].map(a => isObject(a) ? a : { name: a }),
|
|
12
|
+
menu,
|
|
13
|
+
maps: [
|
|
14
|
+
maps$gaode,
|
|
15
|
+
maps$baidu,
|
|
16
|
+
maps$google,
|
|
17
|
+
maps$osm,
|
|
18
|
+
],
|
|
19
|
+
actived: null,
|
|
20
|
+
locat(event) {
|
|
21
|
+
var map = this.map;
|
|
22
|
+
var layerx = event.offsetX || event.layerX || 0;
|
|
23
|
+
var layery = event.offsetY || event.layerY || 0;
|
|
24
|
+
var [lng, lat] = map.location(layerx, layery);
|
|
25
|
+
alert(`${lng},${lat}`);
|
|
26
|
+
},
|
|
27
|
+
open(m) {
|
|
28
|
+
console.log(m, this.actived)
|
|
29
|
+
for (var k in this.actived) {
|
|
30
|
+
delete this.mp.map[k];
|
|
21
31
|
}
|
|
22
|
-
extend(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
extend(this.mp.map, m, { cache: [] });
|
|
33
|
+
this.mp.map.refresh();
|
|
34
|
+
console.log(this.mp.map)
|
|
35
|
+
this.actived = m;
|
|
36
|
+
},
|
|
37
|
+
map() {
|
|
38
|
+
return new maps(config);
|
|
39
|
+
},
|
|
30
40
|
});
|
|
31
|
-
|
|
32
|
-
return option(group(buttons), map, 8);
|
|
41
|
+
return page;
|
|
33
42
|
}
|
|
@@ -7,11 +7,9 @@
|
|
|
7
7
|
background-position: 0 0, @background-size/2 @background-size/2;
|
|
8
8
|
height: 200px;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
.button {
|
|
14
|
-
height: 40px;
|
|
10
|
+
|
|
11
|
+
canvas {
|
|
15
12
|
width: 100%;
|
|
16
|
-
|
|
13
|
+
height: 100%;
|
|
14
|
+
background-color: #035;
|
|
17
15
|
}
|
package/coms/zimoli/menu.js
CHANGED
|
@@ -153,7 +153,7 @@ function main(elem, mode) {
|
|
|
153
153
|
tree(elem, function (index, item, menu) {
|
|
154
154
|
var e = generator(index, item);
|
|
155
155
|
if (!e || e.children.length) return e;
|
|
156
|
-
var m = menuItem(
|
|
156
|
+
var m = menuItem(null, menu, elem.useIcon);
|
|
157
157
|
return m;
|
|
158
158
|
});
|
|
159
159
|
care(elem, function (data) {
|
|
@@ -196,7 +196,7 @@ function main(elem, mode) {
|
|
|
196
196
|
case "vertical":
|
|
197
197
|
if (!direction) mode = "vertical", direction = 'y';
|
|
198
198
|
var emit = function (item, target) {
|
|
199
|
-
active(elem, item
|
|
199
|
+
active(elem, item, null, elem.$src ? createItemTarget.call(elem, item, target) : target);
|
|
200
200
|
};
|
|
201
201
|
if ("$src" in elem) {
|
|
202
202
|
getGenerator(elem, 'menu-item');
|
package/coms/zimoli/menuList.js
CHANGED
|
@@ -231,7 +231,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
231
231
|
if (this.menu.line) return;
|
|
232
232
|
if (byMousedown) return;
|
|
233
233
|
if (this.hasAttribute("disabled") || this.hasAttribute('line')) return;
|
|
234
|
-
var pop = active(this.menu, this);
|
|
234
|
+
var pop = active(this.menu.value, this);
|
|
235
235
|
if (pop === false) return;
|
|
236
236
|
var root = page.root || page;
|
|
237
237
|
if (root.direction === 't' || root.selected) {
|
|
@@ -297,7 +297,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
297
297
|
a.menu = s;
|
|
298
298
|
return a;
|
|
299
299
|
},
|
|
300
|
-
menus: items,
|
|
300
|
+
menus: items.map(i => i instanceof Item ? i : new Item(i)),
|
|
301
301
|
hasIcon: hasIcon(),
|
|
302
302
|
open: fire,
|
|
303
303
|
cancel,
|
|
@@ -316,6 +316,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
316
316
|
list(page, function (index) {
|
|
317
317
|
var item = items[index];
|
|
318
318
|
if (!item) return;
|
|
319
|
+
if (!(item instanceof Item)) item = new Item(item);
|
|
319
320
|
var a = $scope["menu-item"](null, item);
|
|
320
321
|
if (src.itemName) a.setAttribute("e-if", notHidden);
|
|
321
322
|
a.setAttribute("e-class", className);
|
package/coms/zimoli/popup.js
CHANGED
|
@@ -395,4 +395,5 @@ var global = function (element, issingle) {
|
|
|
395
395
|
};
|
|
396
396
|
var popup_as_yextra = _as_yextra.bind(null, global, innerWidth, innerHeight);
|
|
397
397
|
var popup_as_xextra = _as_xextra.bind(null, global, innerHeight, innerWidth);
|
|
398
|
-
var cleanup = new Cleanup(rootElements);
|
|
398
|
+
var cleanup = new Cleanup(rootElements);
|
|
399
|
+
popup.style = animationStyle;
|
package/coms/zimoli/render.js
CHANGED
|
@@ -90,6 +90,8 @@ var createGetter = function (search, isprop = true) {
|
|
|
90
90
|
var initialComment = function (renders, type, expression) {
|
|
91
91
|
var comment = document.createComment(`${type} ${expression}`);
|
|
92
92
|
comment.renders = renders;
|
|
93
|
+
comment.$scope = this.$scope;
|
|
94
|
+
comment.$parentScopes = this.$parentScopes;
|
|
93
95
|
appendChild.after(this, comment);
|
|
94
96
|
if (!/if/i.test(type)) remove(this);
|
|
95
97
|
if (!this.$struct.once) {
|
|
@@ -192,7 +194,6 @@ var createRepeat = function (search, id = 0) {
|
|
|
192
194
|
clone.$scope = $scope;
|
|
193
195
|
clone.$parentScopes = $parentScopes;
|
|
194
196
|
clone.$struct = $struct;
|
|
195
|
-
clone = render(clone, $scope, clone.$parentScopes);
|
|
196
197
|
clonedElements1[k] = clone;
|
|
197
198
|
return clone;
|
|
198
199
|
}, this);
|
|
@@ -201,6 +202,7 @@ var createRepeat = function (search, id = 0) {
|
|
|
201
202
|
if (a.previousSibling !== last) appendChild.after(last, a);
|
|
202
203
|
last = a;
|
|
203
204
|
}, this);
|
|
205
|
+
cloned.forEach(a => render(a))
|
|
204
206
|
for (var k in clonedElements) {
|
|
205
207
|
if (clonedElements1[k] !== clonedElements[k]) remove(clonedElements[k]);
|
|
206
208
|
}
|