@form-create/element-ui 3.1.6 → 3.1.9

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.6
2
+ * @form-create/element-ui v3.1.9
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -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
  },
@@ -2886,6 +2894,9 @@
2886
2894
  h.nextRefresh();
2887
2895
  fn && invoke(fn);
2888
2896
  },
2897
+ deferSyncValue: function deferSyncValue(fn, sync) {
2898
+ h.deferSyncValue(fn, sync);
2899
+ },
2889
2900
  emit: function emit(name) {
2890
2901
  var _h$vm;
2891
2902
 
@@ -3177,7 +3188,9 @@
3177
3188
  }
3178
3189
 
3179
3190
  return function () {
3180
- return _this4.getCache(ctx).apply(void 0, arguments);
3191
+ var cache = _this4.getCache(ctx);
3192
+
3193
+ return cache && cache.apply(void 0, arguments);
3181
3194
  };
3182
3195
  } catch (e) {
3183
3196
  console.error(e);
@@ -3185,7 +3198,7 @@
3185
3198
  }
3186
3199
  },
3187
3200
  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';
3201
+ 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
3202
  },
3190
3203
  display: function display(vn) {
3191
3204
  var _this5 = this;
@@ -5542,7 +5555,7 @@
5542
5555
  });
5543
5556
  }
5544
5557
 
5545
- this.initOptions(this.options || {});
5558
+ this.initOptions(this.options.value);
5546
5559
  this.$handle.init();
5547
5560
  },
5548
5561
  isSub: function isSub() {
@@ -6070,8 +6083,10 @@
6070
6083
  makeInfo: function makeInfo(rule, uni) {
6071
6084
  var _this4 = this;
6072
6085
 
6073
- var titleProp = rule.title;
6074
- var infoProp = rule.info;
6086
+ var titleProp = _objectSpread2({}, rule.title);
6087
+
6088
+ var infoProp = _objectSpread2({}, rule.info);
6089
+
6075
6090
  var isTip = isTooltip(infoProp);
6076
6091
  var form = this.options.form;
6077
6092
  var children = [(titleProp.title || '') + (form.labelSuffix || form['label-suffix'] || '')];
@@ -6085,6 +6100,8 @@
6085
6100
  delete prop.props.icon;
6086
6101
  delete prop.props.show;
6087
6102
  delete prop.props.info;
6103
+ delete prop.props.align;
6104
+ delete prop.props["native"];
6088
6105
  var field = 'content';
6089
6106
 
6090
6107
  if (infoProp.info && !hasProperty(prop.props, field)) {
@@ -6106,11 +6123,16 @@
6106
6123
  })));
6107
6124
  }
6108
6125
 
6109
- return this.$r(mergeProps([titleProp, {
6126
+ var _prop = mergeProps([titleProp, {
6110
6127
  props: titleProp,
6111
6128
  key: "".concat(uni, "tit"),
6112
6129
  type: titleProp.type || 'span'
6113
- }]), children);
6130
+ }]);
6131
+
6132
+ delete _prop.props.show;
6133
+ delete _prop.props.title;
6134
+ delete _prop.props["native"];
6135
+ return this.$r(_prop, children);
6114
6136
  },
6115
6137
  makeCol: function makeCol(rule, uni, children) {
6116
6138
  var col = rule.col;
@@ -6166,6 +6188,9 @@
6166
6188
 
6167
6189
  var innerText = resetBtn.innerText;
6168
6190
  delete resetBtn.innerText;
6191
+ delete resetBtn.click;
6192
+ delete resetBtn.col;
6193
+ delete resetBtn.show;
6169
6194
  return this.$r({
6170
6195
  type: 'button',
6171
6196
  props: resetBtn,
@@ -6175,7 +6200,7 @@
6175
6200
  on: {
6176
6201
  click: function click() {
6177
6202
  var fApi = _this5.$handle.api;
6178
- resetBtn.click ? resetBtn.click(fApi) : fApi.resetFields();
6203
+ _this5.options.resetBtn.click ? _this5.options.resetBtn.click(fApi) : fApi.resetFields();
6179
6204
  }
6180
6205
  },
6181
6206
  key: "".concat(this.key, "b2")
@@ -6188,6 +6213,9 @@
6188
6213
 
6189
6214
  var innerText = submitBtn.innerText;
6190
6215
  delete submitBtn.innerText;
6216
+ delete submitBtn.click;
6217
+ delete submitBtn.col;
6218
+ delete submitBtn.show;
6191
6219
  return this.$r({
6192
6220
  type: 'button',
6193
6221
  props: submitBtn,
@@ -6197,7 +6225,7 @@
6197
6225
  on: {
6198
6226
  click: function click() {
6199
6227
  var fApi = _this6.$handle.api;
6200
- submitBtn.click ? submitBtn.click(fApi) : fApi.submit();
6228
+ _this6.options.submitBtn.click ? _this6.options.submitBtn.click(fApi) : fApi.submit();
6201
6229
  }
6202
6230
  },
6203
6231
  key: "".concat(this.key, "b1")
@@ -6520,7 +6548,7 @@
6520
6548
  function elmFormCreate() {
6521
6549
  return FormCreateFactory({
6522
6550
  ui: 'element-ui',
6523
- version: '3.1.6',
6551
+ version: '3.1.9',
6524
6552
  manager: manager,
6525
6553
  extendApi: extendApi,
6526
6554
  install: install,