efront 3.12.2 → 3.12.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.
- package/coms/zimoli/active.js +4 -4
- package/coms/zimoli/button.js +19 -1
- package/coms/zimoli/button.less +7 -0
- package/coms/zimoli/chooseFile.js +3 -1
- package/coms/zimoli/encode62.js +6 -3
- package/coms/zimoli/getGenerator.js +1 -1
- package/coms/zimoli/menu.js +13 -3
- package/coms/zimoli/menuList.js +0 -1
- package/coms/zimoli/picture.js +9 -3
- package/coms/zimoli/popup.js +4 -4
- package/coms/zimoli/render.js +1 -1
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/readme.md +1 -1
package/coms/zimoli/active.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// 激活 自定义的 active 事件
|
|
2
|
-
function active(target, value, item,
|
|
2
|
+
function active(target, value, item = value, srcElem) {
|
|
3
3
|
var activeEvent = createEvent("active");
|
|
4
4
|
activeEvent.item = item;
|
|
5
5
|
activeEvent.value = value;
|
|
6
|
-
if (
|
|
7
|
-
if (Object.defineProperty) Object.defineProperty(activeEvent, 'currentTarget', { value:
|
|
8
|
-
else activeEvent.currentTarget =
|
|
6
|
+
if (srcElem) {
|
|
7
|
+
if (Object.defineProperty) Object.defineProperty(activeEvent, 'currentTarget', { value: srcElem });
|
|
8
|
+
else activeEvent.currentTarget = srcElem;
|
|
9
9
|
}
|
|
10
10
|
activeEvent = dispatch(target, activeEvent);
|
|
11
11
|
return activeEvent && !activeEvent.defaultPrevented;
|
package/coms/zimoli/button.js
CHANGED
|
@@ -16,7 +16,25 @@ var active = function () {
|
|
|
16
16
|
__addClass(this, "hover active");
|
|
17
17
|
};
|
|
18
18
|
var checkclick = function () {
|
|
19
|
-
if (this.hasAttribute("disabled") || this.disabled || this.hasAttribute("loading") || this.loading || this.hasAttribute("pending") || this.pending)
|
|
19
|
+
if (this.hasAttribute("disabled") || this.disabled || this.hasAttribute("loading") || this.loading || this.hasAttribute("pending") || this.pending) {
|
|
20
|
+
onclick.preventClick = true;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (this.hasAttribute("confirm") || this.confirm) {
|
|
24
|
+
if (!this.confirm_sign) {
|
|
25
|
+
addClass(this, 'confirm');
|
|
26
|
+
var that = this;
|
|
27
|
+
that.confirm_sign = true;
|
|
28
|
+
setTimeout(function () {
|
|
29
|
+
removeClass(that, "confirm");
|
|
30
|
+
delete that.confirm_sign;
|
|
31
|
+
}, 2000);
|
|
32
|
+
onclick.preventClick = true;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
delete this.confirm_sign;
|
|
36
|
+
removeClass(this, "confirm");
|
|
37
|
+
}
|
|
20
38
|
};
|
|
21
39
|
var resetactive = function () {
|
|
22
40
|
removeClass(this, "active");
|
package/coms/zimoli/button.less
CHANGED
package/coms/zimoli/encode62.js
CHANGED
|
@@ -29,7 +29,9 @@ var encode62 = {
|
|
|
29
29
|
timeencode(string) {
|
|
30
30
|
var { time_delta } = this;
|
|
31
31
|
var time_free = time_delta / 6 | 0;
|
|
32
|
-
var
|
|
32
|
+
var time = +new Date;
|
|
33
|
+
time = time - time % (time_delta >> 2);
|
|
34
|
+
var time_stamp = time - time_free;
|
|
33
35
|
var time_rest = time_stamp % time_delta;
|
|
34
36
|
var time_rest_str = time_rest.toString(36);
|
|
35
37
|
var time_delta_str = time_delta.toString(36);
|
|
@@ -39,9 +41,10 @@ var encode62 = {
|
|
|
39
41
|
timeupdate(string) {
|
|
40
42
|
var { time_delta } = this;
|
|
41
43
|
var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
|
|
42
|
-
var
|
|
44
|
+
var time = +new Date;
|
|
45
|
+
var time_start = parseInt((time - parseInt(time_rest, 36)) / time_delta) * time_delta;
|
|
43
46
|
var time_stamp = time_start + parseInt(time_rest, 36);
|
|
44
|
-
if (time_stamp + (time_delta >> 1) >
|
|
47
|
+
if (time_stamp + (time_delta >> 1) > time) {
|
|
45
48
|
return string;
|
|
46
49
|
} else {
|
|
47
50
|
return this.timeencode(this.timedecode(string));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var _slider = createElement(div);
|
|
3
3
|
var getGenerator = function (container, tagName = 'item') {
|
|
4
4
|
if (!container) return;
|
|
5
|
-
if (
|
|
5
|
+
if (container.$generator) return container.$generator;
|
|
6
6
|
var template = document.createElement(tagName);
|
|
7
7
|
var templates = [].concat.apply([], container.childNodes).filter(a => {
|
|
8
8
|
if (a.hasAttribute('insert')) {
|
package/coms/zimoli/menu.js
CHANGED
|
@@ -154,14 +154,24 @@ function main(elem, mode) {
|
|
|
154
154
|
case "y":
|
|
155
155
|
case "vertical":
|
|
156
156
|
var emit = function (item, target) {
|
|
157
|
-
active(elem, item, item
|
|
157
|
+
active(elem, item.value, item, target);
|
|
158
158
|
};
|
|
159
159
|
if ("$src" in elem) {
|
|
160
160
|
getGenerator(elem, 'menu-item');
|
|
161
|
-
|
|
162
|
-
menuList(elem, getTreeFromData(src), emit, direction);
|
|
161
|
+
on("append")(elem, function () {
|
|
163
162
|
elem.registerAsRoot();
|
|
164
163
|
});
|
|
164
|
+
var src0 = [];
|
|
165
|
+
menuList(elem, src0, emit, direction);
|
|
166
|
+
care(elem, function (src) {
|
|
167
|
+
src0.splice(0, src0.length);
|
|
168
|
+
var s = getTreeFromData(src);
|
|
169
|
+
var i = 0;
|
|
170
|
+
while (i < s.length) {
|
|
171
|
+
src0.push.apply(src0, s.slice(i, i += 1000));
|
|
172
|
+
}
|
|
173
|
+
elem.go(0);
|
|
174
|
+
});
|
|
165
175
|
}
|
|
166
176
|
else {
|
|
167
177
|
var nodes = getArrayNodes(elem);
|
package/coms/zimoli/menuList.js
CHANGED
|
@@ -275,7 +275,6 @@ function main(page, items, active, direction = 'y') {
|
|
|
275
275
|
var className = `{'has-children':${itemName}.children&&${itemName}.children.length,'warn':${itemName}.type==='danger'||${itemName}.type==='warn'||${itemName}.type==='red'}`;
|
|
276
276
|
var notHidden = `!${itemName}.hidden`;
|
|
277
277
|
var generator = getGenerator(page, 'menu-item');
|
|
278
|
-
|
|
279
278
|
list(page, function (index) {
|
|
280
279
|
var item = items[index];
|
|
281
280
|
if (!item) return;
|
package/coms/zimoli/picture.js
CHANGED
|
@@ -17,8 +17,15 @@ var getstation = function (n, s) {
|
|
|
17
17
|
return n;
|
|
18
18
|
};
|
|
19
19
|
var _createImage = function (url, callback) {
|
|
20
|
-
var imgpic
|
|
21
|
-
|
|
20
|
+
var imgpic;
|
|
21
|
+
if (url instanceof Image) {
|
|
22
|
+
imgpic = new Image;
|
|
23
|
+
imgpic.src = url.src;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
imgpic = document.createElement('img');
|
|
27
|
+
imgpic.src = url;
|
|
28
|
+
}
|
|
22
29
|
var onload = function () {
|
|
23
30
|
imgpic.onload = null;
|
|
24
31
|
callback(imgpic);
|
|
@@ -393,7 +400,6 @@ function picture(url, to = 0, key) {
|
|
|
393
400
|
var gen = function (index, ratio) {
|
|
394
401
|
if (index >= urls.length || index < 0) return null;
|
|
395
402
|
if (images[index] && images[index].url !== urls[index]) {
|
|
396
|
-
console.log(images[index].url, urls[index]);
|
|
397
403
|
delete images[index];
|
|
398
404
|
}
|
|
399
405
|
if (!images[index]) {
|
package/coms/zimoli/popup.js
CHANGED
|
@@ -152,10 +152,6 @@ var createMask = function (element) {
|
|
|
152
152
|
return mask;
|
|
153
153
|
};
|
|
154
154
|
var popup_with_mask = function (element, mask = createMask(element)) {
|
|
155
|
-
if (!mask.clean) {
|
|
156
|
-
mask.clean = new Cleanup(element.with);
|
|
157
|
-
}
|
|
158
|
-
onremove(element, mask.clean);
|
|
159
155
|
css(element, `z-index:${zIndex()};`);
|
|
160
156
|
if (mask.parentNode) {
|
|
161
157
|
global(element, false);
|
|
@@ -167,6 +163,10 @@ var popup_with_mask = function (element, mask = createMask(element)) {
|
|
|
167
163
|
} else {
|
|
168
164
|
if (element.with !== element) element.with = [element.with, mask];
|
|
169
165
|
}
|
|
166
|
+
if (!mask.clean) {
|
|
167
|
+
mask.clean = new Cleanup(element.with);
|
|
168
|
+
}
|
|
169
|
+
onremove(element, mask.clean);
|
|
170
170
|
if (!element.parentNode) global(element, false);
|
|
171
171
|
return element;
|
|
172
172
|
};
|
package/coms/zimoli/render.js
CHANGED
|
@@ -381,7 +381,7 @@ var src2 = function (search) {
|
|
|
381
381
|
temp = "";
|
|
382
382
|
}
|
|
383
383
|
var changes = getChanges(temp, savedValue);
|
|
384
|
-
if (!changes || isEmpty(origin) && isEmpty(this.src)) return;
|
|
384
|
+
if (!changes || isEmpty(origin) && isEmpty(this.src) && isEmpty(savedValue)) return;
|
|
385
385
|
savedValue = temp;
|
|
386
386
|
this.src = origin;
|
|
387
387
|
cast(this, origin);
|