@form-create/element-ui 3.1.13 → 3.1.15

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.13
2
+ * @form-create/element-ui v3.1.15
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -1497,7 +1497,7 @@
1497
1497
  form: vue.markRaw(this.formCreateInject.form.$form())
1498
1498
  };
1499
1499
  },
1500
- emits: ['update:modelValue', 'change', 'itemMounted', 'remove'],
1500
+ emits: ['update:modelValue', 'change', 'itemMounted', 'remove', 'add'],
1501
1501
  watch: {
1502
1502
  rule: {
1503
1503
  handler: function handler(n, o) {
@@ -1553,7 +1553,7 @@
1553
1553
 
1554
1554
  if (len < 0) {
1555
1555
  for (var i = len; i < 0; i++) {
1556
- this.addRule(n.length + i);
1556
+ this.addRule(n.length + i, true);
1557
1557
  }
1558
1558
 
1559
1559
  for (var _i = 0; _i < total; _i++) {
@@ -3004,7 +3004,7 @@
3004
3004
 
3005
3005
  var id$2 = 0;
3006
3006
  function uniqueId() {
3007
- return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id$2)).toString(36);
3007
+ return 'F' + Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id$2)).toString(36);
3008
3008
  }
3009
3009
 
3010
3010
  function deepSet(data, idx, val) {
@@ -4358,7 +4358,7 @@
4358
4358
  }
4359
4359
  },
4360
4360
  setFormData: function setFormData(ctx, value) {
4361
- $set(this.formData, ctx.id, value === null ? undefined : value);
4361
+ $set(this.formData, ctx.id, value);
4362
4362
  },
4363
4363
  getFormData: function getFormData(ctx) {
4364
4364
  return this.formData[ctx.id];
@@ -4648,6 +4648,8 @@
4648
4648
 
4649
4649
  _this.$render.clearCache(ctx);
4650
4650
 
4651
+ _this.refresh();
4652
+
4651
4653
  _this.watching = false;
4652
4654
  }, {
4653
4655
  deep: !flag,
@@ -4661,7 +4663,6 @@
4661
4663
  return val.value;
4662
4664
  }, function () {
4663
4665
  var formValue = ctx.parser.toFormValue(val.value, ctx);
4664
- formValue = formValue === null ? undefined : formValue;
4665
4666
 
4666
4667
  if (_this.isChange(ctx, formValue)) {
4667
4668
  _this.setValue(ctx, val.value, formValue, true);
@@ -4700,7 +4701,7 @@
4700
4701
 
4701
4702
  this.deferSyncValue(function () {
4702
4703
  o && o.forEach(function (child) {
4703
- if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__) {
4704
+ if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__ && child.__fc__.parent === ctx) {
4704
4705
  _this2.rmCtx(child.__fc__);
4705
4706
  }
4706
4707
  });
@@ -5998,6 +5999,13 @@
5998
5999
  }
5999
6000
  }
6000
6001
 
6002
+ function tidyRule(rule) {
6003
+ var _rule = _objectSpread2({}, rule);
6004
+
6005
+ delete _rule.children;
6006
+ return _rule;
6007
+ }
6008
+
6001
6009
  var manager = {
6002
6010
  validate: function validate() {
6003
6011
  var form = this.form();
@@ -6119,7 +6127,7 @@
6119
6127
  props: _objectSpread2(_objectSpread2({
6120
6128
  labelWidth: labelWidth === void 0 ? labelWidth : toString(labelWidth),
6121
6129
  label: isTitle ? rule.title.title : undefined
6122
- }, rule.wrap || {}), {}, {
6130
+ }, tidyRule(rule.wrap || {})), {}, {
6123
6131
  prop: ctx.id,
6124
6132
  rules: rule.validate
6125
6133
  }),
@@ -6157,7 +6165,7 @@
6157
6165
  if (!isFalse(infoProp.show) && (infoProp.info || infoProp["native"]) && !isFalse(infoProp.icon)) {
6158
6166
  var prop = {
6159
6167
  type: infoProp.type || 'popover',
6160
- props: _objectSpread2({}, infoProp),
6168
+ props: tidyRule(infoProp),
6161
6169
  key: "".concat(uni, "pop")
6162
6170
  };
6163
6171
  delete prop.props.icon;
@@ -6187,7 +6195,7 @@
6187
6195
  }
6188
6196
 
6189
6197
  var _prop = mergeProps([titleProp, {
6190
- props: titleProp,
6198
+ props: tidyRule(titleProp),
6191
6199
  key: "".concat(uni, "tit"),
6192
6200
  type: titleProp.type || 'span'
6193
6201
  }]);
@@ -6612,7 +6620,7 @@
6612
6620
  function elmFormCreate() {
6613
6621
  return FormCreateFactory({
6614
6622
  ui: 'element-ui',
6615
- version: '3.1.13',
6623
+ version: '3.1.15',
6616
6624
  manager: manager,
6617
6625
  extendApi: extendApi,
6618
6626
  install: install,