efront 4.22.18 → 4.23.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.
Files changed (74) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +6 -0
  2. package/apps/kugou/search/search.js +4 -3
  3. package/apps/noice/main.js +1 -1
  4. package/apps/pivot/auth/login.js +4 -4
  5. package/apps/pivot/dht/list.js +5 -5
  6. package/apps/pivot/link/chat.js +1 -1
  7. package/apps/pivot/link/index.js +1 -1
  8. package/apps/pivot/link/list.js +5 -4
  9. package/apps/pivot/share/list.js +6 -5
  10. package/apps/pivot/wow/root.js +3 -2
  11. package/coms/basic/LoadingArray.js +1 -0
  12. package/coms/basic/cross_.js +4 -1
  13. package/coms/basic/data.js +16 -13
  14. package/coms/basic_/WeakMap.js +23 -0
  15. package/coms/compile/Javascript.js +2 -1
  16. package/coms/explorer/context.js +10 -7
  17. package/coms/explorer/edit.js +1 -1
  18. package/coms/explorer/fileitem.js +9 -7
  19. package/coms/explorer/main.js +20 -17
  20. package/coms/frame/chat.js +17 -16
  21. package/coms/frame/list.js +6 -5
  22. package/coms/kugou/bindScroll.js +0 -1
  23. package/coms/kugou/buildScroll.js +5 -4
  24. package/coms/kugou/krc.js +2 -2
  25. package/coms/kugou/player.js +2 -2
  26. package/coms/kugou/song.js +1 -1
  27. package/coms/layer/leftCenter.js +5 -5
  28. package/coms/pivot/checkGeo.js +0 -1
  29. package/coms/zimoli/$eval.js +1 -0
  30. package/coms/zimoli/$mounted.js +1 -0
  31. package/coms/zimoli/$parented.js +1 -0
  32. package/coms/zimoli/$renders.js +1 -0
  33. package/coms/zimoli/$scoped.js +1 -0
  34. package/coms/zimoli/$structed.js +1 -0
  35. package/coms/zimoli/HexEditor.js +1 -1
  36. package/coms/zimoli/appendChild.js +12 -20
  37. package/coms/zimoli/autodragchildren_test.js +1 -1
  38. package/coms/zimoli/checkbox.js +1 -1
  39. package/coms/zimoli/container.js +4 -3
  40. package/coms/zimoli/createItemTarget.js +10 -6
  41. package/coms/zimoli/cross.js +1 -1
  42. package/coms/zimoli/field.js +3 -3
  43. package/coms/zimoli/gallery_test.js +4 -3
  44. package/coms/zimoli/getArgsChildren.js +22 -0
  45. package/coms/zimoli/getGenerator.js +36 -28
  46. package/coms/zimoli/grid.js +2 -2
  47. package/coms/zimoli/isMounted.js +6 -3
  48. package/coms/zimoli/lattice.js +2 -4
  49. package/coms/zimoli/maps.js +1 -2
  50. package/coms/zimoli/menu.js +1 -0
  51. package/coms/zimoli/menuItem.js +4 -3
  52. package/coms/zimoli/menuList.js +8 -8
  53. package/coms/zimoli/menu_test.js +4 -3
  54. package/coms/zimoli/model.js +11 -6
  55. package/coms/zimoli/on.js +28 -20
  56. package/coms/zimoli/picture.js +0 -7
  57. package/coms/zimoli/popup.js +33 -2
  58. package/coms/zimoli/radio.js +1 -1
  59. package/coms/zimoli/remove.js +5 -14
  60. package/coms/zimoli/render.js +193 -99
  61. package/coms/zimoli/scrollbar.js +90 -42
  62. package/coms/zimoli/scrollbar.less +5 -3
  63. package/coms/zimoli/select.js +3 -3
  64. package/coms/zimoli/selectList.js +1 -1
  65. package/coms/zimoli/selectListEdit.js +5 -4
  66. package/coms/zimoli/table.html +6 -4
  67. package/coms/zimoli/table.js +82 -41
  68. package/coms/zimoli/table.less +22 -0
  69. package/coms/zimoli/vbox.less +2 -2
  70. package/coms/zimoli/zimoli.js +15 -8
  71. package/docs/version-desc.md +3 -1
  72. package/docs//347/211/210/346/234/254/350/257/264/346/230/216.md +3 -1
  73. package/package.json +1 -1
  74. package/public/efront.js +1 -1
@@ -49,8 +49,8 @@ onhashchange(window, function (event) {
49
49
  });
50
50
  // body
51
51
  var location_pathname = location.pathname;
52
- var _zimoli_params_key = `_zimoli_parameters:${location_pathname}#`;
53
- var _zimoli_state_prefix = `_zimoli_page_state:${location_pathname}#`;
52
+ var _zimoli_params_key = `紫茉莉:${location_pathname}#`;
53
+ var _zimoli_state_prefix = `茉莉紫:${location_pathname}#`;
54
54
 
55
55
  function getReverseStyle(style) {
56
56
  if (!isObject(style)) {
@@ -317,6 +317,7 @@ function prepare(pgpath, ok) {
317
317
  //只能在page上使用
318
318
  _pageback_listener = handler;
319
319
  };
320
+ state.upwith = popup.upwith(_with_elements);
320
321
  state.titlebar = function () {
321
322
  var realTitleBar = titlebar.apply(null, arguments);
322
323
  if (!realTitleBar.parentNode) _with_elements.push(realTitleBar);
@@ -370,17 +371,18 @@ function create(pagepath, args, from, needroles) {
370
371
  var pg = pagepath;
371
372
  var { with: _with_elements = [], state = {}, onback: _pageback_listener, roles } = pg;
372
373
  }
374
+ var h = history[current_history];
373
375
  if (!checkroles(user.roles, roles) || !checkroles(user.roles, needroles)) {
374
376
  // 检查权限
375
377
  if (!user.isLogin && user.loginPath) {
376
378
  var pg = create(user.loginPath);
377
- history[current_history].wardable = false;
379
+ if (h) h.wardable = false;
378
380
  return pg;
379
381
  }
380
382
  return alert(i18n`没有权限!`, 0);
381
383
  }
382
384
  if (!pg) return;
383
- if (history[current_history]) history[current_history].wardable = true;
385
+ if (h) h.wardable = true;
384
386
  var _with_length = _with_elements.length;
385
387
  state.onback = function (handler) {
386
388
  _pageback_listener = handler;
@@ -388,8 +390,12 @@ function create(pagepath, args, from, needroles) {
388
390
  var _page = pg.call(state, args, from);
389
391
  if (undefined === args || null === args) args = {};
390
392
  if (_page) {
391
- if (_with_length) _page.with = _with_elements.concat(_page.with || []);
392
- _with_elements.splice(_with_length, _with_elements.length - _with_length);
393
+ var page_with = _with_elements.splice(_with_length, _with_elements.length - _with_length);
394
+ if (_page.with && _page.with !== _with_elements) {
395
+ page_with = page_with.concat(_page.with);
396
+ _with_elements.with = page_with;
397
+ }
398
+ _page.with = _with_elements;
393
399
  if (args.initialStyle) _page.initialStyle = args.initialStyle;
394
400
  if (args.holdupStyle) _page.holdupStyle = args.holdupStyle;
395
401
  if (_page.initialStyle && !_page.holdupStyle) {
@@ -455,7 +461,7 @@ var global = {};
455
461
  var history = {};
456
462
  var current_history, default_history = current_history = "";
457
463
  history[current_history] = createEmptyHistory('/main', false);
458
- var history_session_object_key = `_zimoli_history_key:${location_pathname}`;
464
+ var history_session_object_key = `紫茉莉:${location_pathname}`;
459
465
  try {
460
466
  history = JSAM.parse(historyStorage.getItem(history_session_object_key)) || history;
461
467
  } catch (e) {
@@ -671,7 +677,8 @@ function addGlobal(element, name = null, isBack) {
671
677
  if (isBack) appendChild.insert(body, element);
672
678
  else appendChild(body, element);
673
679
  }
674
- rootElements.push(element);
680
+ var upwith = element.$upwith || rootElements;
681
+ if (upwith.indexOf(element) < 0) upwith.push(element);
675
682
  }
676
683
  if (hasLock) fixurl(), fixLock = false;
677
684
  }
@@ -10,4 +10,6 @@
10
10
 
11
11
  4.0 No longer relying on `typescript` (nearly 170000 lines of source code), the compilation speed has increased by four times, the memory usage has been reduced to 1/8 of the original, and the self compilation time on GitHub has also been reduced to about 15 seconds.
12
12
 
13
- 4.1 No longer relying on `less-node` or `pngjs`, while the `less-node` is replaced with [suxin](https://www.npmjs.com/package/suxin) from `efront`.
13
+ 4.1 No longer relying on `less-node` or `pngjs`, while the `less-node` is replaced with [suxin](https://www.npmjs.com/package/suxin) from `efront`.
14
+
15
+ 4.23 The `zimoli` library has adjusted the component rendering method to provide a relatively clean DOM for developers. When calling methods such as `on` and `render`, associated data is no longer attached to DOM elements (except for browsers without WeakMap). Code that uses corresponding underlying features needs to be modified.
@@ -10,4 +10,6 @@
10
10
 
11
11
  4.0版本 不再依赖`typescipt`(近17万行源码),编译速度再次提升4倍,占用内存减少到原来的1/8,github上自我编译时间也减少到15秒左右。
12
12
 
13
- 4.1版本 不再依赖`less-node`和`pngjs`,其中`less-node` 由`efront`自建的css工具[素馨](https://www.npmjs.com/package/suxin)代替。
13
+ 4.1版本 不再依赖`less-node`和`pngjs`,其中`less-node` 由`efront`自建的css工具[素馨](https://www.npmjs.com/package/suxin)代替。
14
+
15
+ 4.23版本 紫茉莉库`zimoli`调整组件渲染方式,给开发一个相对干净的DOM,调用`on`和`render`等方法时,不再将关联的数据挂载到dom元素,(无WeakMap的浏览器除外),用到相应的底层特性的代码需要修改。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.22.18",
3
+ "version": "4.23.0",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {