efront 2.46.0 → 2.47.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.
- package/coms/basic/parseURL.js +2 -2
- package/coms/basic/parseURL_test.js +7 -0
- package/coms/basic/refilm_decode.js +32 -11
- package/coms/crypt/encode62.js +38 -29
- package/coms/crypt/encode62_test.js +2 -1
- package/coms/zimoli/action.js +1 -2
- package/coms/zimoli/autodragchildren.js +3 -3
- package/coms/zimoli/button.less +1 -2
- package/coms/zimoli/contextmenu.js +13 -8
- package/coms/zimoli/cross.js +3 -3
- package/coms/zimoli/data.js +19 -9
- package/coms/zimoli/dispatch.js +13 -6
- package/coms/zimoli/encode62.js +3 -2
- package/coms/zimoli/field.js +1 -1
- package/coms/zimoli/input.js +0 -6
- package/coms/zimoli/input.less +6 -6
- package/coms/zimoli/menuList.html +3 -2
- package/coms/zimoli/menuList.less +29 -25
- package/coms/zimoli/model.js +43 -6
- package/coms/zimoli/popup.js +15 -10
- package/coms/zimoli/prompt.js +40 -0
- package/coms/zimoli/render.js +23 -13
- package/coms/zimoli/rootElements.js +1 -0
- package/coms/zimoli/search.js +15 -0
- package/coms/zimoli/select.js +26 -12
- package/coms/zimoli/selectList.js +68 -8
- package/coms/zimoli/selectList.less +15 -2
- package/coms/zimoli/selectListEdit.html +15 -0
- package/coms/zimoli/selectListEdit.js +68 -0
- package/coms/zimoli/selectListEdit.less +21 -0
- package/coms/zimoli/swap.less +1 -1
- package/coms/zimoli/table.html +6 -4
- package/coms/zimoli/table.js +62 -10
- package/coms/zimoli/table.less +3 -1
- package/coms/zimoli/textarea.less +0 -1
- package/coms/zimoli/zimoli.js +34 -6
- package/debug.log +2 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/basic/parseURL.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// -------/// ---------------1-------------//////////////2---3--------//////// ----4----2/////5-----------------------6
|
|
2
|
-
var reg = /^([
|
|
1
|
+
// -------/// ---------------1-------------//////////////2---3--------//////// ----4----2/////5-----------------------6-----------------------//////////////-7--5///8----9----//10--11---10///--12-----8//
|
|
2
|
+
var reg = /^([^\:\/\?#\[]+\:(?![^\:\/\?\#]*@))?(?:\/\/)?(?:(([^\:\/\?#]+)?(?:\:([^\/\?#]+))?)@)?(([^\/@\:\?\#]*(?:[^\d\@\:\/\?#]|\.)[^\/@\?\#]*?)?(?:(?:\:|^)(\d+))?)((\/[^\?#]*)?(\?([^#]*))?(#[\s\S]*)?)$/;
|
|
3
3
|
function parseURL(url) {
|
|
4
4
|
if (url === undefined || url === null) url = '';
|
|
5
5
|
var [__, protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash] = reg.exec(url);
|
|
@@ -30,3 +30,10 @@ test('?80', 'path', '?80')
|
|
|
30
30
|
test('?80', 'search', '?80')
|
|
31
31
|
test('?80', 'query', '80')
|
|
32
32
|
test('#?80', 'hash', '#?80')
|
|
33
|
+
test("http://[fe80::caa:a647:ef1d:b4db]/", "host", "[fe80::caa:a647:ef1d:b4db]")
|
|
34
|
+
test("http://[::1]/", "host", "[::1]")
|
|
35
|
+
test("http://[::]/", "host", "[::]")
|
|
36
|
+
test("http://[::%12]/", "host", "[::%12]")
|
|
37
|
+
test("http://[::]:80/", "hostname", "[::]")
|
|
38
|
+
test("[::]:80/", "hostname", "[::]")
|
|
39
|
+
test("[fd64:f52:f52:f52:f52:f52:f52:97]", "hostname", "[fd64:f52:f52:f52:f52:f52:f52:97]")
|
|
@@ -260,16 +260,31 @@ function parse(piece) {
|
|
|
260
260
|
}
|
|
261
261
|
var [name, type, options] = piece, key, repeat;
|
|
262
262
|
if (piece.length === 1 && isObject(name)) {
|
|
263
|
-
var {
|
|
263
|
+
var {
|
|
264
|
+
name, type, key, value, comment, options,
|
|
265
|
+
size, unit, ratio,
|
|
266
|
+
needs, checks, repeat, endwith,
|
|
267
|
+
required, inlist, hidden, readonly,
|
|
268
|
+
delete_onempty, delete_onsubmit,
|
|
269
|
+
} = name;
|
|
264
270
|
} else {
|
|
265
|
-
var
|
|
266
|
-
if (
|
|
267
|
-
|
|
268
|
-
return a.replace(/^\*|\*$/, '');
|
|
271
|
+
var test = (reg,a) => {
|
|
272
|
+
if (reg.test(a)) {
|
|
273
|
+
return true;
|
|
269
274
|
}
|
|
270
|
-
return a;
|
|
271
275
|
};
|
|
272
|
-
|
|
276
|
+
var is = function (a) {
|
|
277
|
+
var reg = /^[\*\+\-\!\-\$&\?\~]|[\*\+\-\!\-\$&\?\~]$/;
|
|
278
|
+
if (!reg.test(a)) return a;
|
|
279
|
+
required = test(/^\*|\*$/, a);
|
|
280
|
+
inlist = test(/^[\+\!]|[\+\!]$/, a);
|
|
281
|
+
hidden = test(/^\-|\-$/, a);
|
|
282
|
+
readonly = test(/^[\$&]|[\$&]$/, a);
|
|
283
|
+
delete_onempty = test(/^\?|\?$/, a);
|
|
284
|
+
delete_onsubmit = test(/^\~|\~$/, a);
|
|
285
|
+
return a.replace(reg, '');
|
|
286
|
+
};
|
|
287
|
+
type = is(type);
|
|
273
288
|
if (typeof name === 'string') {
|
|
274
289
|
if (!isContainer) {
|
|
275
290
|
if (!type) {
|
|
@@ -370,17 +385,23 @@ function parse(piece) {
|
|
|
370
385
|
type = type.slice(1);
|
|
371
386
|
}
|
|
372
387
|
if (typeof options === "string") {
|
|
373
|
-
options =
|
|
388
|
+
options = is(options);
|
|
374
389
|
var needUnfold = /^\[|\]$/.test(options);
|
|
375
390
|
options = options.replace(/^\[|\]$/g, '');
|
|
376
391
|
if (/,/.test(options)) options = scanSlant(options, ',');
|
|
377
392
|
else options = scanSlant(options, "");
|
|
378
393
|
if (needUnfold) unfoldOptions(size, options);
|
|
379
394
|
}
|
|
380
|
-
name =
|
|
381
|
-
key =
|
|
395
|
+
name = is(name);
|
|
396
|
+
key = is(key);
|
|
382
397
|
}
|
|
383
|
-
var field = {
|
|
398
|
+
var field = {
|
|
399
|
+
name, type, key, value, comment, options,
|
|
400
|
+
size, unit, ratio,
|
|
401
|
+
needs, checks, repeat, endwith,
|
|
402
|
+
required, inlist, hidden, readonly,
|
|
403
|
+
delete_onempty, delete_onsubmit,
|
|
404
|
+
};
|
|
384
405
|
var parent = piecepath[piecepath.length - 1];
|
|
385
406
|
if (parent) {
|
|
386
407
|
field.parent = parent;
|
package/coms/crypt/encode62.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
module.exports = encode62;
|
|
3
|
+
var encodeUTF8 = require("../basic/encodeUTF8");
|
|
4
|
+
var decodeUTF8 = require("../basic/decodeUTF8");
|
|
3
5
|
var src = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4
6
|
var map = {};
|
|
5
7
|
src.split("").forEach((s, i) => map[s] = i);
|
|
@@ -7,7 +9,7 @@ src.split("").forEach((s, i) => map[s] = i);
|
|
|
7
9
|
function encode62(string) {
|
|
8
10
|
string = String(string)
|
|
9
11
|
string = string.length + string + "2017-08-19";
|
|
10
|
-
var buff =
|
|
12
|
+
var buff = src.split('');
|
|
11
13
|
for (var cx = 0, dx = buff.length + src.length, sl = string.length, cl = buff.length; cx < dx; cx++) {
|
|
12
14
|
var s1 = string.charCodeAt(cx % sl) % cl;
|
|
13
15
|
var s2 = cx % cl;
|
|
@@ -15,7 +17,7 @@ function encode62(string) {
|
|
|
15
17
|
buff[s1] = buff[s2];
|
|
16
18
|
buff[s2] = btemp;
|
|
17
19
|
}
|
|
18
|
-
return buff.
|
|
20
|
+
return buff.join('');
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
|
|
@@ -31,13 +33,29 @@ Object.assign(encode62, {
|
|
|
31
33
|
var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
|
|
32
34
|
var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
|
|
33
35
|
var time_stamp = time_start + parseInt(time_rest, 36);
|
|
34
|
-
|
|
36
|
+
string = this.decode62(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36)).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
|
|
37
|
+
return decodeURIComponent(string);
|
|
35
38
|
},
|
|
36
39
|
timeencode(string) {
|
|
37
40
|
var { time_delta } = this;
|
|
38
|
-
var
|
|
41
|
+
var time_free = time_delta / 6 | 0;
|
|
42
|
+
var time_stamp = +new Date() - time_free;
|
|
39
43
|
var time_rest = time_stamp % time_delta;
|
|
40
|
-
|
|
44
|
+
var time_rest_str = time_rest.toString(36);
|
|
45
|
+
var time_delta_str = time_delta.toString(36);
|
|
46
|
+
string = encodeURIComponent(string).replace(/\./g, '..').replace(/%/g, '.');
|
|
47
|
+
return this.encode62(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
|
|
48
|
+
},
|
|
49
|
+
timeupdate(string) {
|
|
50
|
+
var { time_delta } = this;
|
|
51
|
+
var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
|
|
52
|
+
var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
|
|
53
|
+
var time_stamp = time_start + parseInt(time_rest, 36);
|
|
54
|
+
if (time_stamp + (time_delta >> 1) > +new Date()) {
|
|
55
|
+
return string;
|
|
56
|
+
} else {
|
|
57
|
+
return this.timeencode(this.timedecode(string));
|
|
58
|
+
}
|
|
41
59
|
},
|
|
42
60
|
encode62(data, sign) {
|
|
43
61
|
if (!sign) return data;
|
|
@@ -53,14 +71,19 @@ Object.assign(encode62, {
|
|
|
53
71
|
});
|
|
54
72
|
return result;
|
|
55
73
|
},
|
|
56
|
-
|
|
74
|
+
encodestr(data, sign) {
|
|
57
75
|
if (!sign) return data;
|
|
58
|
-
var result =
|
|
76
|
+
var result = encodeUTF8(data);
|
|
59
77
|
sign = Buffer.from(sign);
|
|
78
|
+
var delta = 0, c = 0;
|
|
60
79
|
for (var cx = 0, dx = data.length; cx < dx; cx++) {
|
|
61
|
-
result[cx] = result[cx] ^ sign[cx % sign.length];
|
|
80
|
+
if (result[cx] < 128) result[cx] = result[cx] ^ sign[cx % sign.length];
|
|
81
|
+
else if (result[cx] < 192) {
|
|
82
|
+
var c = c << 8 | sign[(delta += 6) / 8 % sign.length | 0];
|
|
83
|
+
result[cx] = result[cx] ^ (c >> 8 - delta % 8 & 0x3f);
|
|
84
|
+
}
|
|
62
85
|
}
|
|
63
|
-
return result;
|
|
86
|
+
return decodeUTF8(result);
|
|
64
87
|
},
|
|
65
88
|
decode(data, sign) {
|
|
66
89
|
if (!sign) return data;
|
|
@@ -75,7 +98,7 @@ Object.assign(encode62, {
|
|
|
75
98
|
return encode62(string);
|
|
76
99
|
},
|
|
77
100
|
genb() {
|
|
78
|
-
return encode62(Date.now() + "" + Math.random());
|
|
101
|
+
return encode62(Date.now() * Math.random() + "" + Math.random().toString(36) + Math.random().toString(36).toUpperCase());
|
|
79
102
|
},
|
|
80
103
|
huan(x, y) {
|
|
81
104
|
return x.split("").map(s => y[map[s]]).join("");
|
|
@@ -90,24 +113,10 @@ Object.assign(encode62, {
|
|
|
90
113
|
y.split("").forEach((a, j) => y_map[a] = j);
|
|
91
114
|
return z.split("").map(c => src[y_map[c]]).join("");
|
|
92
115
|
},
|
|
93
|
-
ab2c(a, b) {
|
|
94
|
-
return this.huan(a, b);
|
|
95
|
-
},
|
|
96
|
-
ba2d(a, b) {
|
|
97
|
-
return this.huan(b, a);
|
|
98
|
-
},
|
|
99
|
-
ca2b(c, a) {
|
|
100
|
-
return this.yuan(c, a);
|
|
101
|
-
},
|
|
102
|
-
cb2a(c, b) {
|
|
103
|
-
return this.suan(c, b);
|
|
104
|
-
},
|
|
105
|
-
da2b(d, a) {
|
|
106
|
-
return this.suan(d, a);
|
|
107
|
-
},
|
|
108
|
-
db2a(d, b) {
|
|
109
|
-
return this.yuan(d, b);
|
|
110
|
-
}
|
|
111
116
|
});
|
|
112
|
-
|
|
117
|
+
encode62.ab2c = encode62.ba2d = encode62.huan;
|
|
118
|
+
encode62.db2a = encode62.ca2b = encode62.yuan;
|
|
119
|
+
encode62.da2b = encode62.cb2a = encode62.suan;
|
|
120
|
+
encode62.decodestr = encode62.encodestr;
|
|
121
|
+
encode62.encode = encode62.decode;
|
|
113
122
|
encode62.decode62 = encode62.encode62;
|
package/coms/zimoli/action.js
CHANGED
|
@@ -3,8 +3,7 @@ function main(config, item, params) {
|
|
|
3
3
|
if (!config) return ok();
|
|
4
4
|
if (isObject(config)) {
|
|
5
5
|
if (config.do instanceof Function) {
|
|
6
|
-
config.do();
|
|
7
|
-
return;
|
|
6
|
+
return ok(config.do(item, params));
|
|
8
7
|
}
|
|
9
8
|
if (config.modal) {
|
|
10
9
|
var path = isString(config.modal) ? config.modal : config.modal.path;
|
|
@@ -152,7 +152,7 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
152
152
|
saved_opacity = targetBox.style.opacity;
|
|
153
153
|
rebuildTargets = function () { };
|
|
154
154
|
[moveMargin, moveChildren, scroll] = getMoveFuncs(targetChild);
|
|
155
|
-
moveChildren = moveChildren.bind(null,
|
|
155
|
+
moveChildren = moveChildren.bind(null, that, previousElements, followedElements, moveMargin, recover);
|
|
156
156
|
} else {
|
|
157
157
|
previousElements = [];
|
|
158
158
|
followedElements = [];
|
|
@@ -176,7 +176,7 @@ var hooka = function (matcher, move, event, targetChild, isMovingSource) {
|
|
|
176
176
|
previousElements = [].slice.call(targetBox.children, 0).reverse();
|
|
177
177
|
followedElements = [];
|
|
178
178
|
[moveMargin, moveChildren, scroll] = getMoveFuncs(previousElements[0]);
|
|
179
|
-
moveChildren = moveChildren.bind(null,
|
|
179
|
+
moveChildren = moveChildren.bind(null, that, previousElements, followedElements, moveMargin, recover);
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
};
|
|
@@ -337,7 +337,7 @@ function addhook() {
|
|
|
337
337
|
}
|
|
338
338
|
if (!mousedownEvent) return;
|
|
339
339
|
var target = targetElement || mousedownEvent.currentTarget;
|
|
340
|
-
hooka(function (target) {
|
|
340
|
+
hooka.call(targetElement, function (target) {
|
|
341
341
|
var res = [].filter.call(allowdrops || (matcher ? matcher(target) : document.querySelectorAll("[allowdrop]")), function (child) {
|
|
342
342
|
return target && overlap(child, target);
|
|
343
343
|
}).filter(e => {
|
package/coms/zimoli/button.less
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
display: inline-block;
|
|
15
15
|
white-space: nowrap;
|
|
16
16
|
text-align: center;
|
|
17
|
-
// cursor: default;
|
|
18
17
|
overflow: hidden;
|
|
19
18
|
outline: none;
|
|
19
|
+
user-select: none;
|
|
20
20
|
}
|
|
21
21
|
>.label{
|
|
22
22
|
position: relative;
|
|
@@ -177,7 +177,6 @@
|
|
|
177
177
|
|
|
178
178
|
a&,
|
|
179
179
|
&[type$=anchor] {
|
|
180
|
-
padding: 0;
|
|
181
180
|
box-shadow: none;
|
|
182
181
|
text-shadow: none;
|
|
183
182
|
background: none;
|
|
@@ -3,23 +3,28 @@ var createMenu = function (event, items) {
|
|
|
3
3
|
var menulist = sampleElement.cloneNode();
|
|
4
4
|
menulist.setAttribute("mode", "v");
|
|
5
5
|
menulist.tabIndex = 0;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (
|
|
6
|
+
items = items.filter(item => {
|
|
7
|
+
if (!item.when) return true;
|
|
8
|
+
if (!item.when(event)) return false;
|
|
9
|
+
return true;
|
|
10
|
+
});
|
|
11
|
+
var elem = menuList(menulist, items, async function (item) {
|
|
12
|
+
if (await action.call(this, item, event.target) !== false) {
|
|
9
13
|
remove(elem);
|
|
10
14
|
}
|
|
11
15
|
});
|
|
12
16
|
|
|
13
17
|
return elem;
|
|
14
18
|
}
|
|
15
|
-
function contextmenu(target,
|
|
19
|
+
function contextmenu(target, menuItems) {
|
|
16
20
|
on("contextmenu")(target, function (event) {
|
|
17
21
|
event.preventDefault();
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
var menu;
|
|
23
|
+
if (menuItems instanceof Function) {
|
|
24
|
+
menu = menuItems.call(this, event);
|
|
20
25
|
}
|
|
21
|
-
if (
|
|
22
|
-
menu = createMenu.call(this, event,
|
|
26
|
+
if (menuItems instanceof Array) {
|
|
27
|
+
menu = createMenu.call(this, event, menuItems);
|
|
23
28
|
}
|
|
24
29
|
if (!menu) return;
|
|
25
30
|
css(menu, {
|
package/coms/zimoli/cross.js
CHANGED
|
@@ -175,8 +175,8 @@ function cross(method, url, headers) {
|
|
|
175
175
|
onerror({ status: "网络断开" });
|
|
176
176
|
break;
|
|
177
177
|
}
|
|
178
|
-
if (!
|
|
179
|
-
onerror({ status: "
|
|
178
|
+
if (!xhr.response) {
|
|
179
|
+
onerror({ status: "无法访问服务器" });
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
182
182
|
case 200:
|
|
@@ -268,7 +268,7 @@ function cross(method, url, headers) {
|
|
|
268
268
|
var then = xhr.then;
|
|
269
269
|
delete xhr.then;
|
|
270
270
|
if (loaded) onloads.splice(0, onloads.length).map(e => e instanceof Function && e(xhr));
|
|
271
|
-
if (errored) onerrors.splice(0, onerrors.length).map(e => e instanceof Function && e(
|
|
271
|
+
if (errored) onerrors.splice(0, onerrors.length).map(e => e instanceof Function && e(errored));
|
|
272
272
|
xhr.then = then;
|
|
273
273
|
};
|
|
274
274
|
var onloads = [], onerrors = [];
|
package/coms/zimoli/data.js
CHANGED
|
@@ -333,25 +333,23 @@ function fixApi(api, href) {
|
|
|
333
333
|
}
|
|
334
334
|
api.base = href;
|
|
335
335
|
api.path = api.url;
|
|
336
|
-
if (/^\.([\?\#][\s\S]*)?$/.test(api.
|
|
337
|
-
api.
|
|
338
|
-
} else {
|
|
339
|
-
api.url = href + api.url;
|
|
336
|
+
if (/^\.([\?\#][\s\S]*)?$/.test(api.path)) {
|
|
337
|
+
api.path = api.path.replace(/^\./, "");
|
|
340
338
|
}
|
|
341
339
|
if (extraSearch || extraHash) {
|
|
342
340
|
if (/[\?#]/.test(api.url)) {
|
|
343
341
|
var [, search, hash] = paramReg.exec(api.url);
|
|
344
342
|
}
|
|
345
|
-
var
|
|
343
|
+
var path = api.path.replace(paramReg, '');
|
|
346
344
|
if (extraSearch) {
|
|
347
345
|
search = search ? extraSearch + '&' + search : extraSearch;
|
|
348
346
|
}
|
|
349
347
|
if (extraHash) {
|
|
350
348
|
hash = hash ? extraHash + '&' + hash : extraHash;
|
|
351
349
|
}
|
|
352
|
-
if (search)
|
|
353
|
-
if (hash)
|
|
354
|
-
api.
|
|
350
|
+
if (search) path += '?' + search;
|
|
351
|
+
if (hash) path += "#" + hash;
|
|
352
|
+
api.path = path;
|
|
355
353
|
}
|
|
356
354
|
}
|
|
357
355
|
}
|
|
@@ -404,6 +402,12 @@ function createApiMap(data) {
|
|
|
404
402
|
}
|
|
405
403
|
var _configfileurl;
|
|
406
404
|
var configPormise;
|
|
405
|
+
function LoadingArray_then(ok, oh) {
|
|
406
|
+
if (this.loading_promise) this.loading_promise.then(ok, oh);
|
|
407
|
+
else if (this.is_errored) oh(this.error_message);
|
|
408
|
+
else ok();
|
|
409
|
+
}
|
|
410
|
+
|
|
407
411
|
var privates = {
|
|
408
412
|
loadAfterConfig(serviceId, params) {
|
|
409
413
|
var promise = this.getApi(serviceId).then((api) => {
|
|
@@ -434,7 +438,8 @@ var privates = {
|
|
|
434
438
|
},
|
|
435
439
|
fromApi(api, params) {
|
|
436
440
|
let url = api.url;
|
|
437
|
-
|
|
441
|
+
var base = api.base;
|
|
442
|
+
if (base) url = base + api.path;
|
|
438
443
|
if (this.validApi(api, params)) {
|
|
439
444
|
params = this.repare(api, params);
|
|
440
445
|
return this.loadIgnoreConfig(api.method, url, params, api);
|
|
@@ -623,6 +628,7 @@ var data = {
|
|
|
623
628
|
if (isObject(response)) {
|
|
624
629
|
response.is_loaded = true;
|
|
625
630
|
response.is_loading = false;
|
|
631
|
+
if (response.then === LoadingArray_then) delete response.then;
|
|
626
632
|
}
|
|
627
633
|
this.loading_count--;
|
|
628
634
|
},
|
|
@@ -631,6 +637,7 @@ var data = {
|
|
|
631
637
|
if (isObject(response)) {
|
|
632
638
|
response.is_loaded = false;
|
|
633
639
|
response.is_loading = true;
|
|
640
|
+
response.then = LoadingArray_then;
|
|
634
641
|
}
|
|
635
642
|
this.loading_count++;
|
|
636
643
|
},
|
|
@@ -657,6 +664,9 @@ var data = {
|
|
|
657
664
|
data = this.parseConfig(data);
|
|
658
665
|
configPormise = Promise.resolve(data);
|
|
659
666
|
},
|
|
667
|
+
getConfig() {
|
|
668
|
+
return privates.getConfigPromise();
|
|
669
|
+
},
|
|
660
670
|
parseConfig(o) {
|
|
661
671
|
if (o instanceof Promise) {
|
|
662
672
|
return o.then(createApiMap);
|
package/coms/zimoli/dispatch.js
CHANGED
|
@@ -9,15 +9,22 @@ var dispatch = "dispatchEvent" in document ? function dispatchEvent(target, even
|
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
function main() {
|
|
12
|
-
var target, event;
|
|
12
|
+
var target, event, value;
|
|
13
13
|
for (var cx = 0, dx = arguments.length; cx < dx; cx++) {
|
|
14
14
|
var arg = arguments[cx];
|
|
15
|
-
if (
|
|
16
|
-
event = createEvent(arg);
|
|
17
|
-
} else if (isNode(arg) || arg === window || arg === document) {
|
|
15
|
+
if (isNode(arg) || arg === window || arg === document) {
|
|
18
16
|
target = arg;
|
|
19
|
-
}
|
|
20
|
-
|
|
17
|
+
}
|
|
18
|
+
else if (!event) {
|
|
19
|
+
if (isString(arg)) {
|
|
20
|
+
event = createEvent(arg);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
event = arg;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
event.value = arg;
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
30
|
if (dispatch(target || window, event)) {
|
package/coms/zimoli/encode62.js
CHANGED
|
@@ -23,8 +23,8 @@ var encode62 = {
|
|
|
23
23
|
var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
|
|
24
24
|
var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
|
|
25
25
|
var time_stamp = time_start + parseInt(time_rest, 36);
|
|
26
|
-
|
|
27
|
-
return
|
|
26
|
+
string = this.encode(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36)).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
|
|
27
|
+
return decodeURIComponent(string);
|
|
28
28
|
},
|
|
29
29
|
timeencode(string) {
|
|
30
30
|
var { time_delta } = this;
|
|
@@ -33,6 +33,7 @@ var encode62 = {
|
|
|
33
33
|
var time_rest = time_stamp % time_delta;
|
|
34
34
|
var time_rest_str = time_rest.toString(36);
|
|
35
35
|
var time_delta_str = time_delta.toString(36);
|
|
36
|
+
string = encodeURIComponent(string).replace(/\./g, '..').replace(/%/g, '.');
|
|
36
37
|
return this.encode(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
|
|
37
38
|
},
|
|
38
39
|
timeupdate(string) {
|
package/coms/zimoli/field.js
CHANGED
package/coms/zimoli/input.js
CHANGED
|
@@ -66,12 +66,6 @@ function input(element) {
|
|
|
66
66
|
on("keydown")(element, number);
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
if (format) {
|
|
70
|
-
var picker = selectDate(format, input.value);
|
|
71
|
-
on("change")(element, picker.update);
|
|
72
|
-
select(element, picker);
|
|
73
|
-
element.readonly = "readonly";
|
|
74
|
-
}
|
|
75
69
|
}
|
|
76
70
|
return element;
|
|
77
71
|
}
|
package/coms/zimoli/input.less
CHANGED
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
display: none;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
&::-webkit-calendar-picker-indicator {
|
|
34
|
-
|
|
35
|
-
}
|
|
33
|
+
// &::-webkit-calendar-picker-indicator {
|
|
34
|
+
// display: none;
|
|
35
|
+
// }
|
|
36
36
|
|
|
37
|
-
&::-webkit-calendar-picker-indicator:hover {
|
|
38
|
-
|
|
39
|
-
}
|
|
37
|
+
// &::-webkit-calendar-picker-indicator:hover {
|
|
38
|
+
// display: none;
|
|
39
|
+
// }
|
|
40
40
|
|
|
41
41
|
&::-webkit-clear-button {
|
|
42
42
|
display: none;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
<menu-item ng-repeat="menu in menus" ng-
|
|
2
|
-
ng-mouseenter="popTimer=popMenu(menu,event)"
|
|
1
|
+
<menu-item ng-repeat="menu in menus" ng-if="!menu.hidden" ng-click="open(menu,event)"
|
|
2
|
+
ng-mouseleave="clearTimeout(popTimer)" ng-mouseenter="popTimer=popMenu(menu,event)"
|
|
3
|
+
ng-class="{'has-children':menu.children&&menu.children.length,'warn':menu.type==='danger'||menu.type==='warn'||menu.type==='red'}">
|
|
3
4
|
</menu-item>
|
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
& {
|
|
2
|
-
display
|
|
3
|
-
width
|
|
4
|
-
height
|
|
2
|
+
display: inline-block;
|
|
3
|
+
width: auto;
|
|
4
|
+
height: auto;
|
|
5
5
|
background-color: #fff;
|
|
6
|
-
box-shadow
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
box-shadow: 0 0 20px -6px rgba(0, 0, 0, .1);
|
|
7
|
+
border: 1px solid #0003;
|
|
8
|
+
line-height: 28px;
|
|
9
|
+
padding: 6px 0;
|
|
9
10
|
|
|
10
11
|
>menu-item {
|
|
11
|
-
display
|
|
12
|
-
position
|
|
13
|
-
padding
|
|
14
|
-
border-radius
|
|
12
|
+
display: block;
|
|
13
|
+
position: relative;
|
|
14
|
+
padding: 0 16px;
|
|
15
|
+
border-radius: 0;
|
|
15
16
|
background-color: inherit;
|
|
16
|
-
color
|
|
17
|
-
box-shadow
|
|
18
|
-
text-align
|
|
17
|
+
color: inherit;
|
|
18
|
+
box-shadow: none;
|
|
19
|
+
text-align: inherit;
|
|
20
|
+
&.warn{
|
|
21
|
+
color: #c28;
|
|
22
|
+
}
|
|
19
23
|
|
|
20
24
|
&.has-children {
|
|
21
25
|
padding: 0 24px 0 16px;
|
|
22
26
|
|
|
23
27
|
&:after {
|
|
24
|
-
content
|
|
25
|
-
display
|
|
26
|
-
width
|
|
27
|
-
height
|
|
28
|
+
content: ">";
|
|
29
|
+
display: block;
|
|
30
|
+
width: 20px;
|
|
31
|
+
height: 20px;
|
|
28
32
|
line-height: 20px;
|
|
29
|
-
font-size
|
|
30
|
-
transform
|
|
31
|
-
position
|
|
32
|
-
right
|
|
33
|
-
top
|
|
34
|
-
margin-top
|
|
35
|
-
text-align
|
|
33
|
+
font-size: 18px;
|
|
34
|
+
transform: scaleX(.56);
|
|
35
|
+
position: absolute;
|
|
36
|
+
right: 6px;
|
|
37
|
+
top: 50%;
|
|
38
|
+
margin-top: -10px;
|
|
39
|
+
text-align: right;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -41,5 +45,5 @@
|
|
|
41
45
|
|
|
42
46
|
i {
|
|
43
47
|
display: inline-block;
|
|
44
|
-
width
|
|
48
|
+
width: 20px;
|
|
45
49
|
}
|