efront 3.25.3 → 3.25.5

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.
@@ -38,7 +38,7 @@ class Item extends Array {
38
38
  return this.value;
39
39
  }
40
40
  toString() {
41
- return String(this.value);
41
+ return String(this.name);
42
42
  }
43
43
  get warn() {
44
44
  if (isObject(this.value)) {
@@ -47,8 +47,8 @@ class Item extends Array {
47
47
  return false;
48
48
  }
49
49
  get name() {
50
- if (isObject(this.value)) return this.value.name;
51
- return this.value;
50
+ if (isObject(this.value)) return getName(this.value);
51
+ return String(this.value);
52
52
  }
53
53
 
54
54
  isClosed() {
@@ -25,7 +25,7 @@ function parseKV(string) {
25
25
  if (index < 0) index = kv.length;
26
26
  var k = kv.slice(0, index);
27
27
  var v = kv.slice(index + 1);
28
- if (isFunction(decode)) {
28
+ if (typeof decode === 'function') {
29
29
  k = decode(k);
30
30
  v = decode(v);
31
31
  }
@@ -2,6 +2,7 @@ var hasOwnProperty = {}.hasOwnProperty;
2
2
  function getName(o) {
3
3
  if (hasOwnProperty.call(o, 'toString')) return o.toString();
4
4
  if ("name" in o) return o.name;
5
+ if ("title" in o) return o.name;
5
6
  if ("label" in o) return o.label;
6
7
  if ("value" in o) return o.value;
7
8
  if (hasOwnProperty.call(o, 'valueOf')) return o.valueOf();
@@ -15,7 +15,7 @@ var isequal = (a, b) => a === b || Math.abs(a - b) < .1;
15
15
  var aimed = (from, to) => (from + from + from + to) / 4;
16
16
  function picture_(image = document.createElement("div")) {
17
17
  var image_width, image_height;
18
- var scaled = 1, x = 0, y = 0, min_scale, cover_scale, isxrelex, contain_scale, loaded_scale, click_scale, loaded_x, loaded_y;
18
+ var scaled = 1, x = 0, y = 0, min_scale, cover_scale, isxthin, contain_scale, loaded_scale, click_scale, loaded_x, loaded_y;
19
19
  var loaded_width, loaded_height;
20
20
  var max_scale = 10 * devicePixelRatio;
21
21
  var istouching = false;
@@ -38,14 +38,14 @@ function picture_(image = document.createElement("div")) {
38
38
  deltay = y + image_height * scaled / 2 - loaded_height / 2;
39
39
  }
40
40
  else if (scaled <= cover_scale) {
41
- if (isxrelex) {
42
- if (x > 0) deltax = x;
43
- else if (x + image_width * scaled < loaded_width) deltax = loaded_width - x + image_width * scaled;
44
- deltay = y + image_height * scaled / 2 - loaded_height / 2;
45
- } else {
46
- if (y > 0) deltay = y;
41
+ if (isxthin) {
42
+ if (y >= 0) deltay = y;
47
43
  else if (y + image_height * scaled < loaded_height) deltay = y + image_height * scaled - loaded_height;
48
44
  deltax = x + image_width * scaled / 2 - loaded_width / 2;
45
+ } else {
46
+ if (x >= 0) deltax = x;
47
+ else if (x + image_width * scaled < loaded_width) deltax = loaded_width - x + image_width * scaled;
48
+ deltay = y + image_height * scaled / 2 - loaded_height / 2;
49
49
  }
50
50
  }
51
51
  else {
@@ -81,9 +81,9 @@ function picture_(image = document.createElement("div")) {
81
81
  shaped_rotate = 0;
82
82
  var y_scale = loaded_height / image_height;
83
83
  var x_scale = loaded_width / image_width;
84
- isxrelex = x_scale > y_scale;
85
- cover_scale = isxrelex ? x_scale : y_scale;
86
- loaded_scale = contain_scale = isxrelex ? y_scale : x_scale;
84
+ isxthin = x_scale > y_scale;
85
+ cover_scale = isxthin ? x_scale : y_scale;
86
+ loaded_scale = contain_scale = isxthin ? y_scale : x_scale;
87
87
  if (loaded_scale >= 1) {
88
88
  if (loaded_scale > devicePixelRatio) {
89
89
  loaded_scale = devicePixelRatio;
@@ -256,7 +256,7 @@ function slider(autoplay, circle = true) {
256
256
  }
257
257
  })
258
258
 
259
- outter.go = function (index, cache) {
259
+ outter.go = lazy(function (index, cache) {
260
260
  if (outter.index === index && cache !== false) return;
261
261
  negative_index = -index;
262
262
  var _removingMain = _imageMain;
@@ -275,7 +275,7 @@ function slider(autoplay, circle = true) {
275
275
  setTimeout(() => css(_imageMain, "transform:scale(1);opacity:1;transition:.2s transform ease-out,.4s opacity"), 0);
276
276
  if (player.ing) play();
277
277
  return outter;
278
- };
278
+ }, 20);
279
279
  outter.play = function (schedule = player.schedule, _isMiss) {
280
280
  if (isDefined(_isMiss)) {
281
281
  isMiss = _isMiss;
@@ -65,11 +65,12 @@ function tree() {
65
65
  if (!elem) return;
66
66
  span = document.createElement('span');
67
67
  span.innerHTML = tabs;
68
+ span.setAttribute("tabs", '');
68
69
  elem.insertBefore(span, elem.firstChild);
69
70
  span = elem;
70
71
  } else {
71
72
  span = document.createElement("node");
72
- html(span, `${tabs}<c>${com.name}</c>${com.test ? "<i>_test</i>" : ""}<a class=count>${com.count}</a>`);
73
+ html(span, `<span tabs>${tabs}</span><c>${com.name}</c>${com.test ? "<i>_test</i>" : ""}<a class=count>${com.count}</a>`);
73
74
  span.count = span.lastElementChild;
74
75
  }
75
76
  var _div = button(span);
@@ -53,19 +53,19 @@ t {
53
53
 
54
54
  .closed,
55
55
  .open {
56
- c:before {
56
+ [tabs]+*:before {
57
57
  content: "";
58
- display: inline-block;
58
+ display: inline-block !important;
59
59
  border: .3em solid transparent;
60
60
  }
61
61
  }
62
62
 
63
- .closed c:before {
63
+ .closed [tabs]+*:before {
64
64
  border-left: .4em solid;
65
65
  border-right: .2em solid transparent;
66
66
  }
67
67
 
68
- .open c:before {
68
+ .open [tabs]+*:before {
69
69
  margin-left: -.2em;
70
70
  margin-right: .2em;
71
71
  margin-top: .2em;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.25.3",
3
+ "version": "3.25.5",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {