efront 3.8.2 → 3.9.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.
@@ -56,20 +56,7 @@ var createGetter = function (search, isprop = true) {
56
56
  var [withContext, searchContext] = search;
57
57
  if (!searchContext) return function () { };
58
58
  var ret = /\;/.test(searchContext) ? "" : "return ";
59
- if (/\?\s*\.(?=[^\d])/.test(searchContext)) {
60
- searchContext = searchContext.replace(variableReg, function (context) {
61
- var dist;
62
- context.split(/\?\s*\.(?=[^\d])/).forEach(function (search) {
63
- if (dist) {
64
- if (/[\=]/.test(dist)) dist = `(${dist})`;
65
- dist = `${dist}!==void 0&&${dist}!==null?${dist}.${search}:''`
66
- } else {
67
- dist = search;
68
- }
69
- });
70
- return dist.length > 1 ? `(${dist})` : context;
71
- });
72
- }
59
+ searchContext = renderExpress(searchContext);
73
60
  if (isprop) {
74
61
  return new Function('event', `${withContext}with(this.$scope){${ret}${searchContext}}`);
75
62
  }
@@ -94,7 +81,7 @@ var parseRepeat = function (expression) {
94
81
  var res = reg.exec(expression);
95
82
  if (!res) return res;
96
83
  var [_, i, k, r, s, t] = res;
97
- var keyName, itemName, indexName, trackBy = t, srcName = s;
84
+ var keyName, itemName, indexName, trackBy = t, srcName = renderExpress(s);
98
85
  switch (r) {
99
86
  case "in":
100
87
  if (i) itemName = i;
@@ -289,6 +276,7 @@ var parseIfWithRepeat = function (ifExpression, repeatExpression) {
289
276
  if (reg.lastIndex < savedIndex) break;
290
277
  run();
291
278
  }
279
+ if (savedIndex < ifExpression.length) rest.push(ifExpression.slice(savedIndex))
292
280
  var beforeRepeat = [], afterRepeat = [];
293
281
  rest.forEach(function (result) {
294
282
  var match = false;
@@ -9,7 +9,7 @@
9
9
  <tr>
10
10
  <td -repeat="f in fields">
11
11
  <model -if="f.key" :field=f :data=d readonly ></model>
12
- <a on-click="o.do(d)" -if="!f.key&&f.options" _type="o.type instanceof Function?o.type(d):o.type"
12
+ <a on-click="o.do(d)" -if="!f.key&&f.options&&(!o.when||o.when(d))" _type="o.type instanceof Function?o.type(d):o.type"
13
13
  -repeat="o in f.options">
14
14
  <span -text="o.name instanceof Function?o.name(d):o.name"></span>
15
15
  </a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {