efront 3.13.1 → 3.14.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.
Files changed (45) hide show
  1. package/apps/pivot/api.yml +7 -0
  2. package/apps/pivot/log/boot.html +2 -0
  3. package/apps/pivot/log/boot.js +44 -0
  4. package/apps/pivot/log/boot.less +11 -0
  5. package/apps/pivot/log/count.html +5 -1
  6. package/apps/pivot/log/count.js +11 -4
  7. package/apps/pivot/log/count.less +10 -2
  8. package/apps/pivot/main.js +9 -10
  9. package/apps/pivot/menu.yml +7 -3
  10. package/apps/pivot/proxy/edit.js +1 -0
  11. package/apps/pivot/proxy/list.js +12 -0
  12. package/apps/pivot/user/edit.js +1 -0
  13. package/apps/pivot/user/list.js +4 -0
  14. package/apps/pivot/user/tag/edit.js +1 -0
  15. package/apps/pivot/user/tag/list.js +3 -0
  16. package/coms/basic/cross_.js +8 -1
  17. package/coms/basic/encodePack.js +2 -9
  18. package/coms/basic/parseURL_test.js +2 -0
  19. package/coms/basic/renderExpress.js +1 -1
  20. package/coms/compile/common.js +165 -6
  21. package/coms/compile/scanner.js +7 -4
  22. package/coms/compile/scanner2.js +2 -117
  23. package/coms/compile/washcode.js +313 -0
  24. package/coms/frame/route.js +3 -0
  25. package/coms/pivot/plist.js +1 -1
  26. package/coms/typescript-helpers/__classPrivateFieldIn.js +11 -0
  27. package/coms/zimoli/cross.js +2 -3
  28. package/coms/zimoli/data.js +22 -4
  29. package/coms/zimoli/field.html +15 -10
  30. package/coms/zimoli/model.js +22 -1
  31. package/coms/zimoli/prompt.js +3 -1
  32. package/coms/zimoli/render.js +11 -8
  33. package/coms/zimoli/renderDefaults.js +1 -0
  34. package/coms/zimoli/search.js +5 -4
  35. package/coms/zimoli/select.js +7 -3
  36. package/coms/zimoli/selectList.js +7 -7
  37. package/coms/zimoli/selectListEdit.js +1 -1
  38. package/coms/zimoli/success.js +4 -0
  39. package/coms/zimoli/success.less +13 -0
  40. package/coms/zimoli/view.less +4 -0
  41. package/package.json +1 -1
  42. package/public/efront.js +1 -1
  43. package/apps/pivot/home/short.html +0 -1
  44. package/apps/pivot/home/short.js +0 -5
  45. package/apps/pivot/home/short.less +0 -1
@@ -1,6 +1,15 @@
1
1
  var hasOwnProperty = {}.hasOwnProperty;
2
2
  var renderElements = Object.create(null);
3
3
  var presets = Object.create(null);
4
+ presets.template = function (t) {
5
+ var node = document.createElement("div");
6
+ 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);
11
+ return comment;
12
+ };
4
13
  window.renderElements = renderElements;
5
14
  var renderidOffset = 10;
6
15
  var renderidClosed = 0;
@@ -70,7 +79,6 @@ var initialComment = function (renders, type, expression) {
70
79
  onremove(comment, removeRenderElement);
71
80
  appendChild.after(this, comment);
72
81
  if (!/if/i.test(type)) remove(this);
73
- this.with = comment;
74
82
  rebuild(comment);
75
83
  return comment;
76
84
  };
@@ -214,17 +222,12 @@ var createIf = function (search, id = 0) {
214
222
  var element = elements[cx];
215
223
  if (cx === shouldMount) {
216
224
  appendChild.before(this, element);
217
- element.with = this;
218
225
  if (element.renderid < 0) {
219
226
  element.renderid = id;
220
- var w = element.with;
221
- delete element.with;
222
- element = render(element);
223
- element.with = w;
227
+ elements[cx] = render(element);
224
228
  }
225
229
  }
226
230
  else {
227
- delete element.with;
228
231
  remove(element);
229
232
  }
230
233
  }
@@ -672,7 +675,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
672
675
  }
673
676
  }
674
677
  }
675
- if (element.children.length) renderElement(element.children, scope, parentScopes);
678
+ if (element.children && element.children.length) renderElement(element.children, scope, parentScopes);
676
679
  if (!isFirstRender) return element;
677
680
  for (var k in binds) {
678
681
  if (directives.hasOwnProperty(k)) {
@@ -34,6 +34,7 @@ extend(renderDefaults, {
34
34
  pic: img,
35
35
  image,
36
36
  back,
37
+ success,
37
38
  switch: swap,
38
39
  swap,
39
40
  password,
@@ -1,10 +1,11 @@
1
- function search(seartext, options) {
1
+ function search(seartext, options, path = "name") {
2
2
  if (options instanceof Array) {
3
3
  var hasFullmatch = false;
4
4
  var a = options.map(o => {
5
- if (o.name === seartext) hasFullmatch = true;
6
- var [power, m] = mark.power(o.name, seartext);
7
- return { power, name: m, value: o.value };
5
+ var name = seek(o, path);
6
+ if (name === seartext) hasFullmatch = true;
7
+ var [power, m] = mark.power(name, seartext);
8
+ return { power, [path]: m, value: o.value, item: o };
8
9
  }).filter(a => a.power > 0);
9
10
  a.sort(function (a, b) {
10
11
  return b.power - a.power;
@@ -24,6 +24,10 @@ var _remove = function () {
24
24
  var preventDefault = function (event) {
25
25
  event.preventDefault();
26
26
  };
27
+ var preventDefault1 = function (event) {
28
+ if (saved_list) return;
29
+ event.preventDefault();
30
+ }
27
31
  var lastTimeClick = 0;
28
32
  var removeByBlur = function () {
29
33
  if (!getTargetIn(this, document.activeElement)) _remove();
@@ -71,8 +75,8 @@ function select(target, list, removeOnSelect, direction) {
71
75
  target.innerHTML = `<option selected value="${this.value}">${this.name || this.value}</option>`
72
76
  }
73
77
  target.value = this.value;
74
- dispatch(target, "change");
75
78
  }
79
+ dispatch(target, "change");
76
80
  }
77
81
  };
78
82
  var onlistclick = function (event) {
@@ -96,8 +100,8 @@ function select(target, list, removeOnSelect, direction) {
96
100
  }
97
101
  on("keydown.up")(target, preventDefault);
98
102
  on("keydown.down")(target, preventDefault);
99
- on("keydown.enter")(target, preventDefault);
100
- on("keydown.space")(target, preventDefault);
103
+ on("keydown.enter")(target, preventDefault1);
104
+ on("keydown.space")(target, preventDefault1);
101
105
  var pop = function () {
102
106
  if (saved_list !== list) mousedown.call(this);
103
107
  };
@@ -60,7 +60,7 @@ function main() {
60
60
  function createItem(option) {
61
61
  var key = option.key || option.value;
62
62
  if (key in itemMap) return itemMap[key];
63
- var item = itemMap[option.value] = document.createElement('div');
63
+ var item = itemMap[key] = document.createElement('div');
64
64
  item.setAttribute("item", '');
65
65
  item.innerHTML = option.innerHTML || option.name;
66
66
  item.name = option.name || option.innerHTML;
@@ -78,12 +78,12 @@ function main() {
78
78
  iconed = icon;
79
79
  if (multiple) {
80
80
  item.setAttribute("selected", "");
81
- page.value.push(option.value);
81
+ page.value.push(key);
82
82
  }
83
83
  else {
84
84
  item.setAttribute("selected", "");
85
85
  page.activeNode = item;
86
- page.value = option.value
86
+ page.value = key
87
87
  }
88
88
  }
89
89
  if (option.disabled) {
@@ -142,10 +142,9 @@ function main() {
142
142
  if (a in itemMap) return false;
143
143
  cast(page.target, "add-option", a);
144
144
  children.push({ name: a, key: a });
145
- page.insertBefore(createItem({
146
- name: a,
147
- value: a,
148
- }), adder);
145
+ remove(page.children);
146
+ page.go(children.length - 1);
147
+ appendChild(page, adder);
149
148
  break;
150
149
  case this.children[1]:
151
150
  var options = [].slice.call(children, 0, children.length);
@@ -216,6 +215,7 @@ function main() {
216
215
  moveFocus(0);
217
216
  })
218
217
  var enter = function (e) {
218
+ if (e.defaultPrevented) return;
219
219
  e.preventDefault();
220
220
  var e = page.getIndexedElement(focus);
221
221
  if (e) e.click();
@@ -14,7 +14,7 @@ function main(options) {
14
14
  },
15
15
  del(o) {
16
16
  for (var cx = 0, dx = options.length; cx < dx; cx++) {
17
- if (options[cx].value === o.value) {
17
+ if (options[cx] === o || options[cx] === o.item) {
18
18
  var i = cx;
19
19
  break;
20
20
  }
@@ -0,0 +1,4 @@
1
+ function success(e) {
2
+ if (!e) e = document.createElement('success');
3
+ return e;
4
+ }
@@ -0,0 +1,13 @@
1
+ & {
2
+ background: #2942;
3
+ color: #294;
4
+ font-size: 24px;
5
+ line-height: 2;
6
+ text-align: center;
7
+ display: block;
8
+ font-family: "仿宋", sans-serif;
9
+
10
+ &:before {
11
+ content: " ✓ ";
12
+ }
13
+ }
@@ -127,4 +127,8 @@ body>& {
127
127
  padding: 0 20px;
128
128
  margin-left: 10px;
129
129
  }
130
+
131
+ a.button {
132
+ padding: 0;
133
+ }
130
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.13.1",
3
+ "version": "3.14.0",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {