@form-create/element-ui 3.1.8 → 3.1.11

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.8
2
+ * @form-create/element-ui v3.1.11
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -255,7 +255,7 @@ var Checkbox = defineComponent({
255
255
  delete props.value;
256
256
  return createVNode(Type, mergeProps$1(props, {
257
257
  "label": value,
258
- "key": name + index + opt.value
258
+ "key": name + index + '-' + opt.value
259
259
  }), {
260
260
  "default": function _default() {
261
261
  return [props.label || props.value || ''];
@@ -992,7 +992,7 @@ var Radio = defineComponent({
992
992
  delete props.value;
993
993
  return createVNode(Type, mergeProps$1(props, {
994
994
  "label": value,
995
- "key": name + index + opt.value
995
+ "key": name + index + '-' + opt.value
996
996
  }), {
997
997
  "default": function _default() {
998
998
  return [props.label || props.value || ''];
@@ -1044,7 +1044,7 @@ var Select = defineComponent({
1044
1044
  "default": function _default() {
1045
1045
  return [_this.options().map(function (props, index) {
1046
1046
  return createVNode(resolveComponent("ElOption"), mergeProps$1(props, {
1047
- "key": '' + index + props.value
1047
+ "key": '' + index + '-' + props.value
1048
1048
  }), null);
1049
1049
  }), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
1050
1050
  }
@@ -1502,14 +1502,22 @@ var Group = defineComponent({
1502
1502
  Object.keys(this.cacheRule).forEach(function (v) {
1503
1503
  var item = _this.cacheRule[v];
1504
1504
 
1505
- if (n === o) {
1506
- deepExtend(item.rule, n);
1507
- } else {
1505
+ if (item.$f) {
1508
1506
  var val = item.$f.formData();
1509
- item.$f.once('reloading', function () {
1510
- item.$f.setValue(val);
1511
- });
1512
- item.rule = deepCopy(n);
1507
+
1508
+ if (n === o) {
1509
+ item.$f.deferSyncValue(function () {
1510
+ deepExtend(item.rule, n);
1511
+ item.$f.setValue(val);
1512
+ }, true);
1513
+ } else {
1514
+ var _val = item.$f.formData();
1515
+
1516
+ item.$f.once('reloading', function () {
1517
+ item.$f.setValue(_val);
1518
+ });
1519
+ item.rule = deepCopy(n);
1520
+ }
1513
1521
  }
1514
1522
  });
1515
1523
  },
@@ -2831,7 +2839,6 @@ function Api(h) {
2831
2839
  h.getCtxs(field).forEach(function (ctx) {
2832
2840
  h.$render.clearCache(ctx);
2833
2841
  ctx.rule.value = copy(ctx.defaultValue);
2834
- h.refreshControl(ctx);
2835
2842
  });
2836
2843
  });
2837
2844
  },
@@ -2882,6 +2889,9 @@ function Api(h) {
2882
2889
  h.nextRefresh();
2883
2890
  fn && invoke(fn);
2884
2891
  },
2892
+ deferSyncValue: function deferSyncValue(fn, sync) {
2893
+ h.deferSyncValue(fn, sync);
2894
+ },
2885
2895
  emit: function emit(name) {
2886
2896
  var _h$vm;
2887
2897
 
@@ -3183,7 +3193,7 @@ function useRender$1(Render) {
3183
3193
  }
3184
3194
  },
3185
3195
  getModelField: function getModelField(ctx) {
3186
- 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';
3196
+ 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';
3187
3197
  },
3188
3198
  display: function display(vn) {
3189
3199
  var _this5 = this;
@@ -4156,6 +4166,7 @@ function useLoader(Handler) {
4156
4166
  }
4157
4167
 
4158
4168
  if (!validate.length) return false;
4169
+ var hideLst = [];
4159
4170
  var flag = false;
4160
4171
  this.deferSyncValue(function () {
4161
4172
  validate.reverse().forEach(function (_ref) {
@@ -4173,7 +4184,7 @@ function useLoader(Handler) {
4173
4184
  children: rule,
4174
4185
  valid: valid
4175
4186
  }) : ctx.ctrlRule.splice(ctx.ctrlRule.indexOf(ctrl), 1);
4176
- nextTick(function () {
4187
+ hideLst[valid ? 'push' : 'unshift'](function () {
4177
4188
  _this7.api.hidden(!valid, rule);
4178
4189
  });
4179
4190
  return;
@@ -4206,6 +4217,11 @@ function useLoader(Handler) {
4206
4217
  }
4207
4218
  });
4208
4219
  });
4220
+ hideLst.length && nextTick(function () {
4221
+ hideLst.forEach(function (v) {
4222
+ return v();
4223
+ });
4224
+ });
4209
4225
  this.vm.emit('control', ctx.origin, this.api);
4210
4226
  this.effect(ctx, 'control');
4211
4227
  return flag;
@@ -4675,9 +4691,13 @@ function useContext(Handler) {
4675
4691
  $del(this.formData, id);
4676
4692
  $del(this.subForm, id);
4677
4693
  $del(this.vm.setupState.ctxInject, id);
4678
- input && $del(this.form, field);
4679
4694
  input && this.rmIdCtx(ctx, field, 'field');
4680
4695
  name && this.rmIdCtx(ctx, name, 'name');
4696
+
4697
+ if (input && !hasProperty(this.fieldCtx, field)) {
4698
+ $del(this.form, field);
4699
+ }
4700
+
4681
4701
  this.deferSyncValue(function () {
4682
4702
  if (!_this4.reloading) {
4683
4703
  if (ctx.parser.loadChildren !== false) {
@@ -6477,7 +6497,7 @@ var required = {
6477
6497
  }, val);
6478
6498
 
6479
6499
  if (!validate.message) {
6480
- validate.message = rule.title + ' is required';
6500
+ validate.message = rule.title + '不能为空';
6481
6501
  }
6482
6502
 
6483
6503
  inject.getProp().validate = [validate];
@@ -6533,7 +6553,7 @@ function install(FormCreate) {
6533
6553
  function elmFormCreate() {
6534
6554
  return FormCreateFactory({
6535
6555
  ui: 'element-ui',
6536
- version: '3.1.8',
6556
+ version: '3.1.11',
6537
6557
  manager: manager,
6538
6558
  extendApi: extendApi,
6539
6559
  install: install,