efront 4.4.12 → 4.4.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.
Files changed (72) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +884 -65
  2. package/apps/reptile/encode.js +1 -1
  3. package/coms/basic/#loader.js +4 -4
  4. package/coms/basic/BigNumber.js +6 -6
  5. package/coms/basic/BitTree.js +1 -1
  6. package/coms/basic/Enum.js +1 -1
  7. package/coms/basic/Matrix.js +1 -1
  8. package/coms/basic/analyse_test.js +1 -1
  9. package/coms/basic/assert.js +1 -1
  10. package/coms/basic/color.js +1 -1
  11. package/coms/basic/compile.js +1 -1
  12. package/coms/basic/cross_.js +2 -2
  13. package/coms/basic/crypt.js +3 -3
  14. package/coms/basic/decodePack.js +3 -3
  15. package/coms/basic/deepEqual.js +1 -1
  16. package/coms/basic/encodeRange_test.js +1 -1
  17. package/coms/basic/encodeUTF16.js +2 -2
  18. package/coms/basic/encodeUTF8.js +1 -1
  19. package/coms/basic/parseYML.js +2 -2
  20. package/coms/basic/refilm.js +2 -2
  21. package/coms/basic/repeat.js +1 -1
  22. package/coms/basic/submit_.js +4 -4
  23. package/coms/basic_/Array2.js +2 -2
  24. package/coms/basic_/Promise.js +1 -1
  25. package/coms/basic_/exec_.js +1 -1
  26. package/coms/compile/Javascript.js +2 -2
  27. package/coms/compile/Program.js +1 -1
  28. package/coms/compile/common.js +4 -4
  29. package/coms/compile/downLevel.js +5 -5
  30. package/coms/compile/unstruct.js +9 -4
  31. package/coms/compile/unstruct_test.js +2 -1
  32. package/coms/compile/washcode.js +2 -2
  33. package/coms/docs/execute.js +1 -1
  34. package/coms/explorer/Explorer.js +6 -6
  35. package/coms/explorer/context.js +16 -16
  36. package/coms/explorer/deepcp.js +2 -2
  37. package/coms/explorer/edit.html +3 -3
  38. package/coms/frame/chat.html +2 -2
  39. package/coms/frame/route.js +1 -1
  40. package/coms/kugou/parseSongsList.js +1 -1
  41. package/coms/reptile/colored_console.js +8 -2
  42. package/coms/reptile/cross.js +1 -1
  43. package/coms/reptile/decodeHttpResponse.js +1 -1
  44. package/coms/reptile/detectWithExtension.js +1 -1
  45. package/coms/zimoli/Enum.js +1 -1
  46. package/coms/zimoli/api.js +19 -19
  47. package/coms/zimoli/avatarEditor.js +1 -1
  48. package/coms/zimoli/care.js +3 -3
  49. package/coms/zimoli/cast.js +1 -1
  50. package/coms/zimoli/chooseFile.js +2 -2
  51. package/coms/zimoli/clock.js +1 -1
  52. package/coms/zimoli/confirm.js +2 -2
  53. package/coms/zimoli/createElement.js +2 -2
  54. package/coms/zimoli/cross.js +3 -3
  55. package/coms/zimoli/css.js +1 -1
  56. package/coms/zimoli/downloadmap.js +2 -2
  57. package/coms/zimoli/grid.js +4 -4
  58. package/coms/zimoli/icon.js +1 -1
  59. package/coms/zimoli/list.js +1 -1
  60. package/coms/zimoli/mediaDevices.js +1 -1
  61. package/coms/zimoli/menu.js +1 -1
  62. package/coms/zimoli/on.js +3 -3
  63. package/coms/zimoli/overlap_test.js +1 -1
  64. package/coms/zimoli/popup.js +2 -2
  65. package/coms/zimoli/render.js +10 -10
  66. package/coms/zimoli/table.js +1 -1
  67. package/coms/zimoli/watch.js +1 -1
  68. package/coms/zimoli/zimoli.js +3 -3
  69. package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +12 -4
  70. package/package.json +1 -1
  71. package/public/efront.js +1 -1
  72. package/coms/kugou/fxPlayer.js +0 -12474
@@ -209,7 +209,7 @@ var createRepeat = function (search, id = 0) {
209
209
  // throw new Error("repeat is not supported! use list component instead");
210
210
  var expression = search;
211
211
  var repeater = parseRepeat(expression);
212
- if (!repeater) throw new Error(`不能识别循环表达式: ${expression} `);
212
+ if (!repeater) throw new Error(i18n`不能识别循环表达式: ${expression} `);
213
213
  var { srcName, trackBy } = repeater;
214
214
  // 懒渲染
215
215
  var getter = createGetter(this, srcName);
@@ -227,7 +227,7 @@ var createRepeat = function (search, id = 0) {
227
227
  var isArrayResult = result instanceof Array;
228
228
  var keys = isArrayResult ? result.map((_, i) => i) : Object.keys(result);
229
229
  if (keys.length > 600) {
230
- throw new Error("数据量过大,取消绘制!");
230
+ throw new Error(i18n`数据量过大,取消绘制!`);
231
231
  }
232
232
  var $parentScopes = element.$parentScopes || [];
233
233
  var $struct = element.$struct;
@@ -327,7 +327,7 @@ var createIf = function (search, id = 0) {
327
327
  var parseIfWithRepeat = function (ifExpression, repeatExpression) {
328
328
  var repeater = parseRepeat(repeatExpression);
329
329
  if (!repeater) {
330
- throw new Error(`不能识别循环表达式:${repeat}`);
330
+ throw new Error(i18n`不能识别循环表达式: ${repeat}`);
331
331
  }
332
332
  var pair = [];
333
333
  var rest = [], savedIndex = 0;
@@ -359,7 +359,7 @@ var parseIfWithRepeat = function (ifExpression, repeatExpression) {
359
359
  };
360
360
  var inc = 0;
361
361
  while (reg.lastIndex < ifExpression.length) {
362
- if (inc++ > 100) throw new Error("请不要在if表达式中使用太多的条件!");
362
+ if (inc++ > 100) throw new Error(i18n`请不要在if表达式中使用太多的条件!`);
363
363
  if (reg.lastIndex < savedIndex) break;
364
364
  run();
365
365
  }
@@ -423,7 +423,7 @@ var structures = {
423
423
  if (if_top[cx].parent === this.parentNode) break;
424
424
  }
425
425
  if (cx < 0) {
426
- throw new Error("else/elseif前缺少同级if!");
426
+ throw new Error(i18n`else/elseif前缺少同级if!`);
427
427
  }
428
428
  initIf(if_top.splice(cx + 1, if_top.length - cx - 1));
429
429
  var top = if_top[cx];
@@ -757,11 +757,11 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
757
757
  element.$renderid = 0;
758
758
  element.$scope = scope;
759
759
  if (isHandled(parentScopes) && !isArray(parentScopes)) {
760
- throw new Error('父级作用域链应以数组的类型传入');
760
+ throw new Error(i18n`父级作用域链应以数组的类型传入`);
761
761
  }
762
762
  if (parentScopes) {
763
763
  if (element.$renderid && !element.$parentScopes || element.$parentScopes && element.$parentScopes.length !== parentScopes.length) {
764
- throw new Error("父作用域链的长度必须相等着");
764
+ throw new Error(i18n`父作用域链的长度必须相等着`);
765
765
  }
766
766
  }
767
767
  element.$parentScopes = parentScopes || [];
@@ -775,7 +775,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
775
775
  return element;
776
776
  }
777
777
  for (var id of element.$struct.ids) {
778
- if (scope[id] && scope[id] !== element) throw new Error("同一个id不能使用两次:" + id);
778
+ if (scope[id] && scope[id] !== element) throw new Error(i18n`同一个id不能使用两次:` + id);
779
779
  scope[id] = element;
780
780
  }
781
781
  var isFirstRender = !element.$renderid;
@@ -937,11 +937,11 @@ function createStructure(element) {
937
937
  if (element.$renderid <= -2) {
938
938
  if (/^if$|^else/i.test(key)) {
939
939
  if (types.if) {
940
- throw new Error(`暂不支持在同一元素上使用多次if结构!`);
940
+ throw new Error(i18n`暂不支持在同一元素上使用多次if结构!`);
941
941
  }
942
942
  } else {
943
943
  if (types.repeat) {
944
- throw new Error(`暂不支持在同一元素上使用多次repeat类型的属性!`);
944
+ throw new Error(i18n`暂不支持在同一元素上使用多次repeat类型的属性!`);
945
945
  }
946
946
  }
947
947
  }
@@ -471,7 +471,7 @@ function table(elem) {
471
471
  else if (src instanceof Array) {
472
472
  var [fields, data] = src;
473
473
  }
474
- else throw new Error("table组件源数据错误!");
474
+ else throw new Error(i18n`table组件源数据错误!`);
475
475
  if (_vbox) _vbox(), _vbox = null;
476
476
  watch(table, {
477
477
  find(text) {
@@ -21,6 +21,6 @@ function watch(elem, prop, handler) {
21
21
  if (!isFunction(prop[k])) e++;
22
22
  else elem.$watches[k] = prop[k];
23
23
  }
24
- if (e > 0) throw new Error("参数不支持!");
24
+ if (e > 0) throw new Error(i18n`参数不支持!`);
25
25
  }
26
26
  }
@@ -96,7 +96,7 @@ var getZimoliParams = function (pagepath) {
96
96
  try {
97
97
  return JSAM.parse(hostoryStorage.getItem(_zimoli_params_key + pagepath)) || {};
98
98
  } catch (e) {
99
- console.warn("存储空间被破坏");
99
+ console.warn(i18n`存储空间被破坏`);
100
100
  }
101
101
  return {};
102
102
  };
@@ -106,7 +106,7 @@ var setZimoliParams = function (pagepath, args) {
106
106
  if (stringified_args.length === 2) hostoryStorage.removeItem(_zimoli_params_key + pagepath);
107
107
  else hostoryStorage.setItem(_zimoli_params_key + pagepath, stringified_args);
108
108
  } catch (e) {
109
- console.warn("写入存储空间失败!", e);
109
+ console.warn(i18n`写入存储空间失败!`, e);
110
110
  }
111
111
  };
112
112
  var fullfill_is_dispatched = 0;
@@ -391,7 +391,7 @@ function create(pagepath, args, from, needroles) {
391
391
  if (typeof pagepath === 'string') {
392
392
  var page_object = page_generators[pagepath];
393
393
  if (!page_object) {
394
- throw new Error(`调用create前请确保prepare执行完毕:${pagepath}`);
394
+ throw new Error(i18n`调用create前请确保prepare执行完毕:${pagepath}`);
395
395
  }
396
396
  var { pg, "with": _with_elements, state, onback: _pageback_listener, roles } = page_object;
397
397
  }
@@ -340,7 +340,7 @@
340
340
  return compile$translate.getI18nPrefixed(code);
341
341
  }
342
342
  catch (e) {
343
- alert("提取文本时存在异常", "error");
343
+ alert(i18n`提取文本时存在异常`, "error");
344
344
  console.error(e, f.path);
345
345
  return [];
346
346
  }
@@ -356,6 +356,14 @@
356
356
  key: "filter",
357
357
  options: [
358
358
  {
359
+ name: i18n`过滤空串`,
360
+ checked: true,
361
+ test(a) {
362
+ return !!a.fanyi || /\S/.test(a.text);
363
+ }
364
+ },
365
+ {
366
+ disabled: true,
359
367
  name: i18n`只看中文`, key: "cnonly", get checked() {
360
368
  return true;
361
369
  },
@@ -366,7 +374,7 @@
366
374
  return !!a.fanyi || /[\u3400-\ufad9\u{20000}-\u{2a6d6}\u{2fa1d}]/u.test(a.text);
367
375
  }
368
376
  }
369
- ]
377
+ ].filter(a => !a.disabled)
370
378
  };
371
379
  var tableData = [];
372
380
  var runFilter = function () {
@@ -481,7 +489,7 @@
481
489
  }
482
490
  var chooseFolder = async function () {
483
491
  var dp = await window.showDirectoryPicker();
484
- var msg = alert("正在读取文件列表,请稍候..", false);
492
+ var msg = alert(i18n`正在读取文件列表,请稍候..`, false);
485
493
  var rest = [dp];
486
494
  var result = [];
487
495
  dp.path = "";
@@ -511,7 +519,7 @@
511
519
  }
512
520
  }
513
521
  }
514
- msg.setText("正在提取字符串..");
522
+ msg.setText(i18n`正在提取字符串..`);
515
523
  css(msg.firstElementChild, 'text-align:left');
516
524
  var textMap = Object.create(null);
517
525
  已找到的字符串.is_loading = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.4.12",
3
+ "version": "4.4.13",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {