@form-create/iview 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/iview v2.5.21
2
+ * @form-create/iview 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.
@@ -317,7 +317,7 @@
317
317
  delete props.value;
318
318
  return h("Checkbox", {
319
319
  "props": _objectSpread2({}, props),
320
- "key": '' + index + opt.value
320
+ "key": '' + index + '-' + opt.value
321
321
  });
322
322
  }), getSlot(this.$slots)]);
323
323
  }
@@ -865,7 +865,7 @@
865
865
  delete props.value;
866
866
  return h("Radio", {
867
867
  "props": _objectSpread2({}, props),
868
- "key": '' + index + opt.value
868
+ "key": '' + index + '-' + opt.value
869
869
  });
870
870
  }), getSlot(this.$slots)]);
871
871
  }
@@ -927,7 +927,7 @@
927
927
  var slot = props.slot;
928
928
  return h("Option", {
929
929
  "props": _objectSpread2({}, props),
930
- "key": '' + index + props.value
930
+ "key": '' + index + '-' + props.value
931
931
  }, [slot ? h("template", {
932
932
  "slot": props.slotName || 'default'
933
933
  }, [is.Function(slot) ? props.slot(h) : slot]) : null]);
@@ -1405,14 +1405,20 @@
1405
1405
  var _this = this;
1406
1406
  Object.keys(this.cacheRule).forEach(function (v) {
1407
1407
  var item = _this.cacheRule[v];
1408
- if (n === o) {
1409
- deepExtend(item.rule, n);
1410
- } else {
1408
+ if (item.$f) {
1411
1409
  var val = item.$f.formData();
1412
- item.$f.once('reload', function () {
1413
- item.$f.setValue(val);
1414
- });
1415
- item.rule = deepCopy(n);
1410
+ if (n === o) {
1411
+ item.$f.deferSyncValue(function () {
1412
+ deepExtend(item.rule, n);
1413
+ item.$f.setValue(val);
1414
+ }, true);
1415
+ } else {
1416
+ var _val = item.$f.formData();
1417
+ item.$f.once('reloading', function () {
1418
+ item.$f.setValue(_val);
1419
+ });
1420
+ item.rule = deepCopy(n);
1421
+ }
1416
1422
  }
1417
1423
  });
1418
1424
  },
@@ -2560,7 +2566,6 @@
2560
2566
  h.getCtxs(field).forEach(function (ctx) {
2561
2567
  h.$render.clearCache(ctx);
2562
2568
  ctx.rule.value = copy(ctx.defaultValue);
2563
- h.refreshControl(ctx);
2564
2569
  });
2565
2570
  });
2566
2571
  },
@@ -2616,6 +2621,9 @@
2616
2621
  }
2617
2622
  (_h$vm = h.vm).$emit.apply(_h$vm, [name].concat(args));
2618
2623
  },
2624
+ deferSyncValue: function deferSyncValue(fn, sync) {
2625
+ h.deferSyncValue(fn, sync);
2626
+ },
2619
2627
  helper: {
2620
2628
  tidyFields: tidyFields,
2621
2629
  props: props
@@ -2959,6 +2967,8 @@
2959
2967
  vn.data.style.push({
2960
2968
  display: 'none'
2961
2969
  });
2970
+ } else if (is.String(vn.data.style)) {
2971
+ vn.data.style += ';display:none;';
2962
2972
  } else {
2963
2973
  vn.data.style = [vn.data.style, {
2964
2974
  display: 'none'
@@ -3692,6 +3702,7 @@
3692
3702
  if (_ret === "continue") continue;
3693
3703
  }
3694
3704
  if (!validate.length) return false;
3705
+ var hideLst = [];
3695
3706
  var flag = false;
3696
3707
  this.deferSyncValue(function () {
3697
3708
  validate.reverse().forEach(function (_ref) {
@@ -3708,7 +3719,7 @@
3708
3719
  children: rule,
3709
3720
  valid: valid
3710
3721
  }) : ctx.ctrlRule.splice(ctx.ctrlRule.indexOf(ctrl), 1);
3711
- _this7.vm.$nextTick(function () {
3722
+ hideLst[valid ? 'push' : 'unshift'](function () {
3712
3723
  _this7.api.hidden(!valid, rule);
3713
3724
  });
3714
3725
  return;
@@ -3738,6 +3749,11 @@
3738
3749
  }
3739
3750
  });
3740
3751
  });
3752
+ hideLst.length && this.vm.$nextTick(function () {
3753
+ hideLst.forEach(function (v) {
3754
+ return v();
3755
+ });
3756
+ });
3741
3757
  this.vm.$emit('control', ctx.origin, this.api);
3742
3758
  this.effect(ctx, 'control');
3743
3759
  return flag;
@@ -3766,7 +3782,7 @@
3766
3782
  _this8.loadRule();
3767
3783
  _this8.reloading = false;
3768
3784
  _this8.refresh();
3769
- _this8.vm.$emit('reload', _this8.api);
3785
+ _this8.vm.$emit('reloading', _this8.api);
3770
3786
  });
3771
3787
  this.bus.$off('next-tick', this.nextReload);
3772
3788
  this.bus.$once('next-tick', this.nextReload);
@@ -4123,9 +4139,11 @@
4123
4139
  $del(this.formData, id);
4124
4140
  $del(this.subForm, id);
4125
4141
  $del(ctx, 'cacheValue');
4126
- input && $del(this.form, field);
4127
4142
  input && this.rmIdCtx(ctx, field, 'field');
4128
4143
  name && this.rmIdCtx(ctx, name, 'name');
4144
+ if (input && !hasProperty(this.fieldCtx, field)) {
4145
+ $del(this.form, field);
4146
+ }
4129
4147
  this.deferSyncValue(function () {
4130
4148
  if (!_this3.reloading) {
4131
4149
  if (ctx.parser.loadChildren !== false) {
@@ -4586,7 +4604,7 @@
4586
4604
  }
4587
4605
  }, val);
4588
4606
  if (!validate.message) {
4589
- validate.message = rule.title + ' is required';
4607
+ validate.message = rule.title + '不能为空';
4590
4608
  }
4591
4609
  inject.getProp().validate = [validate];
4592
4610
  }
@@ -5821,7 +5839,7 @@
5821
5839
  function ivuFormCreate() {
5822
5840
  return FormCreateFactory({
5823
5841
  ui: "".concat("iview"),
5824
- version: "".concat("2.5.21"),
5842
+ version: "".concat("2.5.24"),
5825
5843
  manager: manager,
5826
5844
  install: install,
5827
5845
  extendApi: extendApi,