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/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/menuItem.js
CHANGED
|
@@ -8,16 +8,14 @@ function main(elem, scope, hasIcon) {
|
|
|
8
8
|
var scope = item.$scope;
|
|
9
9
|
}
|
|
10
10
|
if (scope.menu) scope = scope.menu;
|
|
11
|
-
|
|
12
|
-
var icon = scope.icon;
|
|
13
|
-
if (hasIcon === undefined) hasIcon = !!icon;
|
|
11
|
+
if (hasIcon === undefined) hasIcon = !!scope.icon;
|
|
14
12
|
if (scope.disabled || scope.enabled === false) {
|
|
15
13
|
item.setAttribute('disabled', '');
|
|
16
14
|
}
|
|
17
15
|
else {
|
|
18
16
|
item.removeAttribute("disabled");
|
|
19
17
|
}
|
|
20
|
-
render(item.children, scope, hasIcon instanceof Array ? hasIcon : [{ useIcon: hasIcon, hasIcon
|
|
18
|
+
render(item.children, scope, hasIcon instanceof Array ? hasIcon : [{ useIcon: hasIcon, hasIcon }]);
|
|
21
19
|
if (scope.line) item.setAttribute("line", ''), on("click")(item, preventDefault);
|
|
22
20
|
if (scope.hotkey) bindAccesskey(item, scope.hotkey);
|
|
23
21
|
return item;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<menu-item ng-repeat="menu in menus" ng-if="!menu.hidden" ng-click="open.call(this)" ng-mouseleave="cancel()"
|
|
2
2
|
ng-mouseenter="popMenu.call(this)" ng-mousedown="popMenu1.call(this,event)" ng-class="{'has-children':menu.children&&menu.children.length,
|
|
3
|
-
'warn':menu.
|
|
3
|
+
'warn':menu.warn,
|
|
4
4
|
'actived':menu.isActived()
|
|
5
5
|
}">
|
|
6
6
|
</menu-item>
|
package/coms/zimoli/menuList.js
CHANGED
|
@@ -226,12 +226,12 @@ function main(page, items, active, direction = 'y') {
|
|
|
226
226
|
clear();
|
|
227
227
|
clearTimeout(popTimer);
|
|
228
228
|
}
|
|
229
|
-
var fire = function () {
|
|
229
|
+
var fire = async function () {
|
|
230
230
|
cancel();
|
|
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) {
|
|
@@ -286,7 +286,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
286
286
|
};
|
|
287
287
|
var $scope = {
|
|
288
288
|
"menu-item"(e, s) {
|
|
289
|
-
if (s === e.$scope) s = itemName ? s[itemName] : s.menu;
|
|
289
|
+
if (e && s === e.$scope) s = itemName ? s[itemName] : s.menu;
|
|
290
290
|
var a = button(
|
|
291
291
|
menuItem(e, s.value, this.hasIcon)
|
|
292
292
|
);
|
|
@@ -297,7 +297,6 @@ function main(page, items, active, direction = 'y') {
|
|
|
297
297
|
a.menu = s;
|
|
298
298
|
return a;
|
|
299
299
|
},
|
|
300
|
-
menus: items,
|
|
301
300
|
hasIcon: hasIcon(),
|
|
302
301
|
open: fire,
|
|
303
302
|
cancel,
|
|
@@ -308,7 +307,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
308
307
|
var src = page.$src;
|
|
309
308
|
var itemName = src.itemName;
|
|
310
309
|
var className = `{'has-children':${itemName}.children&&${itemName}.children.length,
|
|
311
|
-
'warn':${itemName}.
|
|
310
|
+
'warn':${itemName}.warn,
|
|
312
311
|
actived:${itemName}.isActived()
|
|
313
312
|
}`;
|
|
314
313
|
var notHidden = `!${itemName}.hidden`;
|
|
@@ -316,6 +315,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
316
315
|
list(page, function (index) {
|
|
317
316
|
var item = items[index];
|
|
318
317
|
if (!item) return;
|
|
318
|
+
if (!(item instanceof Item)) item = new Item(item);
|
|
319
319
|
var a = $scope["menu-item"](null, item);
|
|
320
320
|
if (src.itemName) a.setAttribute("e-if", notHidden);
|
|
321
321
|
a.setAttribute("e-class", className);
|
|
@@ -334,6 +334,7 @@ function main(page, items, active, direction = 'y') {
|
|
|
334
334
|
}
|
|
335
335
|
else {
|
|
336
336
|
page.innerHTML = menuList;
|
|
337
|
+
$scope.menus = items.map(i => i instanceof Item ? i : new Item(i));
|
|
337
338
|
render(page, $scope);
|
|
338
339
|
vbox(page);
|
|
339
340
|
}
|
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) {
|
|
@@ -188,11 +190,9 @@ var createRepeat = function (search, id = 0) {
|
|
|
188
190
|
var clone = element.cloneNode();
|
|
189
191
|
clone.innerHTML = element.innerHTML;
|
|
190
192
|
clone.renderid = id;
|
|
191
|
-
clone.$parentScopes = $parentScopes;
|
|
192
193
|
clone.$scope = $scope;
|
|
193
194
|
clone.$parentScopes = $parentScopes;
|
|
194
195
|
clone.$struct = $struct;
|
|
195
|
-
clone = render(clone, $scope, clone.$parentScopes);
|
|
196
196
|
clonedElements1[k] = clone;
|
|
197
197
|
return clone;
|
|
198
198
|
}, this);
|
|
@@ -201,6 +201,7 @@ var createRepeat = function (search, id = 0) {
|
|
|
201
201
|
if (a.previousSibling !== last) appendChild.after(last, a);
|
|
202
202
|
last = a;
|
|
203
203
|
}, this);
|
|
204
|
+
cloned.forEach(a => render(a));
|
|
204
205
|
for (var k in clonedElements) {
|
|
205
206
|
if (clonedElements1[k] !== clonedElements[k]) remove(clonedElements[k]);
|
|
206
207
|
}
|
|
@@ -691,7 +692,9 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
691
692
|
}
|
|
692
693
|
});
|
|
693
694
|
replacer.renderid = element.renderid;
|
|
694
|
-
|
|
695
|
+
var renders = element.renders;
|
|
696
|
+
if (replacer.renders) renders = renders.concat(replacer.renders);
|
|
697
|
+
replacer.renders = renders;
|
|
695
698
|
if (binds.src) replacer.$src = element.$src;
|
|
696
699
|
element = replacer;
|
|
697
700
|
element.$scope = scope;
|
|
@@ -701,6 +704,8 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
701
704
|
}
|
|
702
705
|
if (element.children && element.children.length) renderElement(element.children, scope, parentScopes, once);
|
|
703
706
|
if (!isFirstRender) return element;
|
|
707
|
+
var renders = element.renders;
|
|
708
|
+
element.renders = [];
|
|
704
709
|
for (var k in binds) {
|
|
705
710
|
if (directives.hasOwnProperty(k)) {
|
|
706
711
|
directives[k].call(element, [withContext, binds[k]])
|
|
@@ -718,6 +723,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
|
|
|
718
723
|
} catch (e) { }
|
|
719
724
|
}
|
|
720
725
|
ons.forEach(([on, key, value]) => on.call(element, key, [withContext, value]));
|
|
726
|
+
if (renders.length) element.renders.push.apply(element.renders, renders);
|
|
721
727
|
if (element.renders.length) {
|
|
722
728
|
if (element.renderid !== 9) {
|
|
723
729
|
onmounted(element, addRenderElement);
|
package/coms/zimoli/zimoli.js
CHANGED
|
@@ -127,7 +127,13 @@ function go(pagepath, args, history_name, oldpagepath) {
|
|
|
127
127
|
} else {
|
|
128
128
|
var { roles, options, id } = getZimoliParams(pagepath);
|
|
129
129
|
}
|
|
130
|
-
if (!pagepath)
|
|
130
|
+
if (!pagepath) {
|
|
131
|
+
if (isNode(history_name)) {
|
|
132
|
+
remove(history_name.activateNode);
|
|
133
|
+
history_name.activate = pagepath;
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
131
137
|
setZimoliParams(pagepath, { data: args, from: oldpagepath, options, roles, id });
|
|
132
138
|
prepare(pagepath, function (res) {
|
|
133
139
|
if (!res.roles || res.roles === true) res.roles = !!roles;
|
|
@@ -594,7 +600,11 @@ function addGlobal(element, name = null, isDestroy) {
|
|
|
594
600
|
}
|
|
595
601
|
global[name] = element;
|
|
596
602
|
} else if (isNode(name)) {
|
|
597
|
-
if (
|
|
603
|
+
if (name.nodeType !== 1) {
|
|
604
|
+
appendChild.after(name, element);
|
|
605
|
+
name.with = [element];
|
|
606
|
+
}
|
|
607
|
+
else if (isDestroy) appendChild.insert(name, element);
|
|
598
608
|
else appendChild(name, element);
|
|
599
609
|
} else if (isFunction(name)) {
|
|
600
610
|
name(element);
|