@form-create/element-ui 3.1.7 → 3.1.10

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,5 +1,5 @@
1
1
  /*!
2
- * @form-create/element-ui v3.1.7
2
+ * @form-create/element-ui v3.1.10
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -259,7 +259,7 @@
259
259
  delete props.value;
260
260
  return vue.createVNode(Type, vue.mergeProps(props, {
261
261
  "label": value,
262
- "key": name + index + opt.value
262
+ "key": name + index + '-' + opt.value
263
263
  }), {
264
264
  "default": function _default() {
265
265
  return [props.label || props.value || ''];
@@ -996,7 +996,7 @@
996
996
  delete props.value;
997
997
  return vue.createVNode(Type, vue.mergeProps(props, {
998
998
  "label": value,
999
- "key": name + index + opt.value
999
+ "key": name + index + '-' + opt.value
1000
1000
  }), {
1001
1001
  "default": function _default() {
1002
1002
  return [props.label || props.value || ''];
@@ -1048,7 +1048,7 @@
1048
1048
  "default": function _default() {
1049
1049
  return [_this.options().map(function (props, index) {
1050
1050
  return vue.createVNode(vue.resolveComponent("ElOption"), vue.mergeProps(props, {
1051
- "key": '' + index + props.value
1051
+ "key": '' + index + '-' + props.value
1052
1052
  }), null);
1053
1053
  }), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
1054
1054
  }
@@ -1506,14 +1506,22 @@
1506
1506
  Object.keys(this.cacheRule).forEach(function (v) {
1507
1507
  var item = _this.cacheRule[v];
1508
1508
 
1509
- if (n === o) {
1510
- deepExtend(item.rule, n);
1511
- } else {
1509
+ if (item.$f) {
1512
1510
  var val = item.$f.formData();
1513
- item.$f.once('reloading', function () {
1514
- item.$f.setValue(val);
1515
- });
1516
- item.rule = deepCopy(n);
1511
+
1512
+ if (n === o) {
1513
+ item.$f.deferSyncValue(function () {
1514
+ deepExtend(item.rule, n);
1515
+ item.$f.setValue(val);
1516
+ }, true);
1517
+ } else {
1518
+ var _val = item.$f.formData();
1519
+
1520
+ item.$f.once('reloading', function () {
1521
+ item.$f.setValue(_val);
1522
+ });
1523
+ item.rule = deepCopy(n);
1524
+ }
1517
1525
  }
1518
1526
  });
1519
1527
  },
@@ -2835,7 +2843,6 @@
2835
2843
  h.getCtxs(field).forEach(function (ctx) {
2836
2844
  h.$render.clearCache(ctx);
2837
2845
  ctx.rule.value = copy(ctx.defaultValue);
2838
- h.refreshControl(ctx);
2839
2846
  });
2840
2847
  });
2841
2848
  },
@@ -2886,6 +2893,9 @@
2886
2893
  h.nextRefresh();
2887
2894
  fn && invoke(fn);
2888
2895
  },
2896
+ deferSyncValue: function deferSyncValue(fn, sync) {
2897
+ h.deferSyncValue(fn, sync);
2898
+ },
2889
2899
  emit: function emit(name) {
2890
2900
  var _h$vm;
2891
2901
 
@@ -3177,7 +3187,9 @@
3177
3187
  }
3178
3188
 
3179
3189
  return function () {
3180
- return _this4.getCache(ctx).apply(void 0, arguments);
3190
+ var cache = _this4.getCache(ctx);
3191
+
3192
+ return cache && cache.apply(void 0, arguments);
3181
3193
  };
3182
3194
  } catch (e) {
3183
3195
  console.error(e);
@@ -3185,7 +3197,7 @@
3185
3197
  }
3186
3198
  },
3187
3199
  getModelField: function getModelField(ctx) {
3188
- return ctx.rule.modelField || ctx.parser.modelField || this.fc.modelFields[this.vNode.aliasMap[ctx.field]] || this.fc.modelFields[ctx.field] || this.fc.modelFields[ctx.originType] || 'modelValue';
3200
+ return ctx.rule.modelField || ctx.parser.modelField || this.fc.modelFields[this.vNode.aliasMap[ctx.type]] || this.fc.modelFields[ctx.type] || this.fc.modelFields[ctx.originType] || 'modelValue';
3189
3201
  },
3190
3202
  display: function display(vn) {
3191
3203
  var _this5 = this;
@@ -4677,9 +4689,13 @@
4677
4689
  $del(this.formData, id);
4678
4690
  $del(this.subForm, id);
4679
4691
  $del(this.vm.setupState.ctxInject, id);
4680
- input && $del(this.form, field);
4681
4692
  input && this.rmIdCtx(ctx, field, 'field');
4682
4693
  name && this.rmIdCtx(ctx, name, 'name');
4694
+
4695
+ if (input && !hasProperty(this.fieldCtx, field)) {
4696
+ $del(this.form, field);
4697
+ }
4698
+
4683
4699
  this.deferSyncValue(function () {
4684
4700
  if (!_this4.reloading) {
4685
4701
  if (ctx.parser.loadChildren !== false) {
@@ -6535,7 +6551,7 @@
6535
6551
  function elmFormCreate() {
6536
6552
  return FormCreateFactory({
6537
6553
  ui: 'element-ui',
6538
- version: '3.1.7',
6554
+ version: '3.1.10',
6539
6555
  manager: manager,
6540
6556
  extendApi: extendApi,
6541
6557
  install: install,