efront 3.14.2 → 3.14.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.
@@ -123,9 +123,6 @@ function confirm() {
123
123
  onclick(btn, clickbtn);
124
124
  return btn;
125
125
  });
126
- onclick(element, function () {
127
- css(this, { zIndex: zIndex() });
128
- });
129
126
  preventOverflowScrolling(element);
130
127
  appendChild(option, buttons);
131
128
  if (!target) element.initialStyle = "transform:scale(0.96);opacity:0;transition:transform .3s,opacity .2s ease-out";
@@ -13,6 +13,21 @@ var getOffset = function (e) {
13
13
  if (isFinite(e.screenLeft)) return [e.screenLeft, e.screenTop];
14
14
  if (isFinite(e.screenX)) return [e.screenX, e.screenY];
15
15
  };
16
+ var z;
17
+ var addZIndex = function (clone) {
18
+ if (clone.style) clone.style.zIndex = z + (+clone.style.zIndex || 0);
19
+ };
20
+ var setZIndex = function () {
21
+ var target = this;
22
+ var computed = getComputedStyle(target);
23
+ var z0 = zIndex(0);
24
+ if (!z || computed.zIndex < z0) {
25
+ z = zIndex();
26
+ if (/^(absolute|fixed)$/i.test(computed.position)) {
27
+ css(target, { zIndex: z });
28
+ }
29
+ }
30
+ };
16
31
  function drag(target, initialEvent, preventOverflow, isMovingSource) {
17
32
  if (/^(?:select|input|textarea)$/i.test(initialEvent.target.tagName)) return;
18
33
  if (target.dragable === false) return;
@@ -36,7 +51,6 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
36
51
  var saved_height = target.outerHeight;
37
52
  }
38
53
  var extraClones;
39
-
40
54
  var mousemove = function (event) {
41
55
  if (event.moveLocked) return;
42
56
  if (/resize/i.test(getComputedStyle(document.body).cursor)) return;
@@ -50,21 +64,20 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
50
64
  dispatch("dragstart", target);
51
65
  if (isElement(target) && !/absolute|fixed/.test(getComputedStyle(target).position)) {
52
66
  clone = toCloneTarget(target, isMovingSource);
67
+ z = zIndex(0) + 1;
68
+ addZIndex(clone);
53
69
  appendChild(document.body, clone);
54
70
  } else {
55
71
  clone = target;
56
72
  extraTargets = [];
73
+ if (target.style) css(target, { zIndex: z });
57
74
  }
58
75
  var [clone_left, clone_top] = getOffset(clone);
59
76
  extraClones = extraTargets.map(toCloneTarget);
77
+ extraClones.forEach(addZIndex);
60
78
  extraClones.map(c => document.body.appendChild(c));
61
79
  saved_delta.x += clone_left - target_left;
62
80
  saved_delta.y += clone_top - target_top;
63
- if (clone.style) {
64
- var z = zIndex();
65
- clone.style.zIndex = z + (+clone.style.zIndex || 0);
66
- extraClones.map(e => e.style.zIndex = z + (+e.style.zIndex || 0));
67
- }
68
81
  }
69
82
  drag.target = clone;
70
83
  var offsetLeft = saved_delta.x + event.screenX;
@@ -125,6 +138,9 @@ drag.on = function (target, actionTarget = target.dragTarget) {
125
138
  var _mousedrag = mousedrag;
126
139
  var _touchdrag = touchdrag;
127
140
  }
141
+ onmousedown(actionTarget || target, setZIndex);
142
+ ontouchstart(actionTarget || target, setZIndex);
143
+ on("drop")(actionTarget || target, setZIndex);
128
144
  onmousedown(target, _mousedrag);
129
145
  ontouchstart(target, _touchdrag);
130
146
  move.bindPosition(actionTarget || target);
@@ -233,7 +233,7 @@ var _as_yextra = function (global, innerWidth, innerHeight, element, target, poi
233
233
  display: element.style.display
234
234
  };
235
235
  }
236
- var zindex = zIndex();
236
+ var zindex = zIndex(0) + 1;
237
237
  css(element, `position:absolute;z-index:${zindex}`);
238
238
  css(_rhomb, { zIndex: zindex });
239
239
  var release1 = onremove(target, function () {
@@ -7,7 +7,7 @@ presets.template = function (t) {
7
7
  var node = document.createElement(comment.parentNode.tagName || "div");
8
8
  node.innerHTML = t.innerHTML;
9
9
  comment.with = [].slice.call(node.childNodes, 0);
10
- appendChild.after(comment,comment.with);
10
+ appendChild.after(comment, comment.with);
11
11
  renderElement(comment.with, comment.$scope, comment.$parentScopes);
12
12
  });
13
13
  return comment;
@@ -692,7 +692,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
692
692
  }
693
693
  for (var k in props) {
694
694
  try {
695
- element[k] = props[k];
695
+ if (element[k] !== props[k]) element[k] = props[k];
696
696
  } catch (e) { }
697
697
  }
698
698
  ons.forEach(([on, key, value]) => on.call(element, key, [withContext, value]));
@@ -782,6 +782,9 @@ function renderStructure(element, scope, parentScopes = []) {
782
782
  element.removeAttribute(name);
783
783
  }
784
784
  else {
785
+ if (!/\-/.test(name) || value === '') {
786
+ copys.push(attr);
787
+ }
785
788
  props[name.replace(/\-(\w)/g, (_, w) => w.toUpperCase())] = value === "" ? true : value;
786
789
  }
787
790
  }
@@ -1,4 +1,6 @@
1
- var count=0x10000000;//弹出式菜单或窗口的zIndex起点
2
- function zIndex(){
3
- return count++;
1
+ var count = 0x10000000;//弹出式菜单或窗口的zIndex起点
2
+ function zIndex(inc = 1) {
3
+ inc |= 0;
4
+ if (inc > 0) count += inc;
5
+ return count;
4
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.14.2",
3
+ "version": "3.14.3",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {