efront 3.25.3 → 3.25.7

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.
@@ -256,7 +256,7 @@ function slider(autoplay, circle = true) {
256
256
  }
257
257
  })
258
258
 
259
- outter.go = function (index, cache) {
259
+ outter.go = lazy(function (index, cache) {
260
260
  if (outter.index === index && cache !== false) return;
261
261
  negative_index = -index;
262
262
  var _removingMain = _imageMain;
@@ -275,7 +275,7 @@ function slider(autoplay, circle = true) {
275
275
  setTimeout(() => css(_imageMain, "transform:scale(1);opacity:1;transition:.2s transform ease-out,.4s opacity"), 0);
276
276
  if (player.ing) play();
277
277
  return outter;
278
- };
278
+ }, 20);
279
279
  outter.play = function (schedule = player.schedule, _isMiss) {
280
280
  if (isDefined(_isMiss)) {
281
281
  isMiss = _isMiss;
@@ -407,15 +407,21 @@ function table(elem) {
407
407
  };
408
408
  vbox(table, 'x');
409
409
  };
410
- care(table, function ([fields, data]) {
410
+ care(table, async function ([fields, data]) {
411
411
  if (_vbox) _vbox(), _vbox = null;
412
+ watch(table, {
413
+ find(text) {
414
+ $scope.data.searchText = text;
415
+ $scope.data.update();
416
+ }
417
+ })
412
418
  thead = null;
413
419
  fields.forEach(enrichField);
414
420
  remove(this.children);
415
421
  this.innerHTML = template;
416
422
  markedRows = false;
417
423
  this.style.display = 'block';
418
- render(this, {
424
+ var $scope = {
419
425
  fields,
420
426
  isEmpty,
421
427
  tbody(e) {
@@ -434,19 +440,12 @@ function table(elem) {
434
440
  return tr;
435
441
  },
436
442
  tbodyHeight,
437
- data,
443
+ data: Table.from(fields, await data),
438
444
  adapter: null,
439
445
  resizeT,
440
446
  model,
441
447
  sort(f) {
442
- f.sign = f.sign > 0 ? -1 : 1;
443
- data.sort(function (a, b) {
444
- a = seek(a, f.key);
445
- b = seek(b, f.key);
446
- if (a > b) return f.sign;
447
- if (a < b) return -f.sign;
448
- return 0;
449
- });
448
+ this.data.sort(f);
450
449
  },
451
450
  setWidth(target, f) {
452
451
  css(target, { width: f.width });
@@ -454,7 +453,8 @@ function table(elem) {
454
453
  a: button,
455
454
  setFixedColumn,
456
455
  pagination
457
- }, this.$parentScopes.concat(this.$scope));
456
+ };
457
+ render(this, $scope, this.$parentScopes.concat(this.$scope));
458
458
  })
459
459
  autodragchildren(
460
460
  table,
@@ -505,7 +505,7 @@ function table(elem) {
505
505
  }
506
506
  markThead();
507
507
  markedRows = true;
508
- requestAnimationFrame(function(){
508
+ requestAnimationFrame(function () {
509
509
  setFixedColumn.call(table)
510
510
  })
511
511
  }
@@ -62,6 +62,15 @@ td {
62
62
  }
63
63
  }
64
64
 
65
+ thead {
66
+
67
+ .y-ing,
68
+ .x-ing {
69
+ &:before {
70
+ background-color: rgba(0, 60, 69, .3);
71
+ }
72
+ }
73
+ }
65
74
 
66
75
  & {
67
76
  // text-align: center;
@@ -39,7 +39,7 @@ function tree() {
39
39
  generator = arg;
40
40
  }
41
41
  });
42
- if (!generator && "$src" in element && element.childNodes.length) {
42
+ if (!generator && element && "$src" in element && element.childNodes.length) {
43
43
  generator = getGenerator(element, 'node');
44
44
  }
45
45
  var dom = [], root = null;
@@ -65,11 +65,12 @@ function tree() {
65
65
  if (!elem) return;
66
66
  span = document.createElement('span');
67
67
  span.innerHTML = tabs;
68
+ span.setAttribute("tabs", '');
68
69
  elem.insertBefore(span, elem.firstChild);
69
70
  span = elem;
70
71
  } else {
71
72
  span = document.createElement("node");
72
- html(span, `${tabs}<c>${com.name}</c>${com.test ? "<i>_test</i>" : ""}<a class=count>${com.count}</a>`);
73
+ html(span, `<span tabs>${tabs}</span><c>${com.name}</c>${com.test ? "<i>_test</i>" : ""}<a class=count>${com.count}</a>`);
73
74
  span.count = span.lastElementChild;
74
75
  }
75
76
  var _div = button(span);
@@ -53,19 +53,19 @@ t {
53
53
 
54
54
  .closed,
55
55
  .open {
56
- c:before {
56
+ [tabs]+*:before {
57
57
  content: "";
58
- display: inline-block;
58
+ display: inline-block !important;
59
59
  border: .3em solid transparent;
60
60
  }
61
61
  }
62
62
 
63
- .closed c:before {
63
+ .closed [tabs]+*:before {
64
64
  border-left: .4em solid;
65
65
  border-right: .2em solid transparent;
66
66
  }
67
67
 
68
- .open c:before {
68
+ .open [tabs]+*:before {
69
69
  margin-left: -.2em;
70
70
  margin-right: .2em;
71
71
  margin-top: .2em;
@@ -0,0 +1,26 @@
1
+ function watcher({ changes }) {
2
+ var watches = this.$watches;
3
+ for (var k in changes) {
4
+ if (k in watches) {
5
+ var { current, previous } = changes[k];
6
+ watches[k](current, previous);
7
+ }
8
+ }
9
+ }
10
+ function watch(elem, prop, handler) {
11
+ if (!elem.$watches) {
12
+ elem.$watches = {};
13
+ on("changes")(elem, watcher);
14
+ }
15
+ if (isFunction(handler)) {
16
+ elem.$watches[prop] = handler;
17
+ }
18
+ else if (isObject(prop)) {
19
+ var e = 0;
20
+ for (var k in prop) {
21
+ if (!isFunction(prop[k])) e++;
22
+ else elem.$watches[k] = prop[k];
23
+ }
24
+ if (e > 0) throw new Error("参数不支持!");
25
+ }
26
+ }
package/docs/compare.md CHANGED
@@ -6,17 +6,17 @@
6
6
 
7
7
  ## 表面参数对比
8
8
 
9
- | 对比项\框架 | efront/(zimoli) | angular | react | vue |
10
- | -------------------- | ---------------------------------------------------------------------- | ---------------------------------- | -------------------------------- | ------------------------------ |
11
- | Hello World 目标代码 | ≈1kb; | &gt;30kb | &gt;30kb | ≈30kb; |
12
- | 开发环境启动时间 | ≈0s; | &gt;2s | &gt;2s | >2s |
13
- | 开发语言 | js/html/less/ts | ts/html/less/sass/scss | jsx/css/js/ts/html | html/css/js |
14
- | 导出组件依赖项 | 无 | angular | react | vue |
15
- | 官方路由 | zimoli,使用前无需注册路径 | angular-router, 使用前需要注册路径 | react-router, 使用前需要注册路径 | vue-router, 使用前需要注册路径 |
16
- | 跨域实现 | 开发环境内置 | 配置浏览器或服务器 | 配置浏览器或服务器 | 配置浏览器或服务器 |
9
+ | 对比项\框架 | efront/(zimoli) | angular | react | vue |
10
+ | -------------------- | --------------------------------------------------------------------------- | ---------------------------------- | -------------------------------- | ------------------------------ |
11
+ | Hello World 目标代码 | ≈1kb; | &gt;30kb | &gt;30kb | ≈30kb; |
12
+ | 开发环境启动时间 | ≈0s; | &gt;2s | &gt;2s | >2s |
13
+ | 开发语言 | js/html/less | ts/html/less/sass/scss | jsx/css/js/ts/html | html/css/js |
14
+ | 导出组件依赖项 | 无 | angular | react | vue |
15
+ | 官方路由 | zimoli,使用前无需注册路径 | angular-router, 使用前需要注册路径 | react-router, 使用前需要注册路径 | vue-router, 使用前需要注册路径 |
16
+ | 跨域实现 | 开发环境内置 | 配置浏览器或服务器 | 配置浏览器或服务器 | 配置浏览器或服务器 |
17
17
  | 代码加载方案 | 依赖加载/自动预加载/手动预加载`preapre('/page/path');` / 动态路径访问时加载 | 一次加载/或访问时加载 | 一次加载/或访问时加载 | 一次加载/或访问时加载 |
18
- | 跳转传参 | `go`(pagepath,&nbsp;params) | 略 | 略 | 略 |
19
- | 异步对象传参 | `cast`(target,&nbsp;data) &#013;&#010; `care`(target,&nbsp;handle) | 略 | 略 | 略 |
18
+ | 跳转传参 | `go`(pagepath,&nbsp;params) | 略 | 略 | 略 |
19
+ | 异步对象传参 | `cast`(target,&nbsp;data) &#013;&#010; `care`(target,&nbsp;handle) | 略 | 略 | 略 |
20
20
 
21
21
  ## 架构对比
22
22
 
@@ -205,6 +205,12 @@ function main(elem){
205
205
  onremove(elem,function(event){
206
206
  // 移除之前触发,必要时可以绑定
207
207
  });
208
+ watch(elem, {
209
+ // propname 指用法<element :propname=propvalue ></element>中的propname
210
+ propname(current_value, previous_value){
211
+ // 参数变化后的任务
212
+ }
213
+ });
208
214
  var scope = {
209
215
  // html内使用的内容要在这里出现
210
216
  btn: button, // 内部组件可以在渲染前重命名,以简化html中的tagName,方便在局部语境中编写和阅读
package/docs/main.js CHANGED
@@ -2,13 +2,13 @@ zimoli.clearHistory();
2
2
  zimoli('/loader');
3
3
  contextmenu(document, function (event) {
4
4
  if (!window.require) return;
5
- return [
5
+ return menuList(null, [
6
6
  {
7
7
  "name": "开发者选项",
8
- do(){
8
+ do() {
9
9
  window.require("electron").ipcRenderer.send("window", "open-dev-tools");
10
10
  window.resizeBy(400, 0);
11
11
  }
12
12
  }
13
- ];
13
+ ]);
14
14
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.25.3",
3
+ "version": "3.25.7",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {
@@ -18,14 +18,10 @@
18
18
  "url": "https://github.com/yunxu1019/efront.git"
19
19
  },
20
20
  "keywords": [
21
- "angular",
22
- "angularjs",
23
- "react",
24
- "vue",
25
- "jquery",
26
- "commonjs",
27
- "cross",
28
- "server"
21
+ "efront",
22
+ "前端",
23
+ "server",
24
+ "webpack"
29
25
  ],
30
26
  "author": "yunxu1019",
31
27
  "license": "MIT"