efront 3.26.5 → 3.26.6

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.
@@ -78,14 +78,19 @@ function rebuild(element) {
78
78
  }
79
79
  var variableReg = /([^\:\,\+\=\-\!%\^\|\/\&\*\!\;\?\>\<~\{\}\s\[\]\(\)]|\?\s*\.(?=[^\d])|\s*\.\s*)+/g;
80
80
  var createGetter = function (search, isprop = true) {
81
- var [withContext, searchContext] = search;
82
- if (!searchContext) return function () { };
83
- var ret = /\;/.test(searchContext) ? "" : "return ";
84
- searchContext = renderExpress(searchContext);
81
+ if (!search) return function () { };
82
+ search = renderExpress(search);
85
83
  if (isprop) {
86
- return new Function('event', `${withContext}with(this.$scope){${ret}${searchContext}}`);
84
+ return function (event) {
85
+ return $eval.call(this, search, this.$scope, event);
86
+ };
87
+ }
88
+ if (/([\=\(\+\-])/.test(search)) return function (event) {
89
+ return $eval.call(this, search, this.$scope, event);
90
+ }
91
+ else return function (event) {
92
+ $eval.call(this, search)(event);
87
93
  }
88
- return new Function("event", `${withContext}with(this.$scope){${/([\=\(\+\-])/.test(searchContext) ? ret + searchContext : `${ret}${searchContext}(event)`}}`);
89
94
  };
90
95
  var createComment = function (renders, type, expression) {
91
96
  var comment = document.createComment(`${type} ${expression}`);
@@ -116,6 +121,33 @@ var initialComment = function (comment) {
116
121
  }
117
122
  };
118
123
 
124
+ class Repeater {
125
+ constructor(keyName, itemName, indexName, trackBy, srcName) {
126
+ this.keyName = keyName || "$key";
127
+ this.itemName = itemName || "$item";
128
+ this.indexName = indexName || "$index";
129
+ this.trackBy = trackBy;
130
+ this.srcName = srcName;
131
+ }
132
+ createScope(item, k, i) {
133
+ var scope = {
134
+ $key: k,
135
+ $item: item,
136
+ $index: i
137
+ };
138
+ if (this.keyName !== "$key") {
139
+ scope[this.keyName] = k;
140
+ }
141
+ if (this.itemName !== "$item") {
142
+ scope[this.itemName] = item;
143
+ }
144
+ if (this.indexName !== "$index") {
145
+ scope[this.indexName] = i;
146
+ }
147
+ return scope;
148
+ }
149
+ }
150
+
119
151
  var parseRepeat = function (expression) {
120
152
  var reg =
121
153
  // /////////////////////////////////////////// i // r ///////////////////////// o ///// a ///////////////////// t /////
@@ -139,23 +171,23 @@ var parseRepeat = function (expression) {
139
171
  }
140
172
  break;
141
173
  }
142
- return {
174
+ return new Repeater(
143
175
  keyName,
144
176
  itemName,
145
177
  indexName,
146
178
  trackBy,
147
179
  srcName
148
- };
180
+ );
149
181
  };
150
182
  var createRepeat = function (search, id = 0) {
151
183
  // 懒渲染
152
184
  // throw new Error("repeat is not supported! use list component instead");
153
- var [context, expression] = search;
154
- var res = parseRepeat(expression);
155
- if (!res) throw new Error(`不能识别循环表达式: ${expression} `);
156
- var { keyName, itemName, indexName, srcName, trackBy } = res;
185
+ var expression = search;
186
+ var repeater = parseRepeat(expression);
187
+ if (!repeater) throw new Error(`不能识别循环表达式: ${expression} `);
188
+ var { srcName, trackBy } = repeater;
157
189
  // 懒渲染
158
- var getter = createGetter([context, srcName]).bind(this);
190
+ var getter = createGetter(srcName).bind(this);
159
191
  var element = this, clonedElements = [], savedValue, savedOrigin;
160
192
  var renders = [function () {
161
193
  var result = getter();
@@ -174,16 +206,12 @@ var createRepeat = function (search, id = 0) {
174
206
  var $parentScopes = element.$parentScopes || [];
175
207
  var $struct = element.$struct;
176
208
  if (element.$scope) {
177
- $struct = extend({}, $struct, { context: $struct.context + `with(this.$parentScopes[${$parentScopes.length}])` }), $parentScopes = $parentScopes.slice(), $parentScopes.push(element.$scope);
209
+ $parentScopes = $parentScopes.slice(), $parentScopes.push(element.$scope);
178
210
  }
179
211
  var clonedElements1 = Object.create(null);
180
212
  var cloned = keys.map(function (key, cx) {
181
213
  var k = isArrayResult ? cx : key;
182
- var $scope = {
183
- [keyName || '$key']: k,
184
- [itemName || '$item']: result[k],
185
- [indexName || '$index']: cx
186
- };
214
+ var $scope = repeater.createScope(result[k], k, cx);
187
215
  if (trackBy) {
188
216
  k = seek($scope, trackBy);
189
217
  if (clonedElements[k]) {
@@ -211,7 +239,11 @@ var createRepeat = function (search, id = 0) {
211
239
  }, this);
212
240
  cloned.forEach(a => render(a));
213
241
  for (var k in clonedElements) {
214
- if (clonedElements1[k] !== clonedElements[k]) remove(clonedElements[k]);
242
+ if (clonedElements1[k] !== clonedElements[k]) {
243
+ var selected = clonedElements[k].selected;
244
+ remove(clonedElements[k]);
245
+ if (selected) { clonedElements1[k].selected = true; }
246
+ }
215
247
  }
216
248
  clonedElements = clonedElements1;
217
249
  this.with = cloned;
@@ -233,7 +265,7 @@ var createIf = function (search, id = 0) {
233
265
  if_top.push(elements);
234
266
  var savedValue;
235
267
  elements.parent = this.parentNode;
236
- elements.comment = search[1];
268
+ elements.comment = search;
237
269
  elements.renders = [function () {
238
270
  var shouldMount = -1;
239
271
  for (var cx = 0, dx = elements.length; cx < dx; cx += 2) {
@@ -328,13 +360,15 @@ var parseIfWithRepeat = function (ifExpression, repeatExpression) {
328
360
  };
329
361
  };
330
362
 
331
- var createStructure = function ({ name: ifkey, key, value: ifexp } = {}, { name: forkey, value: repeat } = {}, context) {
332
- var element = this;
333
- if (!ifkey) return element.removeAttribute(forkey), structures.repeat.call(element, [context, repeat]);
334
- if (!repeat) return element.removeAttribute(ifkey), structures[key].call(element, [context, ifexp]);
363
+ var renderStructure = function (element) {
364
+ var $struct = element.$struct;
365
+ if ($struct.if) var { name: ifkey, key, value: ifexp } = $struct.if;
366
+ if ($struct.repeat) var { name: forkey, value: repeat } = $struct.repeat;
367
+ if (!ifkey) return element.removeAttribute(forkey), structures.repeat.call(element, repeat);
368
+ if (!repeat) return element.removeAttribute(ifkey), structures[key].call(element, ifexp);
335
369
  if (!ifexp) {
336
370
  element.removeAttribute(ifkey);
337
- return structures[key].call(element, [context, ifexp]);
371
+ return structures[key].call(element, ifexp);
338
372
  }
339
373
  var { before, after } = parseIfWithRepeat(ifexp, repeat);
340
374
  element.removeAttribute(ifkey);
@@ -343,10 +377,10 @@ var createStructure = function ({ name: ifkey, key, value: ifexp } = {}, { name:
343
377
  }
344
378
  if (before.length > 0) {
345
379
  // 懒渲染
346
- return createIf.call(element, [context, before.join("&&")], null);
380
+ return createIf.call(element, before.join("&&"), null);
347
381
  } else {
348
382
  element.removeAttribute(forkey);
349
- return createRepeat.call(element, [context, repeat], null);
383
+ return createRepeat.call(element, repeat, null);
350
384
  }
351
385
  };
352
386
 
@@ -364,10 +398,10 @@ var structures = {
364
398
  }
365
399
  initIf(if_top.splice(cx + 1, if_top.length - cx - 1));
366
400
  var top = if_top[cx];
367
- if (search && search[1]) {
401
+ if (search && search) {
368
402
  var getter = createGetter(search).bind(this);
369
403
  }
370
- var comment = createComment.call(this, undefined, search[1] ? 'elseif' : 'else', search[1]);
404
+ var comment = createComment.call(this, undefined, search ? 'elseif' : 'else', search);
371
405
  top.push(comment, getter);
372
406
  },
373
407
  repeat(search) {
@@ -378,7 +412,7 @@ structures["else-if"] = structures.elseif = structures.else;
378
412
  structures["for-each"] = structures.foreach = structures.for = structures.each = structures.repeat;
379
413
  var createBinder = function (binder) {
380
414
  return function (search) {
381
- var getter = createGetter(search).bind(this);
415
+ var getter = createGetter(`(${search})`).bind(this);
382
416
  var oldValue;
383
417
  this.renders.push(function () {
384
418
  var value = getter();
@@ -430,9 +464,9 @@ var directives = {
430
464
  elem.style.display = value ? '' : 'none';
431
465
  }),
432
466
  style: createBinder(css),
433
- src([s, src]) {
467
+ src(src) {
434
468
  var parsedSrc = this.$src;
435
- return src2.call(this, [s, parsedSrc ? parsedSrc.srcName : src]);
469
+ return src2.call(this, parsedSrc ? parsedSrc.srcName : src);
436
470
  },
437
471
  model(search) {
438
472
  var getter = createGetter(search).bind(this);
@@ -454,13 +488,13 @@ var directives = {
454
488
  };
455
489
  if (/^input$/i.test(this.tagName) && /^checkbox$/i.test(this.type) || /^checkbox$/i.test(this.tagName)) {
456
490
  this.renders.push(setter || setter2.bind(this, 'checked'));
457
- var change = new Function(`${search[0]}with(this.$scope)${search[1]}=${getstr || "this.checked"}`).bind(this);
491
+ var change = getstr || "this.checked";
458
492
  } else if (("value" in this || this.getValue instanceof Function) && this.setValue instanceof Function) {
459
493
  this.renders.push(setter);
460
- var change = new Function(`${search[0]}with(this.$scope)${search[1]}=${getstr || "this.value"}`).bind(this);
494
+ var change = getstr || "this.value";
461
495
  } else if (/^(select|input|textarea)$/i.test(this.tagName) || "value" in this) {
462
496
  this.renders.push(setter || setter2.bind(this, 'value'));
463
- var change = new Function(`${search[0]}with(this.$scope)${search[1]}=${getstr || "this.value"}`).bind(this);
497
+ var change = getstr || "this.value";
464
498
  } else {
465
499
  this.renders.push(setter || function () {
466
500
  var value = getter();
@@ -469,24 +503,23 @@ var directives = {
469
503
  oldValue = value;
470
504
  if (html(this) !== value) html(this, value);
471
505
  });
472
- var change = new Function("html", `${search[0]}with(this.$scope)${search[1]}=${getstr || "'value' in this?this.value:html(this)"}`).bind(this, html);
506
+ var change = getstr || "'value' in this?this.value:this.innerHTML";
473
507
  }
474
508
  setter2 = null;
475
509
  var onchange = function () {
476
- change.call(this);
510
+ $eval.call(this, search + "=" + change, this.$scope);
477
511
  var value = getter();
478
512
  if (value === oldValue) {
479
513
  return;
480
514
  }
481
515
  oldValue = value;
482
- change.call(this, value);
483
516
  userChanged = true;
484
517
  };
485
518
  eventsBinders.forEach(on => on(this, onchange, true));
486
519
  },
487
520
 
488
521
  "class"(search) {
489
- var getter = createGetter(search).bind(this);
522
+ var getter = createGetter(`(${search})`).bind(this);
490
523
  var generatedClassNames = {};
491
524
  var oldValue;
492
525
  this.renders.push(function () {
@@ -560,13 +593,7 @@ var reject = function (e) { digest(); throw e };
560
593
  var createEmiter = function (on) {
561
594
  return function (key, search) {
562
595
  var parsedSrc = this.$src;
563
- var getter0 = createGetter(search, false), getter1;
564
- if (parsedSrc) {
565
- var scopes = this.$parentScopes;
566
- search = search.slice();
567
- search[0] += `with(this.$parentScopes[${scopes.length}])`;
568
- getter1 = createGetter(search, false);
569
- }
596
+ var getter = createGetter(search, false);
570
597
  var onkey;
571
598
  if (key === 'mounted' || key === 'mount') {
572
599
  onkey = on === once ? oncemount : onmounted;
@@ -599,12 +626,12 @@ var createEmiter = function (on) {
599
626
  var temp = this.$scope;
600
627
  this.$parentScopes.push(temp);
601
628
  this.$scope = scope;
602
- res = getter1.call(this, e);
629
+ res = getter.call(this, e);
603
630
  this.$parentScopes.pop();
604
631
  this.$scope = temp;
605
632
  }
606
633
  else {
607
- res = getter0.call(this, e);
634
+ res = getter.call(this, e);
608
635
  }
609
636
  if (res && isFunction(res.then)) res.then(digest, reject);
610
637
  return res;
@@ -633,8 +660,8 @@ function getFromScopes(key, scope, parentScopes) {
633
660
  }
634
661
 
635
662
  function renderElement(element, scope = element.$scope, parentScopes = element.$parentScopes, once) {
636
- if (!isNode(element) && element.length) {
637
- return Array.prototype.concat.apply([], element).map(function (element) {
663
+ if (isArrayLike(element)) {
664
+ return Array.prototype.slice.call(element).map(function (element) {
638
665
  return renderElement(element, scope, parentScopes, once);
639
666
  });
640
667
  }
@@ -642,13 +669,26 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
642
669
  return element;
643
670
  }
644
671
  if (!isNumber(element.renderid)) {
645
- let element1 = renderStructure(element, scope, parentScopes, once);
646
- if (element1 !== element) {
647
- element = element1;
672
+ element.renderid = 0;
673
+ element.$scope = scope;
674
+ if (!isEmpty(parentScopes) && !isArray(parentScopes)) {
675
+ throw new Error('父级作用域链应以数组的类型传入');
676
+ }
677
+ if (parentScopes) {
678
+ if (element.renderid && !element.$parentScopes || element.$parentScopes && element.$parentScopes.length !== parentScopes.length) {
679
+ throw new Error("父作用域链的长度必须相等着");
680
+ }
648
681
  }
649
- if (!element) return;
682
+ element.$parentScopes = parentScopes || [];
683
+ var s = createStructure(element);
684
+
685
+ if (isEmpty(s.once)) s.once = once;
686
+ element.$eval = $eval;
687
+ if (!element.$struct) console.log(element, element.$struct, element.renderid, s)
650
688
  }
651
- if (element.renderid < 0 || element.nodeType !== 1) {
689
+ if (element.renderid <= -1) element = renderStructure(element);
690
+ if (!element) return;
691
+ if (!element || element.renderid < 0 || element.nodeType !== 1) {
652
692
  return element;
653
693
  }
654
694
  var elementid = element.getAttribute("renderid") || element.getAttribute("elementid") || element.getAttribute("id");
@@ -665,7 +705,7 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
665
705
  if (parentNode.renderid > 1 || isMounted(parentNode)) element.renderid = 2;
666
706
  }
667
707
  element.renders = element.renders ? [].concat(element.renders) : [];
668
- var { ons, copys, attrs, props, binds, context: withContext, ids, once } = element.$struct;
708
+ var { ons, copys, attrs, props, binds, ids, once } = element.$struct;
669
709
  if (once) element.renderid = 9;
670
710
  if (binds.src) {
671
711
  element.$src = parseRepeat(binds.src);
@@ -709,14 +749,13 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
709
749
  if (replacer.renders) renders = renders.concat(replacer.renders);
710
750
  replacer.renders = renders;
711
751
  if (binds.src) replacer.$src = element.$src;
712
- delete element.$struct;
752
+ replacer.$eval = element.$eval;
713
753
  element = replacer;
714
754
  element.$scope = scope;
715
755
  element.$parentScopes = parentScopes;
716
756
  }
717
757
  }
718
758
  }
719
- delete element.$struct;
720
759
  if (element.children && element.children.length) renderElement(element.children, scope, parentScopes, once);
721
760
  if (!isFirstRender) return element;
722
761
  var renders = element.renders;
@@ -724,22 +763,22 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
724
763
  for (var k in binds) {
725
764
  if (k === 'src') continue;
726
765
  if (directives.hasOwnProperty(k)) {
727
- directives[k].call(element, [withContext, binds[k]])
766
+ directives[k].call(element, binds[k])
728
767
  }
729
768
  else {
730
- binders._.call(element, k, [withContext, binds[k]]);
769
+ binders._.call(element, k, binds[k]);
731
770
  }
732
771
  }
733
772
  for (var k in attrs) {
734
- binders[""].call(element, k, [withContext, attrs[k]]);
773
+ binders[""].call(element, k, attrs[k]);
735
774
  }
736
775
  for (var k in props) {
737
776
  try {
738
777
  if (element[k] !== props[k]) element[k] = props[k];
739
778
  } catch (e) { }
740
779
  }
741
- if (binds.src) directives.src.call(element, [withContext, binds.src]);
742
- ons.forEach(([on, key, value]) => on.call(element, key, [withContext, value]));
780
+ if (binds.src) directives.src.call(element, binds.src);
781
+ ons.forEach(([on, key, value]) => on.call(element, key, value));
743
782
  if (renders.length) element.renders.push.apply(element.renders, renders);
744
783
  if (element.renders.length) {
745
784
  if (element.renderid !== 9) {
@@ -758,25 +797,54 @@ function renderElement(element, scope = element.$scope, parentScopes = element.$
758
797
  }
759
798
  return element;
760
799
  }
761
- function renderStructure(element, scope, parentScopes = [], once) {
762
- // 处理结构流
763
- if (parentScopes !== null && !isArray(parentScopes)) {
764
- throw new Error('父级作用域链应以数组的类型传入');
800
+ var createEval = function (deep) {
801
+ var context = [];
802
+ while (deep-- > 0) {
803
+ context[deep] = `with(this.$parentScopes[${deep}])`;
765
804
  }
766
- element.$scope = scope;
767
- if (parentScopes) {
768
- if (element.renderid && !element.$parentScopes || element.$parentScopes && element.$parentScopes.length !== parentScopes.length) {
769
- return new Error("父作用域链的长度必须相等着");
770
- }
771
- element.$parentScopes = parentScopes;
805
+ return new Function("code", "event", `${context.join('')}with(this.$scope)return eval(code)`);
806
+ };
807
+ var evalcontexts = [createEval(0)];
808
+ function $eval(search, scope, event) {
809
+ var needpop = scope && scope !== this.$scope;
810
+ if (needpop) {
811
+ this.$parentScopes.push(this.$scope);
812
+ this.$scope = scope;
813
+ }
814
+ var length = this.$parentScopes ? this.$parentScopes.length : 0;
815
+ if (!evalcontexts[length]) evalcontexts[length] = createEval(length);
816
+ var eval2 = evalcontexts[length];
817
+ var res = eval2.call(this, search, event);
818
+ if (needpop) this.$scope = this.$parentScopes.pop();
819
+ return res;
820
+ }
821
+
822
+ class Struct {
823
+ constructor(ons, types, copys, binds, attrs, props, ids, once) {
824
+ this.ons = ons;
825
+ this.if = types.if;
826
+ this.repeat = types.repeat;
827
+ this.copys = copys;
828
+ this.binds = binds;
829
+ this.attrs = attrs;
830
+ this.props = props;
831
+ this.ids = ids;
832
+ this.once = once;
772
833
  }
773
- var attrs = [].concat.apply([], element.attributes);
774
- var withContext = parentScopes ? parentScopes.map((_, cx) => `with(this.$parentScopes[${cx}])`).join("") : '';
834
+ }
835
+
836
+
837
+ function createStructure(element) {
838
+ if (isArrayLike(element)) return Array.prototype.map.call(element, createStructure);
839
+ if (element.$struct) return element.$struct;
840
+ // 处理结构流
841
+ var attrs = Array.prototype.slice.call(element.attributes);
775
842
  var types = {};
776
843
  var emiter_reg = /^(?:(v|ng|on|once)?\-|v\-on\:|@|once|on)/i;
777
844
  var ons = [];
778
845
  var copys = [];
779
846
  var binds = {};
847
+ var once;
780
848
  var attr1 = {};
781
849
  var props = {};
782
850
  var ids = [];
@@ -815,7 +883,6 @@ function renderStructure(element, scope, parentScopes = [], once) {
815
883
  else element.renderid = -2;
816
884
  continue;
817
885
  }
818
- if (element.$struct) continue;
819
886
  // ng-html,ng-src,ng-text,ng-model,ng-style,ng-class,...
820
887
  var key = name.replace(/^(ng|v|[^\_\:\.]*?)\-|^[\:\_\.]|^v\-bind\:/i, "").toLowerCase();
821
888
  if (directives.hasOwnProperty(key) || /^([\_\:\.]|v\-bind\:)/.test(name)) {
@@ -850,9 +917,8 @@ function renderStructure(element, scope, parentScopes = [], once) {
850
917
  }
851
918
  if (props["zimoli"] || props["fresh"] || props["once"]) once = true;
852
919
  else if (props["refresh"] || props["digest"] || props["mount"]) once = false;
853
- if (!element.$struct) element.$struct = { ons, copys, binds, attrs: attr1, props, context: withContext, ids, once };
854
- if (element.renderid <= -1) return createStructure.call(element, types.if, types.repeat, withContext);
855
- return element;
920
+ element.$eval = $eval;
921
+ return element.$struct = new Struct(ons, types, copys, binds, attr1, props, ids, once);
856
922
  }
857
923
  var eagermount = false, renderlock = false;
858
924
  function render(element, scope, parentScopes, lazy = true) {
@@ -901,4 +967,5 @@ render.register = function (key, name) {
901
967
  register(key, name);
902
968
  }
903
969
  };
904
- render.getFromScopes = getFromScopes;
970
+ render.getFromScopes = getFromScopes;
971
+ render.struct = createStructure;
@@ -109,10 +109,18 @@ function select(target, list, removeOnSelect, direction) {
109
109
  on("keydown.enter")(target, pop);
110
110
  onremove(list, onlistremove);
111
111
  };
112
+ var setListValue = function () {
113
+ if (list.setVaLue instanceof Function) {
114
+ list.setVaLue(target.value);
115
+ }
116
+ else {
117
+ list.value = target.value;
118
+ }
119
+ };
112
120
  if (isNode(list)) {
113
121
  var initList = function () {
114
122
  bindEvent();
115
- list.value = target.value;
123
+ setListValue();
116
124
  initList = function () { };
117
125
  };
118
126
  var setIcon = function () {
@@ -121,24 +129,37 @@ function select(target, list, removeOnSelect, direction) {
121
129
  else if (target.$src) {
122
130
  var generator = getGenerator(target);
123
131
  var optionsMap = {};
132
+ var $key = 'key';
133
+ var $name = 'name';
134
+ var template = target.$template;
135
+ var isIndexedKey = false;
136
+ if (template) {
137
+ var { attrs, binds } = template.childNodes[0].$struct;
138
+ if (attrs.value) $key = attrs.value;
139
+ if ($key === target.$src.indexName || $key === target.$src.keyName) isIndexedKey = true;
140
+ $name = binds.bind || binds.html || binds.text || $name;
141
+ }
124
142
  var initList2 = function (src) {
125
- src.forEach(s => {
126
- optionsMap[s.key] = s;
143
+ if (isIndexedKey) optionsMap = src;
144
+ else src.forEach(s => {
145
+ optionsMap[seek(s, $key)] = s;
127
146
  if (isObject(s)) s.selected = s.key === target.value;
128
147
  });
129
148
  list = selectList(generator, src, !!target.multiple, !!target.editable);
130
- list.value = target.value;
149
+ setListValue();
131
150
  if (!target.multiple) {
132
151
  onclick(list, onlistclick);
133
152
  }
134
- if (target.value) {
135
- target.setValue(target.value);
136
- }
153
+ if (optionsMap[target.value]) target.setValue(target.value);
137
154
  bindEvent();
138
155
  };
139
156
  target.setValue = function (v) {
140
157
  var s = optionsMap[v];
141
- this.innerHTML = `<option selected value="${v}">${s ? s.name : ''}</option>`;
158
+ var name = s ? s.name : '';
159
+ if (s && template) {
160
+ name = this.$eval($name, this.$src.createScope(s, v, v));
161
+ }
162
+ this.innerHTML = `<option selected value="${v}">${name || ''}</option>`;
142
163
  this.value = v;
143
164
  if (s) s.selected = true;
144
165
  if (list) list.value = v;
@@ -180,6 +201,7 @@ function select(target, list, removeOnSelect, direction) {
180
201
  if (deepEqual.shallow(allOptions, savedOptions)) return;
181
202
  savedOptions = allOptions;
182
203
  list = selectList(allOptions, !!target.multiple, !!target.editable);
204
+ setListValue();
183
205
  if (!target.multiple) {
184
206
  onclick(list, onlistclick);
185
207
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.26.5",
3
+ "version": "3.26.6",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {