efront 3.35.12 → 3.35.14

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.
@@ -60,6 +60,7 @@
60
60
  >group {
61
61
 
62
62
  >padding {
63
+ margin-bottom: 12px;
63
64
  width: 33.3333%;
64
65
  line-height: 40px;
65
66
  font-size: 24px;
@@ -34,7 +34,7 @@ if (!Promise) {
34
34
  if (t.ohed) {
35
35
  var throwed = t.throwed;
36
36
  t.throwed = true;
37
- if (!throwed && PromiseRejectReactions.length) {
37
+ if (!throwed && !PromiseRejectReactions.length) {
38
38
  // <!--
39
39
  console.warn("在异步过程中发现未处理的异常:", t.ohed[0], t.ohed[1], t.ohed[2]);
40
40
  // -->
@@ -0,0 +1,19 @@
1
+ var Promise0 = window.Promise;
2
+ delete modules.Promise;
3
+ window.Promise = null;
4
+ var Promise1 = await init("Promise")
5
+ window.Promise = Promise0;
6
+ async function testCatch(Promise) {
7
+ console.log(Promise.toString().slice(0, 30), 'then')
8
+ try {
9
+ await Promise.reject(1).then(function () { }, function () {
10
+ console.log('catch1');
11
+ }).then(null, function () {
12
+ console.log("catch2");
13
+ });
14
+ } catch (e) {
15
+ console.log(e)
16
+ }
17
+ }
18
+ await testCatch(Promise0);
19
+ await testCatch(Promise1);
@@ -73,9 +73,9 @@ var keywords = [js_keywords, c_java_go_python, others].join("|").trim().split(/[
73
73
  keywords = new RegExp(`^(${keywords})$`, 'i');
74
74
  var source = `abcdefghijklmnopqrstuvwxyz`;
75
75
  source += source.toUpperCase() + "_$";
76
- var number = source + '0123456789';
77
- // source += "ªµºΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψω";
78
- source += function () {
76
+ var number = '0123456789' + source;
77
+ var counts;
78
+ var source_addition = function () {
79
79
  var reg = /\xAA\xB5\xBA\xC0-\xD5\xD8-\xF2\xF8-\u02AF\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0621-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA/;
80
80
  var dist = [];
81
81
  reg.source.replace(/\\[xu]([0-9a-f]+)(?:\-\\[xu]([0-9a-f]+))?/ig, function (_, a, b) {
@@ -89,14 +89,18 @@ source += function () {
89
89
  });
90
90
  return String.fromCharCode.apply(String, dist);
91
91
  }();
92
- var source_length = source.length;
93
- var counts = [
94
- source_length,
95
- source_length * 64,
96
- source_length * 64 * 64,
97
- source_length * 64 * 64 * 64,
98
- source_length * 64 * 64 * 64 * 64
99
- ];
92
+ var makeSource = function (qjs) {
93
+ if (!qjs) source = number.slice(10) + source_addition;
94
+ var source_length = source.length;
95
+ counts = [
96
+ source_length,
97
+ source_length * 64,
98
+ source_length * 64 * 64,
99
+ source_length * 64 * 64 * 64,
100
+ source_length * 64 * 64 * 64 * 64
101
+ ];
102
+ };
103
+ makeSource(true);
100
104
  function create(n, length) {
101
105
  var rest = [];
102
106
  while (length > 0) {
@@ -151,4 +155,8 @@ function namelist(count, prevent, skip) {
151
155
  dist.skip = skip0;
152
156
  return dist;
153
157
  }
158
+ namelist.makeSource = function (sciter = false) {
159
+ makeSource(sciter);
160
+ makeSource = function () { };
161
+ };
154
162
  module.exports = namelist;
@@ -18,7 +18,11 @@ function main(title, { submit }, { data: origin, fields, }) {
18
18
  });
19
19
  on('submit')(page, async function (e) {
20
20
  e.preventDefault();
21
- await submit(item, fields, origin);
21
+ var res = await submit(item, fields, origin);
22
+ if (typeof res === 'string') {
23
+ return alert(res, 'error');
24
+ }
25
+ if (res === false) return;
22
26
  dispatch(this, 'submited');
23
27
  remove(this);
24
28
  });
@@ -1,4 +1,19 @@
1
+ :active>& {
2
+ &:after {
3
+ width: 300px;
4
+ height: 140px;
5
+ margin: -150x -70px;
6
+ }
7
+
8
+ &:before {
9
+ width: 160px;
10
+ height: 180px;
11
+ margin: -80px -90px;
12
+ }
13
+ }
14
+
1
15
  & {
16
+ z-index: 1;
2
17
  border: 1px solid rgba(0, 0, 0, .1);
3
18
  border-radius: inherit;
4
19
  position: absolute;
@@ -30,5 +45,7 @@
30
45
  background-color: #2873;
31
46
  position: absolute;
32
47
  border-radius: 50%;
48
+ backdrop-filter: invert(1);
49
+ transition: all .2s;
33
50
  }
34
51
  }
@@ -6,17 +6,17 @@
6
6
  white-space: nowrap;
7
7
  overflow: hidden;
8
8
  text-overflow: ellipsis;
9
- background: #101216;
9
+ background: #202226;
10
10
  color: #fffc;
11
11
 
12
12
  border: 2px solid transparent;
13
13
 
14
14
  &:hover {
15
- border-color: #276;
15
+ border-color: #acb;
16
16
  }
17
17
 
18
18
  &:active {
19
- border-color: #253;
19
+ border-color: #ccc;
20
20
  }
21
21
  }
22
22
 
@@ -714,6 +714,8 @@ var unbindInstance = function (instanceId, callback) {
714
714
  delete instanceListenerMap[instanceId];
715
715
  }
716
716
  };
717
+ var OUTDATE = new Error("请求被覆盖");
718
+ var ABORTED = new Error("请求已取消");
717
719
  var data = {
718
720
  decodeStructure,
719
721
  encodeStructure,
@@ -938,8 +940,6 @@ var data = {
938
940
  return instance;
939
941
  }
940
942
  }
941
- var outdate = new Error("request outdate.");
942
- var aborted = new Error("request aborted.");
943
943
  this.responseLoading(instance);
944
944
  promise1 = instance.loading_promise = new Promise(function (ok) {
945
945
  if (!instance.loading) {
@@ -947,15 +947,15 @@ var data = {
947
947
  }
948
948
  setTimeout(ok, timeout);
949
949
  }).then(function () {
950
- if (promise1 !== instance.loading_promise) throw outdate;
950
+ if (promise1 !== instance.loading_promise) throw OUTDATE;
951
951
  return privates.getApi(sid);
952
952
  }).then((api) => {
953
- if (promise1 !== instance.loading_promise) throw outdate;
953
+ if (promise1 !== instance.loading_promise) throw OUTDATE;
954
954
  if (instance.loading) {
955
955
  instance.loading.abort();
956
956
  }
957
957
  var params2 = privates.pack(sid, params1);
958
- if (!privates.validApi(api, params2)) throw aborted;
958
+ if (!privates.validApi(api, params2)) throw ABORTED;
959
959
  let url = api.url;
960
960
  var base = api.base;
961
961
  if (base) url = base + api.path;
@@ -966,11 +966,11 @@ var data = {
966
966
  headers = seekFromSource(headers, api.base);
967
967
  }
968
968
  instance.loading = cross(method, uri, headers).send(params).done(xhr => {
969
- if (instance.loading !== xhr) return oh(aborted);
969
+ if (instance.loading !== xhr) return oh(ABORTED);
970
970
  instance.loading = null;
971
971
  ok(xhr.responseText || xhr.response);
972
972
  }).error(xhr => {
973
- if (instance.loading !== xhr) return oh(aborted);
973
+ if (instance.loading !== xhr) return oh(ABORTED);
974
974
  instance.loading = null;
975
975
  try {
976
976
  var e = getErrorMessage(parseData(xhr.response || xhr.responseText || xhr.statusText || xhr.status));
@@ -984,7 +984,7 @@ var data = {
984
984
  });
985
985
  return promise;
986
986
  }).then((data) => {
987
- if (instance.loading_promise !== promise1) throw aborted;
987
+ if (instance.loading_promise !== promise1) throw ABORTED;
988
988
  if (id) {
989
989
  data = parse instanceof Function ? parse(data) : data;
990
990
  this.setInstance(id, data, false);
@@ -993,10 +993,12 @@ var data = {
993
993
  }
994
994
  this.responseLoaded(instance);
995
995
  return data;
996
+ }).catch(function (e) {
997
+ if (e === OUTDATE || e === ABORTED) return;
998
+ throw e;
996
999
  });
997
1000
  promise1.params = params;
998
1001
  promise1.catch((e) => {
999
- if (e === outdate || e === aborted) return;
1000
1002
  this.responseCrash(e, instance);
1001
1003
  });
1002
1004
 
@@ -618,6 +618,7 @@ function list() {
618
618
  }
619
619
  var savedSrc = [];
620
620
  if (bindSrc === true) care(container, function (src, old) {
621
+ if (container.refresh) return;
621
622
  var index = container.index();
622
623
  if (src !== old) container.clean(), index = 0;
623
624
  else container.clean(src, savedSrc);
@@ -6,7 +6,7 @@
6
6
  </template>
7
7
  <span -html="menu.name" -style="{color:menu.color}"></span>
8
8
  <template -if="typeof menu.hotkey==='string'">
9
- &nbsp;&nbsp; <span class="hotkey" -html="hotkey"></span>
9
+ &nbsp;&nbsp; <span class="hotkey" -html="menu.hotkey"></span>
10
10
  </template>
11
11
  <template -elseif="menu.hotkey?.length">
12
12
  &nbsp;&nbsp; <span ng-repeat="k of menu.hotkey" class="hotkey" ng-html="k"></span>
@@ -184,6 +184,7 @@ function tree() {
184
184
  };
185
185
  com.forEach(z);
186
186
  setState();
187
+ css(banner, { paddingBottom: '' });
187
188
  };
188
189
  var time = size => (Math.log(-size / 30 + 2) * 100 | 0) / 1000;
189
190
  if (com.isClosed() && com.length) {
@@ -198,6 +199,7 @@ function tree() {
198
199
  } else {
199
200
  marginTop = top.offsetTop - bottom.offsetTop - bottom.offsetHeight;
200
201
  }
202
+ css(banner, { paddingBottom: -marginTop });
201
203
  var res = transition(top, {
202
204
  transition: `margin-top ${time(marginTop)}s ease-out`,
203
205
  marginTop: fromOffset(marginTop)
@@ -216,8 +218,10 @@ function tree() {
216
218
  }
217
219
  setState(false);
218
220
  z0();
221
+ var paddingBottom = -margin_top;
222
+ css(banner, { paddingBottom });
219
223
  var res = transition(change_elem, { transition: `margin-top ${time(margin_top)}s ease-out`, marginTop: fromOffset(margin_top) }, false);
220
- timeout(z1, res);
224
+ timeout(z1, res + 60);
221
225
  }
222
226
  });
223
227
 
@@ -240,12 +244,9 @@ function tree() {
240
244
  var index = banner.index();
241
245
  var needremoves = dom.map(d => d.target).filter(d => !!d);
242
246
  dom = getArrayFromTree(root, true);
243
- needremoves.forEach(_div => {
244
- delete _div.initialStyle;
245
- css(_div, "transition:;margin-top:;");
246
- });
247
- remove(needremoves);
247
+ remove(needremoves, false);
248
248
  banner.go(index || 0);
249
+ css(banner, { paddingBottom: '' });
249
250
  };
250
251
  banner.refresh = refresh;
251
252
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.35.12",
3
+ "version": "3.35.14",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {