efront 3.35.12 → 3.35.13

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);
@@ -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
 
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.35.12",
3
+ "version": "3.35.13",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {