@form-create/element-ui 2.5.21 → 2.5.24

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 v2.5.21
2
+ * @form-create/element-ui v2.5.24
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -320,7 +320,7 @@
320
320
  delete props.value;
321
321
  return h(Type, {
322
322
  "props": _objectSpread2({}, props),
323
- "key": Type + index + opt.value
323
+ "key": Type + index + '-' + opt.value
324
324
  });
325
325
  }), getSlot(this.$slots)]);
326
326
  }
@@ -876,7 +876,7 @@
876
876
  delete props.value;
877
877
  return h(Type, {
878
878
  "props": _objectSpread2({}, props),
879
- "key": Type + index + opt.value
879
+ "key": Type + index + '-' + opt.value
880
880
  });
881
881
  }), getSlot(this.$slots)]);
882
882
  }
@@ -938,7 +938,7 @@
938
938
  var slot = props.slot;
939
939
  return h("ElOption", {
940
940
  "props": _objectSpread2({}, props),
941
- "key": '' + index + props.value
941
+ "key": '' + index + '-' + props.value
942
942
  }, [slot ? h("template", {
943
943
  "slot": props.slotName || 'default'
944
944
  }, [is.Function(slot) ? props.slot(h) : slot]) : null]);
@@ -1415,14 +1415,20 @@
1415
1415
  var _this = this;
1416
1416
  Object.keys(this.cacheRule).forEach(function (v) {
1417
1417
  var item = _this.cacheRule[v];
1418
- if (n === o) {
1419
- deepExtend(item.rule, n);
1420
- } else {
1418
+ if (item.$f) {
1421
1419
  var val = item.$f.formData();
1422
- item.$f.once('reload', function () {
1423
- item.$f.setValue(val);
1424
- });
1425
- item.rule = deepCopy(n);
1420
+ if (n === o) {
1421
+ item.$f.deferSyncValue(function () {
1422
+ deepExtend(item.rule, n);
1423
+ item.$f.setValue(val);
1424
+ }, true);
1425
+ } else {
1426
+ var _val = item.$f.formData();
1427
+ item.$f.once('reloading', function () {
1428
+ item.$f.setValue(_val);
1429
+ });
1430
+ item.rule = deepCopy(n);
1431
+ }
1426
1432
  }
1427
1433
  });
1428
1434
  },
@@ -2554,7 +2560,6 @@
2554
2560
  h.getCtxs(field).forEach(function (ctx) {
2555
2561
  h.$render.clearCache(ctx);
2556
2562
  ctx.rule.value = copy(ctx.defaultValue);
2557
- h.refreshControl(ctx);
2558
2563
  });
2559
2564
  });
2560
2565
  },
@@ -2610,6 +2615,9 @@
2610
2615
  }
2611
2616
  (_h$vm = h.vm).$emit.apply(_h$vm, [name].concat(args));
2612
2617
  },
2618
+ deferSyncValue: function deferSyncValue(fn, sync) {
2619
+ h.deferSyncValue(fn, sync);
2620
+ },
2613
2621
  helper: {
2614
2622
  tidyFields: tidyFields,
2615
2623
  props: props
@@ -2953,6 +2961,8 @@
2953
2961
  vn.data.style.push({
2954
2962
  display: 'none'
2955
2963
  });
2964
+ } else if (is.String(vn.data.style)) {
2965
+ vn.data.style += ';display:none;';
2956
2966
  } else {
2957
2967
  vn.data.style = [vn.data.style, {
2958
2968
  display: 'none'
@@ -3686,6 +3696,7 @@
3686
3696
  if (_ret === "continue") continue;
3687
3697
  }
3688
3698
  if (!validate.length) return false;
3699
+ var hideLst = [];
3689
3700
  var flag = false;
3690
3701
  this.deferSyncValue(function () {
3691
3702
  validate.reverse().forEach(function (_ref) {
@@ -3702,7 +3713,7 @@
3702
3713
  children: rule,
3703
3714
  valid: valid
3704
3715
  }) : ctx.ctrlRule.splice(ctx.ctrlRule.indexOf(ctrl), 1);
3705
- _this7.vm.$nextTick(function () {
3716
+ hideLst[valid ? 'push' : 'unshift'](function () {
3706
3717
  _this7.api.hidden(!valid, rule);
3707
3718
  });
3708
3719
  return;
@@ -3732,6 +3743,11 @@
3732
3743
  }
3733
3744
  });
3734
3745
  });
3746
+ hideLst.length && this.vm.$nextTick(function () {
3747
+ hideLst.forEach(function (v) {
3748
+ return v();
3749
+ });
3750
+ });
3735
3751
  this.vm.$emit('control', ctx.origin, this.api);
3736
3752
  this.effect(ctx, 'control');
3737
3753
  return flag;
@@ -3760,7 +3776,7 @@
3760
3776
  _this8.loadRule();
3761
3777
  _this8.reloading = false;
3762
3778
  _this8.refresh();
3763
- _this8.vm.$emit('reload', _this8.api);
3779
+ _this8.vm.$emit('reloading', _this8.api);
3764
3780
  });
3765
3781
  this.bus.$off('next-tick', this.nextReload);
3766
3782
  this.bus.$once('next-tick', this.nextReload);
@@ -4117,9 +4133,11 @@
4117
4133
  $del(this.formData, id);
4118
4134
  $del(this.subForm, id);
4119
4135
  $del(ctx, 'cacheValue');
4120
- input && $del(this.form, field);
4121
4136
  input && this.rmIdCtx(ctx, field, 'field');
4122
4137
  name && this.rmIdCtx(ctx, name, 'name');
4138
+ if (input && !hasProperty(this.fieldCtx, field)) {
4139
+ $del(this.form, field);
4140
+ }
4123
4141
  this.deferSyncValue(function () {
4124
4142
  if (!_this3.reloading) {
4125
4143
  if (ctx.parser.loadChildren !== false) {
@@ -4580,7 +4598,7 @@
4580
4598
  }
4581
4599
  }, val);
4582
4600
  if (!validate.message) {
4583
- validate.message = rule.title + ' is required';
4601
+ validate.message = rule.title + '不能为空';
4584
4602
  }
4585
4603
  inject.getProp().validate = [validate];
4586
4604
  }
@@ -5776,7 +5794,7 @@
5776
5794
  function elmFormCreate() {
5777
5795
  return FormCreateFactory({
5778
5796
  ui: "".concat("element-ui"),
5779
- version: "".concat("2.5.21"),
5797
+ version: "".concat("2.5.24"),
5780
5798
  manager: manager,
5781
5799
  extendApi: extendApi,
5782
5800
  install: install,