@form-create/element-ui 3.2.6 → 3.2.7

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.2.6
2
+ * @form-create/element-ui v3.2.7
3
3
  * (c) 2018-2024 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -1349,6 +1349,7 @@
1349
1349
  previewMask: undefined,
1350
1350
  onPreview: Function,
1351
1351
  modalTitle: String,
1352
+ listType: String,
1352
1353
  modelValue: [Array, String]
1353
1354
  },
1354
1355
  emits: ['update:modelValue', 'change', 'remove', 'fc.el'],
@@ -1372,7 +1373,7 @@
1372
1373
  if (this.onPreview) {
1373
1374
  this.onPreview.apply(this, arguments);
1374
1375
  } else {
1375
- if ('text' === this.$attrs.listType) {
1376
+ if ('text' === this.listType) {
1376
1377
  window.open(file.url);
1377
1378
  } else {
1378
1379
  this.previewImage = file.url;
@@ -1412,9 +1413,9 @@
1412
1413
  return vue.createVNode("div", {
1413
1414
  "class": "_fc-upload"
1414
1415
  }, [vue.createVNode(vue.resolveComponent("ElUpload"), vue.mergeProps({
1415
- "key": len,
1416
- "list-type": "picture-card"
1416
+ "key": len
1417
1417
  }, this.$attrs, {
1418
+ "list-type": this.listType || 'picture-card',
1418
1419
  "class": {
1419
1420
  '_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= len : false
1420
1421
  },
@@ -1425,7 +1426,7 @@
1425
1426
  "ref": "upload"
1426
1427
  }), _objectSpread2({
1427
1428
  "default": function _default() {
1428
- return [(_this$$slots$default = (_this$$slots = _this.$slots)["default"]) !== null && _this$$slots$default !== void 0 && _this$$slots$default.call(_this$$slots) || ['text', 'picture'].indexOf(_this.$attrs.listType) === -1 ? vue.createVNode(vue.resolveComponent("ElIcon"), null, {
1429
+ return [(_this$$slots$default = (_this$$slots = _this.$slots)["default"]) !== null && _this$$slots$default !== void 0 && _this$$slots$default.call(_this$$slots) || ['text', 'picture'].indexOf(_this.listType) === -1 ? vue.createVNode(vue.resolveComponent("ElIcon"), null, {
1429
1430
  "default": function _default() {
1430
1431
  return [vue.createVNode(script$1, null, null)];
1431
1432
  }
@@ -2117,7 +2118,7 @@
2117
2118
  }
2118
2119
  },
2119
2120
  extendOption: Boolean,
2120
- driver: String,
2121
+ driver: [String, Object],
2121
2122
  modelValue: Object,
2122
2123
  disabled: {
2123
2124
  type: Boolean,
@@ -2127,6 +2128,7 @@
2127
2128
  type: Boolean,
2128
2129
  "default": undefined
2129
2130
  },
2131
+ index: [String, Number],
2130
2132
  api: Object,
2131
2133
  name: String,
2132
2134
  subForm: {
@@ -2292,7 +2294,6 @@
2292
2294
  if (JSON.stringify(n || {}) === data.updateValue) return;
2293
2295
 
2294
2296
  if (fapi.config.forceCoverValue) {
2295
- fc.$handle.appendData = {};
2296
2297
  fapi.coverValue(n || {});
2297
2298
  } else {
2298
2299
  fapi.setValue(n || {});
@@ -2300,6 +2301,18 @@
2300
2301
  }, {
2301
2302
  deep: true
2302
2303
  });
2304
+ vue.watch(function () {
2305
+ return props.index;
2306
+ }, function () {
2307
+ fapi.coverValue({});
2308
+ vue.nextTick(function () {
2309
+ vue.nextTick(function () {
2310
+ fapi.clearValidateState();
2311
+ });
2312
+ });
2313
+ }, {
2314
+ flush: 'sync'
2315
+ });
2303
2316
  return _objectSpread2(_objectSpread2({
2304
2317
  fc: vue.markRaw(fc),
2305
2318
  parent: parent ? vue.markRaw(parent) : parent,
@@ -3013,6 +3026,7 @@
3013
3026
  var data = _objectSpread2({}, formData || {});
3014
3027
 
3015
3028
  h.deferSyncValue(function () {
3029
+ h.appendData = {};
3016
3030
  api.fields().forEach(function (key) {
3017
3031
  var ctxs = h.fieldCtx[key];
3018
3032
 
@@ -3025,7 +3039,7 @@
3025
3039
  }
3026
3040
  });
3027
3041
  extend(h.appendData, data);
3028
- });
3042
+ }, true);
3029
3043
  },
3030
3044
  setValue: function setValue(field) {
3031
3045
  var formData = field;
@@ -3038,7 +3052,7 @@
3038
3052
  ctx.rule.value = formData[key];
3039
3053
  });
3040
3054
  });
3041
- });
3055
+ }, true);
3042
3056
  },
3043
3057
  removeField: function removeField(field) {
3044
3058
  var ctx = h.getCtx(field);
@@ -5219,7 +5233,7 @@
5219
5233
  this.deferSyncFn = null;
5220
5234
 
5221
5235
  if (fn.sync) {
5222
- this.syncValue();
5236
+ this.syncForm();
5223
5237
  }
5224
5238
  }
5225
5239
  },
@@ -6844,7 +6858,7 @@
6844
6858
  }
6845
6859
 
6846
6860
  if (this.vm.props.driver) {
6847
- this.renderDriver = this.drivers[this.vm.props.driver];
6861
+ this.renderDriver = _typeof(this.vm.props.driver) === 'object' ? this.vm.props.driver : this.drivers[this.vm.props.driver];
6848
6862
  }
6849
6863
 
6850
6864
  if (!this.renderDriver && this.vm.setupState.parent) {
@@ -8146,7 +8160,7 @@
8146
8160
  function elmFormCreate() {
8147
8161
  return FormCreateFactory({
8148
8162
  ui: 'element-ui',
8149
- version: '3.2.6',
8163
+ version: '3.2.7',
8150
8164
  manager: manager,
8151
8165
  extendApi: extendApi,
8152
8166
  install: install,