efront 3.13.3 → 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.
@@ -0,0 +1,313 @@
1
+ const {
2
+ /*-1 */COMMENT,
3
+ /* 0 */SPACE,
4
+ /* 1 */STRAP,
5
+ /* 2 */STAMP,
6
+ /* 3 */VALUE,
7
+ /* 4 */QUOTED,
8
+ /* 5 */PIECE,
9
+ /* 6 */EXPRESS,
10
+ /* 7 */SCOPED,
11
+ /* 8 */LABEL,
12
+ /* 9 */PROPERTY,
13
+ skipAssignment,
14
+ getDeclared,
15
+ createScoped,
16
+ createString,
17
+ } = require("./common");
18
+ var strings = require("../basic/strings");
19
+
20
+ /**
21
+ * 按语句分割代码
22
+ */
23
+ var createExpressList = function (parsed) {
24
+ var list = [];
25
+ for (var cx = 0, dx = parsed.length; cx < dx; cx++) {
26
+ var o = parsed[cx];
27
+ switch (o.type) {
28
+ case LABEL:
29
+ var exp = [o];
30
+ exp.first = exp[0];
31
+ list.push(exp);
32
+ break;
33
+ case STRAP:
34
+ case SCOPED:
35
+ case EXPRESS:
36
+ case VALUE:
37
+ case QUOTED:
38
+ var o0 = skipAssignment(o);
39
+ var exp = [];
40
+ do {
41
+ exp.push(o);
42
+ o = parsed[++cx];
43
+ } while (o0 !== o);
44
+ cx--;
45
+ patchExpress(exp);
46
+ list.push(exp);
47
+ break;
48
+ case COMMENT:
49
+ case SPACE:
50
+ case STAMP:
51
+ list.push([o]);
52
+ break;
53
+ default:
54
+ console.log(o.type, 'type');
55
+ }
56
+ }
57
+ return list;
58
+ };
59
+ var getFunctionEnd = function (first) {
60
+ if (!first) return false;
61
+ var o = first.next;
62
+ if (!o) return false;
63
+ if (first.type === STRAP && first.text === 'function') {
64
+ if (o.type === EXPRESS) o = o.next;
65
+ if (!o) return false;
66
+ if (o.next && !o.next.next) return o.next;
67
+ }
68
+ return false;
69
+ }
70
+ var patchExpress = function (exp) {
71
+ if (!exp.first) {
72
+ exp.first = exp[0];
73
+ }
74
+ if (!exp.lastUncomment) {
75
+ exp.lastUncomment = exp[exp.length - 1];
76
+ }
77
+ if (exp.first) {
78
+ delete exp.first.prev;
79
+ }
80
+ if (exp.lastUncomment) {
81
+ delete exp.lastUncomment.next;
82
+ }
83
+ var first = exp.first;
84
+ if (first && first.type === QUOTED && /^(['"`])use strict\1/i.test(first.text)) {
85
+ exp.saved = true;
86
+ }
87
+ if (first && first.type === SCOPED && first.entry === '(') {
88
+ var ff = first.first;
89
+ var fn = first.next;
90
+ if (fn && fn.type === SCOPED && fn.entry === '(') {
91
+ var fe = getFunctionEnd(ff);
92
+ if (fe) {
93
+ first.push(fn);
94
+ var fnn = fn.next;
95
+ if (fnn) {
96
+ first.next = fnn;
97
+ fnn.prev = first;
98
+ }
99
+ fn.prev = fe;
100
+ fe.next = fn;
101
+ delete fn.next;
102
+ exp.splice(1, 1);
103
+ }
104
+ }
105
+ }
106
+ };
107
+
108
+ function createExpressKey(exp) {
109
+ var keys = [];
110
+ for (var e of exp) {
111
+ if (e.type === EXPRESS) {
112
+ var t = e.text;
113
+ while (t.length > 0) {
114
+ if (/^\./.test(t)) {
115
+ if (!keys.length) keys.push('');
116
+ t = t.slice(1);
117
+ }
118
+ var m = /[^\.\[]+/.exec(t);
119
+ if (m) {
120
+ m = m[0];
121
+ keys.push(m);
122
+ t = t.slice(m.length);
123
+ continue;
124
+ }
125
+ var m = /^\[(['"`])([\s\S]*?)\1\]/.exec(t)
126
+ if (m) {
127
+ m = m[0];
128
+ t = t.slice(m.length);
129
+ m = m.slice(1, m.length - 1);
130
+ m = strings.decode(m);
131
+ keys.push(m);
132
+ continue;
133
+ }
134
+ break;
135
+ }
136
+ }
137
+ }
138
+ return keys.join('.');
139
+ }
140
+ function needLeft(o) {
141
+ if (o.type === EXPRESS && /^[\.\[]/.test(o.text)) return true;
142
+ if (o.type === SCOPED && o.entry === '[') return true;
143
+ return false;
144
+ }
145
+ function needRight(o) {
146
+ if (o.type === EXPRESS && /[\.\]]$/.test(o.text)) return true;
147
+ if (o.type === SCOPED && o.entry === '[') return true;
148
+ return false;
149
+ }
150
+ function renameId(id, amap) {
151
+ var m = /^[^\.]+/.exec(id);
152
+ if (m) {
153
+ var id0 = m[0];
154
+ var w = amap[id0];
155
+ if (w) return w + id.slice(id0.length);
156
+ }
157
+ };
158
+ function checkRefered(scope) {
159
+ var { used } = scope;
160
+ var map = Object.create(null);
161
+ for (var k in used) {
162
+ var u = used[k];
163
+ for (var o of u) {
164
+ var right = [];
165
+ var e = o;
166
+ while (e) {
167
+ if (right.length) {
168
+ if (!needRight(right[right.length - 1]) && !needLeft(e)) break;
169
+ }
170
+ right.push(e);
171
+ e = e.next;
172
+ }
173
+ if (right.length) {
174
+ var key = createExpressKey(right);
175
+ var iswrite = false;
176
+ iswrite = !!o.kind || !!e && e.type === STAMP && /=$/.test(e.text);
177
+ if (key) map[key] = map[key] | 1 + iswrite;
178
+ }
179
+ }
180
+ }
181
+ var readed, writed;
182
+ for (var k in map) {
183
+ if (map[k] >> 1) {
184
+ if (!writed) writed = Object.create(null);
185
+ writed[k] = true;
186
+ }
187
+ if (map[k] & 1) {
188
+ if (!readed) readed = Object.create(null);
189
+ readed[k] = true;
190
+ }
191
+ }
192
+ for (var s of scope) {
193
+ if (s.isfunc && s.pass) {
194
+ var [writed0, readed0] = checkRefered(s);
195
+ var { pass, args } = s;
196
+ var amap = {};
197
+ for (var cx = 0, dx = pass.length; cx < dx; cx++) {
198
+ amap[args[cx]] = pass[cx];
199
+ }
200
+ for (var w in writed0) {
201
+ var id = renameId(w, amap);
202
+ if (id) writed[id] = true;
203
+ }
204
+ for (var r in readed0) {
205
+ var id = renameId(r, amap);
206
+ if (id) readed[id] = true;
207
+ }
208
+ }
209
+ }
210
+
211
+ return [writed, readed];
212
+ }
213
+
214
+ var getroot = function (pick) {
215
+ if (pick) {
216
+ var match = /^[^\.]+/.exec(pick);
217
+ if (match) match = match[0];
218
+ return match;
219
+ }
220
+ }
221
+
222
+ function washcode(code, pick) {
223
+ var avoid = getroot(pick);
224
+ var needs = Object.assign(Object.create(null), pick ? { [pick]: true } : code.envs);
225
+ var explist = createExpressList(code);
226
+ var maped = Object.create(null);
227
+ for (var exp of explist) {
228
+ exp.scoped = createScoped(exp, true);
229
+ if (avoid && avoid in exp.scoped.used) {
230
+ if (code.vars[avoid] && !code.envs[avoid] && !maped[avoid]) {
231
+ exp.saved = true;
232
+ maped[avoid] = true;
233
+ }
234
+ }
235
+ var [writed, readed] = checkRefered(exp.scoped);
236
+ exp.writed = writed;
237
+ exp.readed = readed;
238
+ }
239
+ var count = 0;
240
+ while (count < explist.length) {
241
+ var saved_count = count;
242
+ for (var exp of explist) {
243
+ if (exp.saved) continue;
244
+ if (!exp.first) {
245
+ exp.saved = true;
246
+ count++;
247
+ break;
248
+ }
249
+ var { writed, readed } = exp;
250
+ for (var w in writed) {
251
+ if (w === avoid) continue;
252
+ if (needs[w] || getroot(w) in code.envs) {
253
+ exp.saved = true;
254
+ for (var r in readed) {
255
+
256
+ var rs = r.split('.');
257
+ while (rs.length) {
258
+ needs[rs.join('.')] = true;
259
+ rs.pop();
260
+ }
261
+ }
262
+ count++;
263
+ break;
264
+ }
265
+ }
266
+ }
267
+ if (saved_count === count) break;
268
+ }
269
+ for (var cx = 0, dx = explist.length; cx < dx; cx++) {
270
+ var exp = explist[cx];
271
+ var prev = explist[cx - 1], next = explist[cx + 1];
272
+ if (!exp.first) {
273
+ if (!exp.saved) continue;
274
+ if (exp.length !== 1 || !prev && !next) continue;
275
+ if (exp[0].type === STAMP) {
276
+ if (prev && !prev.saved || next && !next.saved) {
277
+ exp.saved = false;
278
+ }
279
+ continue;
280
+ }
281
+ if (next && !next.saved) {
282
+ exp.saved = false;
283
+ }
284
+ continue;
285
+ }
286
+ if (!exp.saved) {
287
+ if (exp[0].type === STRAP && /^(let|var|const)$/.test(exp[0].text)) {
288
+ var save = false, inc = 2;
289
+ while (next && next[0].type === STAMP && /^,$/.test(next[0].text)) {
290
+ next.saved = false;
291
+ next = explist[cx + inc++];
292
+ if (!next) break;
293
+ if (next.saved) {
294
+ save = true;
295
+ break;
296
+ }
297
+ next = explist[cx + inc++];
298
+ }
299
+ exp.saved = save;
300
+ if (exp.saved) {
301
+ if (!prev.saved) prev.saved = true;
302
+ exp.splice(1, exp.length - 1, ' ');
303
+ patchExpress(exp);
304
+ }
305
+ }
306
+ }
307
+ }
308
+ explist = explist.filter(e => e.saved);
309
+ var text = explist.map(createString).join("");
310
+ return text;
311
+ }
312
+
313
+ module.exports = washcode;
@@ -9,6 +9,10 @@
9
9
  }
10
10
  &+.titlebar>back{
11
11
  height: 44px;
12
+ pointer-events: all;
13
+ }
14
+ &+.titlebar{
15
+ pointer-events: none;
12
16
  }
13
17
 
14
18
  >png {
@@ -0,0 +1,11 @@
1
+ /**
2
+ * typescript:classPrivateFieldIn
3
+ * 这个文件由工具生成,请不要手动修改
4
+ *
5
+ * Efront Authors
6
+ * 2022-02-04T17:45:54.577Z
7
+ */
8
+ var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {
9
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
10
+ return typeof state === "function" ? receiver === state : state.has(receiver);
11
+ };
@@ -216,8 +216,8 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
216
216
  var dstElement = children[dst + delta];
217
217
  src = bindTarget(src, srcElement);
218
218
  dst = bindTarget(dst, dstElement);
219
- isFunction(move) && move(src, dst, dst + delta, appendSibling, targetBox);
220
- if (srcElement === children[src] && dstElement === children[dst + delta] && srcElement && dstElement) appendSibling(dstElement, srcElement);
219
+ var needFire = !isFunction(move) || move(src, dst, dst + delta, appendSibling, targetBox) !== false;
220
+ if (needFire && srcElement === children[src] && dstElement === children[dst + delta] && srcElement && dstElement) appendSibling(dstElement, srcElement);
221
221
  } else if (isMovingSource === false) {
222
222
  move(previousElements.length, previousElements.length, previousElements.length, null, targetBox);
223
223
  }
@@ -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";
@@ -17,9 +17,9 @@ if (cookiesData) {
17
17
  }
18
18
  }
19
19
 
20
- var digest = function () {
20
+ var digest = lazy(function () {
21
21
  dispatch('render', window);
22
- };
22
+ }, 0);
23
23
 
24
24
  var cross = cross_.bind(function (callback, onerror) {
25
25
  var xhr = new XMLHttpRequest;
@@ -32,7 +32,6 @@ var cross = cross_.bind(function (callback, onerror) {
32
32
 
33
33
  xhr.onreadystatechange = function () {
34
34
  if (xhr.readyState === 4) {
35
- dispatch(window, 'render');
36
35
  switch (xhr.status) {
37
36
  case 0:
38
37
  if (!navigator.onLine) {
@@ -569,8 +569,10 @@ var privates = {
569
569
  headers = seekFromSource(headers, api.base);
570
570
  }
571
571
  cross(realmethod, uri, headers).send(params).done(e => {
572
+ updateLoadingCount();
572
573
  ok(e.response || e.responseText);
573
574
  }).error(xhr => {
575
+ updateLoadingCount();
574
576
  try {
575
577
  var e = getErrorMessage(parseData(xhr.response || xhr.responseText || xhr.statusText || xhr.status));
576
578
  oh({ status: xhr.status, api, params: params1, error: e, toString: getErrorMessage })
@@ -643,7 +645,6 @@ function responseCrash(e, data) {
643
645
  data.error = e;
644
646
  }
645
647
  error_report(e, e.status < 500 ? 'warn' : 'error');
646
- updateLoadingCount();
647
648
  }
648
649
  var getData = function () { return this.data };
649
650
  var updateLoadingCount = function () {
@@ -659,7 +660,6 @@ var data = {
659
660
  response.is_loading = false;
660
661
  if (response.then === LoadingArray_then) delete response.then;
661
662
  }
662
- updateLoadingCount();
663
663
  },
664
664
  responseCrash,
665
665
  responseLoading(response) {
@@ -881,10 +881,12 @@ var data = {
881
881
  headers = seekFromSource(headers, api.base);
882
882
  }
883
883
  instance.loading = cross(method, uri, headers).send(params).done(xhr => {
884
+ updateLoadingCount();
884
885
  if (instance.loading !== xhr) return oh(aborted);
885
886
  instance.loading = null;
886
887
  ok(xhr.responseText || xhr.response);
887
888
  }).error(xhr => {
889
+ updateLoadingCount();
888
890
  if (instance.loading !== xhr) return oh(aborted);
889
891
  instance.loading = null;
890
892
  try {
@@ -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);
@@ -2,7 +2,10 @@ function isMounted(parent) {
2
2
  if ("isMounted" in parent) return parent.isMounted;
3
3
  var temp = parent;
4
4
  while (temp && temp !== document.documentElement) {
5
+ if ("isMounted" in temp) {
6
+ return parent.isMounted = temp.isMounted;
7
+ }
5
8
  temp = temp.parentNode;
6
9
  }
7
- return parent.isMounted = !!temp;
10
+ return !!temp;
8
11
  }
@@ -1,5 +1,5 @@
1
1
  // 中文编码 utf8
2
- function ylist(container, generator, $Y) {
2
+ function ylist(container, generator, $Y, group) {
3
3
  const cache_height = 2000;
4
4
  var restHeight = cache_height;
5
5
  var list = container || div();
@@ -118,7 +118,7 @@ function ylist(container, generator, $Y) {
118
118
  if (isNaN(itemIndex)) return;
119
119
  itemIndex = +itemIndex;
120
120
  __animated = false;
121
- if (!list.offsetHeight && !list.offsetWidth && !list.isMounted) {
121
+ if (!list.offsetHeight && !list.offsetWidth && !isMounted(list)) {
122
122
  saved_itemIndex = itemIndex;
123
123
  return;
124
124
  }
@@ -174,7 +174,7 @@ function ylist(container, generator, $Y) {
174
174
  }
175
175
  var indexed_item = getIndexedElement(index) || bottom_item;
176
176
  if (indexed_item) {
177
- list.scrollTop = indexed_item.offsetTop + indexed_item.offsetHeight * ratio - parseFloat(getComputedStyle(list).paddingTop);
177
+ list.scrollTop = -getFirstElement().offsetTop + indexed_item.offsetTop + indexed_item.offsetHeight * ratio;
178
178
  }
179
179
  };
180
180
  var runbuild = lazy(function () {
@@ -264,8 +264,6 @@ function ylist(container, generator, $Y) {
264
264
  }
265
265
  }
266
266
  if (collection.length) {
267
- var item = collection[collection.length - 1];
268
- scrollTop -= item.offsetTop + getOffsetHeight(item) - collection[0].offsetTop;
269
267
  var { paddingCount, paddingMax } = list;
270
268
  if (paddingCount > 0 && paddingMax > 0 && paddingCount < paddingMax) {
271
269
  let item = collection[collection.length - 1];
@@ -276,6 +274,13 @@ function ylist(container, generator, $Y) {
276
274
  item = item.nextSibling;
277
275
  }
278
276
  }
277
+ var item = collection[collection.length - 1];
278
+ if (item) item = item.nextSibling;
279
+ while (item && item.index % group) {
280
+ item = collection.pop();
281
+ }
282
+ var item = collection[collection.length - 1];
283
+ if (item) scrollTop -= item.offsetTop + getOffsetHeight(item) - collection[0].offsetTop;
279
284
  remove(collection);
280
285
  }
281
286
  //滚动到相应的位置
@@ -297,7 +302,7 @@ function ylist(container, generator, $Y) {
297
302
  if (!(paddingCount > 0 && paddingMax > 0 && paddingCount < paddingMax) || !(scrollTop < targetHeight)) {
298
303
  paddingCount = 0;
299
304
  }
300
- while (scrollTop < targetHeight || paddingCount > 0) {
305
+ while (scrollTop < targetHeight || paddingCount > 0 || offset % group) {
301
306
  offset--;
302
307
  if (!(scrollTop < targetHeight)) {
303
308
  paddingCount--;
@@ -350,7 +355,7 @@ function ylist(container, generator, $Y) {
350
355
  list.stopY = function () {
351
356
  var firstElement = getFirstVisibleElement();
352
357
  if (!firstElement) return;
353
- var paddingTop = parseFloat(getComputedStyle(list).paddingTop);
358
+ var paddingTop = getFirstElement().offsetTop;
354
359
  var paddingBottom = parseFloat(getComputedStyle(list).paddingBottom);
355
360
 
356
361
  var scrolled_t = (list.scrollTop + paddingTop - firstElement.offsetTop) / firstElement.offsetHeight;
@@ -398,10 +403,11 @@ function ylist(container, generator, $Y) {
398
403
  list.scrollBy = scrollBy;
399
404
  list.index = function (update) {
400
405
  if (update === false) return saved_itemIndex;
401
- var firstElement = getFirstVisibleElement();
402
- if (!firstElement) return saved_itemIndex;
403
- var index = firstElement.index;
404
- var scrolled = (list.scrollTop - firstElement.offsetTop + parseFloat(getComputedStyle(list).paddingTop) + .5 | 0) / firstElement.offsetHeight;
406
+ var firstVisible = getFirstVisibleElement();
407
+ if (!firstVisible) return saved_itemIndex;
408
+ var index = firstVisible.index;
409
+ var firstElement = getFirstElement();
410
+ var scrolled = (list.scrollTop - firstVisible.offsetTop + firstElement.offsetTop + .5 | 0) / firstVisible.offsetHeight;
405
411
  return index + scrolled;
406
412
  };
407
413
  list.topIndex = function () {
@@ -477,8 +483,10 @@ function list() {
477
483
  $Y = container.getAttribute("direction") || container.tagName;
478
484
  }
479
485
  }
486
+ var groupCount = /\d+/.exec($Y);
487
+ if (groupCount) groupCount = +groupCount[0];
480
488
  $Y = /^[xh]|[xh]$/i.test($Y) ? "X" : "Y";
481
- var list = ($Y === "X" ? xlist : ylist)(container, generator, $Y);
489
+ var list = ($Y === "X" ? xlist : ylist)(container, generator, $Y, groupCount || 2);
482
490
  if (bindSrc instanceof Array) {
483
491
  list.src = bindSrc;
484
492
  container.go(container.index() || 0);
@@ -172,6 +172,7 @@ var readonly_types = {
172
172
  return v;
173
173
  },
174
174
  };
175
+ readonly_types.anchor = readonly_types.url;
175
176
  var createOptionsMap = function (options) {
176
177
  var map = Object.create(null);
177
178
  for (var o of options) {
@@ -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 () {
@@ -2,12 +2,14 @@ var hasOwnProperty = {}.hasOwnProperty;
2
2
  var renderElements = Object.create(null);
3
3
  var presets = Object.create(null);
4
4
  presets.template = function (t) {
5
- var node = document.createElement("div");
6
5
  var comment = document.createComment('template');
7
- node.innerHTML = t.innerHTML;
8
- comment.with = [].slice.call(node.childNodes, 0);
9
- renderElement(comment.with, t.$scope, t.$parentScopes);
10
- remove(node.childNodes);
6
+ once("append")(comment, function () {
7
+ var node = document.createElement(comment.parentNode.tagName || "div");
8
+ node.innerHTML = t.innerHTML;
9
+ comment.with = [].slice.call(node.childNodes, 0);
10
+ appendChild.after(comment, comment.with);
11
+ renderElement(comment.with, comment.$scope, comment.$parentScopes);
12
+ });
11
13
  return comment;
12
14
  };
13
15
  window.renderElements = renderElements;
@@ -624,7 +626,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
624
626
  element.renderid = 1;
625
627
  var parentNode = element.parentNode;
626
628
  if (parentNode) {
627
- if (parentNode.renderid > 1 || parentNode.isMounted) element.renderid = 2;
629
+ if (parentNode.renderid > 1 || isMounted(parentNode)) element.renderid = 2;
628
630
  }
629
631
  element.renders = element.renders ? [].concat(element.renders) : [];
630
632
  var { ons, copys, attrs, props, binds, context: withContext, ids } = element.$struct;
@@ -690,7 +692,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
690
692
  }
691
693
  for (var k in props) {
692
694
  try {
693
- element[k] = props[k];
695
+ if (element[k] !== props[k]) element[k] = props[k];
694
696
  } catch (e) { }
695
697
  }
696
698
  ons.forEach(([on, key, value]) => on.call(element, key, [withContext, value]));
@@ -698,7 +700,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
698
700
  rebuild(element);
699
701
  onappend(element, addRenderElement);
700
702
  onremove(element, removeRenderElement);
701
- if (element.isMounted || element.renderid > 1) addRenderElement.call(element);
703
+ if (isMounted(element) || element.renderid > 1) addRenderElement.call(element);
702
704
  }
703
705
  if (elementid) scope[elementid] = element;
704
706
  for (var id of ids) {
@@ -780,6 +782,9 @@ function renderStructure(element, scope, parentScopes = []) {
780
782
  element.removeAttribute(name);
781
783
  }
782
784
  else {
785
+ if (!/\-/.test(name) || value === '') {
786
+ copys.push(attr);
787
+ }
783
788
  props[name.replace(/\-(\w)/g, (_, w) => w.toUpperCase())] = value === "" ? true : value;
784
789
  }
785
790
  }
@@ -5,7 +5,10 @@ function search(seartext, options, path = "name") {
5
5
  var name = seek(o, path);
6
6
  if (name === seartext) hasFullmatch = true;
7
7
  var [power, m] = mark.power(name, seartext);
8
- return { power, [path]: m, value: o.value, item: o };
8
+ o = Object.create(o);
9
+ o.power = power;
10
+ if (path) o[path] = m;
11
+ return o;
9
12
  }).filter(a => a.power > 0);
10
13
  a.sort(function (a, b) {
11
14
  return b.power - a.power;