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.
- package/coms/basic/Item.js +3 -3
- package/coms/basic/parseKV.js +1 -1
- package/coms/zimoli/getName.js +1 -0
- package/coms/zimoli/picture_.js +10 -10
- package/coms/zimoli/slider.js +2 -2
- package/coms/zimoli/tree.js +2 -1
- package/coms/zimoli/tree.less +4 -4
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/basic/Item.js
CHANGED
|
@@ -38,7 +38,7 @@ class Item extends Array {
|
|
|
38
38
|
return this.value;
|
|
39
39
|
}
|
|
40
40
|
toString() {
|
|
41
|
-
return String(this.
|
|
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
|
|
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() {
|
package/coms/basic/parseKV.js
CHANGED
package/coms/zimoli/getName.js
CHANGED
|
@@ -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();
|
package/coms/zimoli/picture_.js
CHANGED
|
@@ -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,
|
|
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 (
|
|
42
|
-
if (
|
|
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
|
-
|
|
85
|
-
cover_scale =
|
|
86
|
-
loaded_scale = contain_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;
|
package/coms/zimoli/slider.js
CHANGED
|
@@ -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;
|
package/coms/zimoli/tree.js
CHANGED
|
@@ -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,
|
|
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);
|
package/coms/zimoli/tree.less
CHANGED
|
@@ -53,19 +53,19 @@ t {
|
|
|
53
53
|
|
|
54
54
|
.closed,
|
|
55
55
|
.open {
|
|
56
|
-
|
|
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
|
|
63
|
+
.closed [tabs]+*:before {
|
|
64
64
|
border-left: .4em solid;
|
|
65
65
|
border-right: .2em solid transparent;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.open
|
|
68
|
+
.open [tabs]+*:before {
|
|
69
69
|
margin-left: -.2em;
|
|
70
70
|
margin-right: .2em;
|
|
71
71
|
margin-top: .2em;
|