efront 4.16.0 → 4.17.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.
@@ -1,3 +1,18 @@
1
+ - zh-CN: 目标文件存在外部引用项$1
2
+ en: The target file has an external reference item of $1
3
+
4
+ - zh-CN: 输入$1
5
+ en: Enter $1
6
+
7
+ - zh-CN: 选择日期
8
+ en: Select date
9
+
10
+ - zh-CN: 选择日期和时间
11
+ en: Select date and time
12
+
13
+ - zh-CN: 选择$1
14
+ en: Select $1
15
+
1
16
  - zh-CN: 无法找到可用的$1支持库
2
17
  en: Unable to find available $1 support library
3
18
 
@@ -232,8 +232,11 @@ class Matrix extends Array {
232
232
  var A = this.slice().inverse();
233
233
  return resolve(A, s);
234
234
  }
235
+ getTransform() {
236
+ return [this[0], this[1], this[3], this[4], this[6], this[7]];
237
+ }
235
238
  toDOMString() {
236
- if (this.size()[1] === 2) return `matrix(${[this[0], this[1], this[3], this[4], this[6], this[7]]})`;
239
+ if (this.size()[1] === 2) return `matrix(${this.getTransform()})`;
237
240
  return `matrix(${this})`;
238
241
  }
239
242
  }
@@ -86,15 +86,7 @@ var power = function (source, search) {
86
86
  var match_text = matchers[0];
87
87
  var match_start = matchers[1];
88
88
  var match_length = matchers[3] - matchers[2];
89
- if (search.length === 1) {
90
- var p = 0;
91
- var res = source.replace(new RegExp(search.replace(/[\\\*\?\+\(\)\[]/g, "\\$&"), "ig"), (m, i) => {
92
- if (!p) p = .1 / (1 + i);
93
- return MARK_PRE1 + m + MARK_AFT1;
94
- });
95
- return [p, res];
96
- }
97
- if (match_length > 1) {
89
+ if (match_length >= 1) {
98
90
  var match_text_pre = source.slice(0, match_start);
99
91
  var match_text_aft = source.slice(match_start + match_text.length);
100
92
  var pp = 0, ap = 0;
@@ -44,7 +44,7 @@ var colonstrap_reg = /^(case|default)$/;
44
44
  class Javascript extends Program {
45
45
  straps = straps;
46
46
  value_reg = /^(false|true|null|Infinity|NaN|undefined|eval)$/
47
- transive_reg = /^(new|var|let|const|yield|void|in|of|typeof|delete|case|return|await|default|instanceof|throw|extends|import|from)$/
47
+ transive_reg = /^(new|var|let|const|yield|void|in|of|typeof|delete|case|return|await|instanceof|throw|extends|import|from)$/
48
48
  strapexp_reg = /^(new|void|typeof|delete|class|function|await)/;
49
49
  forceend_reg = /^(return|yield|break|continue|debugger|async)$/;
50
50
  defaultType = EXPRESS;
@@ -796,7 +796,7 @@ var removeImport = function (c, i, code) {
796
796
  else {
797
797
  if (!name) name = name1;
798
798
  used[name1].forEach(u => {
799
- compile$patchname(name, u, ".default");
799
+ patchname(name, u, ".default");
800
800
  });
801
801
  }
802
802
  }
@@ -889,6 +889,16 @@ var removeExport = function (c, i, code) {
889
889
  code.exportDefault = true;
890
890
  n.next.isExpress = true;
891
891
  c.type = EXPRESS;
892
+ var d = n.next;
893
+ if (d.type === STRAP && /^(class|function|var|let|const)$/.test(d.text)) {
894
+ d = d.next;
895
+ if (d.type === EXPRESS && !/[\.\[]/.test(d.text)) {
896
+ code.used[d.tack].forEach(o => {
897
+ if (d === o) return;
898
+ patchname('', o, "exports.default");
899
+ })
900
+ }
901
+ }
892
902
  return;
893
903
  }
894
904
  var [dec, map, o] = getDeclared(n.next, 'export');
@@ -973,10 +983,14 @@ Javascript.prototype.newVar = function (used, string_template) {
973
983
  return name;
974
984
  }
975
985
  Javascript.prototype.fix = function (code) {
986
+ var hasExport = false;
976
987
  backEach(code, function (o, i) {
977
988
  if (o.type !== STRAP) return;
978
989
  if (o.text === 'import') removeImport.call(this, o, i, code);
979
- else if (o.text === 'export') removeExport.call(this, o, i, code);
990
+ else if (o.text === 'export') {
991
+ hasExport = true;
992
+ removeExport.call(this, o, i, code);
993
+ }
980
994
  }, this);
981
995
  if (code.exportStars) {
982
996
  var exportStars = code.exportStars;
@@ -1045,8 +1059,10 @@ Javascript.prototype.fix = function (code) {
1045
1059
  }
1046
1060
  });
1047
1061
  }
1062
+ if (hasExport) code.export = true;
1048
1063
  relink(code);
1049
1064
  setqueue(code);
1065
+ return code;
1050
1066
  }
1051
1067
  Javascript.prototype.createString = createString;
1052
1068
  Javascript.prototype.createScoped = createScoped;
@@ -7,6 +7,7 @@ var testFix = function (a, e) {
7
7
  }
8
8
  js.debug = true;
9
9
  assert(scanner2("/a/g", js)[0].type, common.QUOTED);
10
+ testFix(`export default function a(){} a.a=1`, `exports.default = function a() {} exports.default.a = 1`);
10
11
  testFix(`export * from "a";`, 'var a = require("a");\r\nexports.default = undefined\r\nextendIfNeeded(exports, a)');
11
12
  testFix(`export {A} from "a";`, 'var a = require("a")\r\nexports.A = a.A;');
12
13
  testFix(`import a from "a";console.log(a)`, 'var a = require("a"); console.log(a.default)');
@@ -813,9 +813,10 @@ var createScoped = function (parsed, wash) {
813
813
  else while (o && (o.type !== SCOPED || o.entry === '[')) {
814
814
  o = o.next;
815
815
  if (o && o.type === EXPRESS) {
816
- saveTo(used, o.text, o);
816
+ var tack = o.text.replace(/[\.\[][\s\S]*$/, '');
817
+ saveTo(used, tack, o);
817
818
  if (o.prev && o.prev.type === STRAP && o.prev.text === 'extends') continue;
818
- lets[o.text] = true;
819
+ lets[tack] = true;
819
820
  o.kind = isFunction ? 'function' : 'class';
820
821
  o = o.next;
821
822
  }
@@ -1544,6 +1545,7 @@ var isHalfSentence = function (body, i) {
1544
1545
  while (a && a.type & (SPACE | COMMENT)) a = body[--i];
1545
1546
  if (!a) return false;
1546
1547
  if (a.type === STRAP && a.text === 'else') return true;
1548
+ if (a.type === STAMP && (a.unary || !/^(;|\+\+|\-\-)$/.test(a.text))) return true;
1547
1549
  if (a.type !== SCOPED || a.entry !== "(") return false;
1548
1550
  a = a.prev;
1549
1551
  if (!a || a.type !== STRAP) return false;
@@ -2,11 +2,11 @@ var scanner2 = require("./scanner2");
2
2
  var { SCOPED, QUOTED, SCOPED, PROPERTY, STAMP, PIECE, setqueue, splice, relink, patchArrawScope, number_reg, replace, canbeDuplicate, createString } = require("./common");
3
3
  var strings = require("../basic/strings");
4
4
  var program = null;
5
- var patchTranslate = function (c) {
5
+ var patchTranslate = function (c, raw) {
6
6
  if (c.length) {
7
7
  var canbeDup = true;
8
8
  c.translate = c.map((o, i) => {
9
- if (o.type === PIECE) return strings.decode(`\`${o.text}\``);
9
+ if (o.type === PIECE) return raw ? o.text : strings.decode(`\`${o.text}\``);
10
10
  if (canbeDup && !canbeDuplicate(o)) canbeDup = false;
11
11
  return `$${i + 1 >> 1}`;
12
12
  }).join('').replace(/\r\n|\r|\n/g, '\r\n');
@@ -14,7 +14,7 @@ var patchTranslate = function (c) {
14
14
  }
15
15
  else {
16
16
  if (/^['"`]/.test(c.text) && c.text.length > 2) {
17
- var text = strings.decode(c.text).replace(/\r\n|\r|\n/g, '\r\n');
17
+ var text = raw ? c.text.slice(1, c.text.length - 1) : strings.decode(c.text).replace(/\r\n|\r|\n/g, '\r\n');
18
18
  c.translate = text;
19
19
  }
20
20
  }
@@ -54,7 +54,7 @@ function getI18nPrefixedText(code, dist = []) {
54
54
  if (!n || n.type !== QUOTED || n.length && n.entry !== '`') continue;
55
55
  var c = n;
56
56
  c.transtype = t;
57
- patchTranslate(c);
57
+ patchTranslate(c, t === 字段名);
58
58
  f(c);
59
59
  }
60
60
  };
@@ -3,7 +3,7 @@
3
3
  width: .8em;
4
4
  position: relative;
5
5
  border: .1em solid;
6
- margin: -0.2em .3em -0.2em 0;
6
+ margin: -0.2em .3em -0.1em 0;
7
7
  font-family: sans-serif;
8
8
  display: inline-block;
9
9
  line-height: 1;
@@ -11,7 +11,8 @@ var stylePrefix = function (documentStyle) {
11
11
  if ("-o-transform" in documentStyle) return "-o-";
12
12
  return "";
13
13
  }(documentStyle);
14
- var ratioPropReg = /(?:opacity|line\-height|lineHeight|z\-index|zIndex|zoom|weight|count|order|perspective|animation|flex|font\-size\-adjust|tab\-size|scale|grid\-(?:column|row)(?:\-(?:start|end))?)$/i;
14
+ var ratioPropReg = /(?:opacity|lineHeight|zIndex|zoom|weight|count|order|perspective|animation|flex|fontSizeAdjust|tabSize|scale|grid(?:Column|Row)(?:Start|End)?)$/i;
15
+ var urlwrapReg = /(?:backgroundImage|borderImageSource)/;
15
16
  var nodePrefix = stylePrefix.slice(1, stylePrefix.length - 1);
16
17
  var transfromSimpleValue = function (value) {
17
18
  if (isFinite(value)) return fromOffset(+value || 0);
@@ -24,7 +25,13 @@ var transformValue = function (value, k) {
24
25
  return res;
25
26
  }
26
27
  if (ratioPropReg.test(k) || !value) return value;
27
- if (/^[\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s+/).map(transfromSimpleValue).join(' ');
28
+ if (urlwrapReg.test(k)) {
29
+ if (!/^[\w\-]+\(/.test(value)) {
30
+ value = `url('${value}')`;
31
+ }
32
+ return value;
33
+ }
34
+ if (/^[\-\w\s\.]+$/.test(value)) return isFinite(value) ? transfromSimpleValue(value) : String(value).split(/\s+/).map(transfromSimpleValue).join(' ');
28
35
  return value;
29
36
  };
30
37
  var setValue = function (o, k, v) {
@@ -7,12 +7,16 @@ function hasType(target, type) {
7
7
  return function (element, types) {
8
8
  var marked = 0;
9
9
  for (var k in types) {
10
+ var mark0 = marked;
10
11
  for (var c of element.children) {
11
12
  if (hasType(c, types[k])) {
12
13
  types[k] = c;
13
14
  marked++;
14
15
  }
15
16
  }
17
+ if (marked === mark0) {
18
+ types[k] = null;
19
+ }
16
20
  }
17
21
  if (!marked && isArray(types)) {
18
22
  var children = element.children;
@@ -134,6 +134,7 @@ function input(element) {
134
134
  case "integer":
135
135
  case "number":
136
136
  case "num":
137
+ case "digit":
137
138
  on("keydown")(element, number);
138
139
  break;
139
140
  default:
@@ -10,6 +10,8 @@
10
10
  border-radius: 3px;
11
11
  font-size: 16px;
12
12
  -webkit-appearance: none;
13
+ appearance: none;
14
+ -moz-appearance: textfield;
13
15
  box-shadow: none;
14
16
  outline: none;
15
17
 
@@ -22,11 +24,13 @@
22
24
  display: none;
23
25
  }
24
26
 
27
+ &::-moz-focus-inner,
25
28
  &::-webkit-inner-spin-button {
26
29
  display: none;
27
30
  }
28
31
 
29
- &::-webkit-inner-spin-button {
32
+ &::-moz-focus-outer,
33
+ &::-webkit-outer-spin-button {
30
34
  display: none;
31
35
  }
32
36
 
@@ -431,6 +431,7 @@ function ylist(container, generator, $Y) {
431
431
  var elem = getLastElement(2);
432
432
  var listRestHeight = elem ? elem.offsetHeight + elem.offsetTop - list.scrollTop : list.clientHeight;
433
433
  var paddingHeight = elem ? 0 : restHeight;
434
+ if (listRestHeight < list.clientHeight) listRestHeight = list.clientHeight;
434
435
  return currentY() + listRestHeight + paddingHeight;
435
436
  };
436
437
  list.$Top = function (y) {
@@ -100,7 +100,7 @@ var constructors = {
100
100
  text: textarea,
101
101
  number(e) {
102
102
  var { data, field } = e;
103
- var content = `<input type=${field.type} -model=data[field.key] />` + (field.unit ? `<span>${field.unit}</span>` : '');
103
+ var content = `<input placeholder="${field.holder || i18n`输入${field.name}`}" type=${field.type} -model=data[field.key] />` + (field.unit ? `<span>${field.unit}</span>` : '');
104
104
  e.innerHTML = content;
105
105
  if (field.unit && field.unit.length <= 6) {
106
106
  e.setAttribute("u" + field.unit.replace(/[\u0080-\ud7ff\uf000-\uffff]/g, '11').length, '')
@@ -118,7 +118,7 @@ var constructors = {
118
118
  },
119
119
  date(m) {
120
120
  var { data, field } = m;
121
- m.innerHTML = `<input placeholder=${field.holder || '选择日期'} readonly -model=data[field.key] />`;
121
+ m.innerHTML = `<input placeholder=${field.holder || i18n`选择日期`} readonly -model=data[field.key] />`;
122
122
  render(m, {
123
123
  data, field, input,
124
124
  });
@@ -126,7 +126,7 @@ var constructors = {
126
126
  },
127
127
  datetime(m) {
128
128
  var { data, field } = m;
129
- m.innerHTML = `<input placeholder=${field.holder || '选择日期和时间'} readonly -model=data[field.key] />`;
129
+ m.innerHTML = `<input placeholder=${field.holder || i18n`选择日期和时间`} readonly -model=data[field.key] />`;
130
130
  render(m, {
131
131
  data, field, input,
132
132
  });
@@ -154,15 +154,27 @@ var constructors = {
154
154
  cast(elem, field);
155
155
  return elem;
156
156
  },
157
- radio({ field }) {
157
+ radio({ data, field }) {
158
158
  var elem = radio();
159
+ elem.value = data[field.key];
159
160
  cast(elem, field);
160
161
  return elem;
161
162
  },
162
163
  select(_, t) {
163
164
  if (!t) {
164
165
  var elem = select();
165
- elem.innerHTML = `<option ng-repeat="(o,i) in field.options" ng-bind="o.name||o" _value="o.key!==undefined?o.key:o"></option>`;
166
+ var { field, data } = _;
167
+ elem.value = data[field.key];
168
+ var o = field.options?.[0];
169
+ if (field.holder) _.innerHTML = `<span -if="isEmpty(data[field.key])" class="placeholder">${field.holder}</span>`;
170
+ if (!isEmpty(o?.key)) {
171
+ field.options.unshift({
172
+ name: i18n`选择${field.name}`,
173
+ key: ''
174
+ })
175
+ }
176
+ render(_.children, { field, data, isEmpty });
177
+ elem.innerHTML = `<option -repeat="(o,i) in field.options" ng-bind="o.name||o" _value="o.key!==undefined?o.key:o"></option>`;
166
178
  }
167
179
  else if (t === 'a') {
168
180
  var { field, data } = _;
@@ -365,7 +377,7 @@ function main(elem) {
365
377
  return input;
366
378
  }()) : null;
367
379
  if (ipt) {
368
- if (ipt !== elem) appendChild(elem, ipt);
380
+ if (ipt !== elem) appendChild.insert(elem, ipt);
369
381
  if (!ipt.$scope) {
370
382
  renderModel.call(ipt, field, data);
371
383
  var saved_sataus;
@@ -3,6 +3,35 @@
3
3
  display: inline-block;
4
4
  }
5
5
 
6
+ &[type=select] {
7
+ position: relative;
8
+
9
+ >.select:hover,
10
+ >.select:active {
11
+ &+.placeholder {
12
+ color: #fff9;
13
+ }
14
+ }
15
+
16
+ .placeholder {
17
+ color: #0009;
18
+ padding-left: 6px;
19
+ position: absolute;
20
+ top: 50%;
21
+ margin-top: -.5em;
22
+ line-height: 1;
23
+ margin-bottom: -1em;
24
+ z-index: 1;
25
+ pointer-events: none;
26
+ display: block;
27
+ }
28
+
29
+ .select[empty] {
30
+ color: transparent;
31
+ }
32
+
33
+ }
34
+
6
35
  &[type=date] {
7
36
  >input {
8
37
  width: 8em;
@@ -21,7 +50,12 @@
21
50
  }
22
51
  }
23
52
 
24
- &[type=int] {
53
+ &[type=int],
54
+ &[type=number],
55
+ &[type=digit],
56
+ &[type=money],
57
+ &[type=price],
58
+ &[type=num] {
25
59
  >input {
26
60
  text-align: right;
27
61
  width: 8em;
package/coms/zimoli/on.js CHANGED
@@ -269,7 +269,7 @@ var remove = function (k, hk, [eventtypes, handler, context]) {
269
269
  if (hs) {
270
270
  for (var cx = hs.length - 1; cx >= 0; cx--) {
271
271
  var [e, h, c] = hs[cx];
272
- if (h === handler && e === eventtypes && c === context) {
272
+ if (h === handler && shallowEqual(e, eventtypes, 2) && c === context) {
273
273
  hs.splice(cx, 1);
274
274
  if (k === changes_key) element.$needchanges--;
275
275
  }
@@ -333,8 +333,8 @@ var append = function (k, hk, listener2, firstmost) {
333
333
  var [eventtypes, handler, context] = listener2;
334
334
  var element = this;
335
335
  var handlers = element[hk];
336
- for (var [h, e, c] of handlers) {
337
- if (h === handler && eventtypes === e && c === context) return;
336
+ for (var [e, h, c] of handlers) {
337
+ if (h === handler && shallowEqual(eventtypes, e, 2) && c === context) return;
338
338
  }
339
339
  if (k === changes_key) {
340
340
  if (!element.$needchanges) element.$needchanges = 0;
@@ -2,15 +2,16 @@ var saved_list;
2
2
  var _remove = function () {
3
3
  var removing_list = saved_list;
4
4
  if (removing_list) {
5
- setTimeout(function run() {
5
+ requestAnimationFrame(function run() {
6
6
  if (removing_list !== saved_list) return remove(removing_list);
7
7
  var { activeElement } = document;
8
- a: if (!getTargetIn(removing_list, activeElement)) {
8
+ a: if (!getTargetIn(removing_list, activeElement) && !getTargetIn(removing_list.target, activeElement)) {
9
9
  var extras = [].concat(removing_list.with);
10
10
  for (var e of extras) {
11
11
  if (getTargetIn(e, activeElement)) break a;
12
12
  }
13
13
  remove(removing_list);
14
+ removing_list.target.focus();
14
15
  if (removing_list === saved_list) saved_list = null;
15
16
  return;
16
17
  }
@@ -40,7 +41,35 @@ on('touchend')(window, function (event) {
40
41
  if (getTargetIn(saved_list, event.target)) return;
41
42
  }
42
43
  activeElement.blur();
43
- })
44
+ });
45
+ var setEmpty = function () {
46
+ if (isEmpty(this.value)) {
47
+ if (!this.empty) {
48
+ this.empty = true;
49
+ this.setAttribute('empty', '')
50
+ }
51
+ }
52
+ else {
53
+ if (this.empty) {
54
+ this.empty = false;
55
+ this.removeAttribute('empty');
56
+ }
57
+ }
58
+ };
59
+ var setFocus = function () {
60
+ if (saved_list && saved_list.target === this) {
61
+ if (!this.focused) {
62
+ this.focused = true;
63
+ this.setAttribute('focus', '');
64
+ }
65
+ }
66
+ else {
67
+ if (this.focused) {
68
+ this.focused = false;
69
+ this.removeAttribute('focus');
70
+ }
71
+ }
72
+ }
44
73
  function select() {
45
74
  var [target, list, removeOnSelect, direction] = arguments;
46
75
  if (/^[yvxh]/i.test(removeOnSelect)) {
@@ -99,6 +128,8 @@ function select() {
99
128
  if (removeOnSelect === null) {
100
129
  onmousedown(list, preventDefault);
101
130
  }
131
+ on("touchend")(target, preventDefault);// 兼容火狐 android
132
+ on("touchend")(list, preventDefault);// 兼容火狐 android
102
133
  on("keydown.up")(target, preventDefault);
103
134
  on("keydown.down")(target, preventDefault);
104
135
  on("keydown.enter")(target, preventDefault1);
@@ -213,15 +244,26 @@ function select() {
213
244
  var mousedown = function () {
214
245
  initList();
215
246
  if (saved_list !== list || !isMounted(list)) {
216
- if (saved_list && saved_list !== list) _remove();
217
- if (document.activeElement !== target) target.focus();
247
+ if (saved_list && saved_list !== list) remove(saved_list);
218
248
  popup(list, target, direction);
249
+ requestAnimationFrame(/*兼容safari*/function () {
250
+ if (document.activeElement !== target) target.focus();
251
+ })
252
+ if (getTargetIn(list, document.activeElement)) {
253
+ on('blur')(document.activeElement, removeByBlur);
254
+ }
219
255
  saved_list = list;
220
256
  }
221
- else _remove();
257
+ else {
258
+ remove(list);
259
+ if (saved_list === list) {
260
+ saved_list = null;
261
+ target.focus();
262
+ }
263
+ }
222
264
  };
223
265
  if (!target.$renders) {
224
- target.$renders = [];
266
+ target.$renders = [setEmpty, setFocus];
225
267
  }
226
268
  target.$renders.push(setIcon);
227
269
  onclick(target, mousedown);
@@ -1,14 +1,23 @@
1
+ & {
2
+ background: #fff;
3
+ }
4
+
1
5
  select& {
2
6
  border: 1px solid #00000033;
3
7
  -webkit-appearance: none;
4
- -moz-appearance: none;
5
- height: 30px;
6
- line-height: 30px;
7
- padding: 0 16px;
8
+ appearance: none;
9
+ height: 28px;
10
+ line-height: 28px;
11
+ padding: 0 6px;
8
12
  outline: none;
9
13
  font-size: inherit;
10
14
  display: inline-block;
11
15
 
16
+ &:focus,
17
+ &[focus] {
18
+ border-color: #29c;
19
+ }
20
+
12
21
  &::-ms-expand {
13
22
  display: none;
14
23
  }
@@ -34,4 +43,13 @@ select& {
34
43
 
35
44
  model>& {
36
45
  width: 100%;
46
+ }
47
+
48
+ &[empty] {
49
+ color: #0009;
50
+
51
+ &:hover,
52
+ &:active {
53
+ color: #fff9;
54
+ }
37
55
  }
@@ -1,6 +1,12 @@
1
1
  var singleClick = function () {
2
2
  var node = this.parentNode;
3
- if (node.activeNode === this) return;
3
+ if (node.activeNode === this) {
4
+ remove(node);
5
+ if (node.target) {
6
+ node.target.focus();
7
+ }
8
+ return;
9
+ }
4
10
  if (node.activeNode) {
5
11
  if (isObject(node.activeNode.origin)) node.activeNode.origin.selected = false;
6
12
  node.activeNode.removeAttribute("selected");
@@ -14,6 +20,7 @@ var singleClick = function () {
14
20
  if (isObject(this.origin)) this.origin.selected = true;
15
21
  dispatch(node, "change");
16
22
  if (getTargetIn(node, document.activeElement)) document.activeElement.blur();
23
+ remove(node);
17
24
  };
18
25
  var multipleClick = function () {
19
26
  var node = this.parentNode;
@@ -33,6 +40,11 @@ var multipleClick = function () {
33
40
  var searchinput = function () {
34
41
  var ipt = document.createElement("input");
35
42
  ipt.placeholder = '搜索';
43
+ on('mounted')(ipt, function () {
44
+ requestAnimationFrame(function () {
45
+ ipt.focus();
46
+ });
47
+ });
36
48
  return ipt;
37
49
  };
38
50
 
@@ -108,7 +120,7 @@ function main() {
108
120
 
109
121
  var hasIcon = false, iconed = '';
110
122
 
111
- if (children.length > 6) {
123
+ if (children.length > 12) {
112
124
  var ipt = searchinput()
113
125
  page.insertBefore(ipt, page.firstChild);
114
126
  var searchtext = function () {
@@ -86,8 +86,10 @@ function getScrollbarWidth() {
86
86
  }
87
87
  var init = function () {
88
88
  init = function () { };
89
- css("." + view.className.split(/\s+/)[0] + ">.body", {
90
- marginRight: -getScrollbarWidth() + "px"
89
+ var className = view.className.split(/\s+/)[0];
90
+ css(`.${className}>.body,.${className}>[body]`, {
91
+ borderRight: 20 - getScrollbarWidth() + "px solid transparent",
92
+ marginRight: -20 + "px"
91
93
  });
92
94
  };
93
95
  var resize2 = function () {
@@ -25,8 +25,7 @@ body>& {
25
25
 
26
26
  >.body,
27
27
  >[body] {
28
- padding: 6px 20px 6px 6px;
29
- margin-right: -20px;
28
+ padding: 6px;
30
29
  display: block;
31
30
  width: auto;
32
31
  height: 100%;
@@ -22,7 +22,6 @@ var scroll = function () {
22
22
  var { max, min } = Math;
23
23
  var scrollOutside = function (deltay) {
24
24
  var _box = this;
25
- if (_box.YScrollBoxId === 1) return deltay;
26
25
  var offsetParent = _box.offsetParent;
27
26
  if (!offsetParent) return deltay;
28
27
  var _boxPosition = getScreenPosition(_box);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.16.0",
3
+ "version": "4.17.0",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {