@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.
@@ -1345,6 +1345,7 @@ var Upload = defineComponent({
1345
1345
  previewMask: undefined,
1346
1346
  onPreview: Function,
1347
1347
  modalTitle: String,
1348
+ listType: String,
1348
1349
  modelValue: [Array, String]
1349
1350
  },
1350
1351
  emits: ['update:modelValue', 'change', 'remove', 'fc.el'],
@@ -1368,7 +1369,7 @@ var Upload = defineComponent({
1368
1369
  if (this.onPreview) {
1369
1370
  this.onPreview.apply(this, arguments);
1370
1371
  } else {
1371
- if ('text' === this.$attrs.listType) {
1372
+ if ('text' === this.listType) {
1372
1373
  window.open(file.url);
1373
1374
  } else {
1374
1375
  this.previewImage = file.url;
@@ -1408,9 +1409,9 @@ var Upload = defineComponent({
1408
1409
  return createVNode("div", {
1409
1410
  "class": "_fc-upload"
1410
1411
  }, [createVNode(resolveComponent("ElUpload"), mergeProps$1({
1411
- "key": len,
1412
- "list-type": "picture-card"
1412
+ "key": len
1413
1413
  }, this.$attrs, {
1414
+ "list-type": this.listType || 'picture-card',
1414
1415
  "class": {
1415
1416
  '_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= len : false
1416
1417
  },
@@ -1421,7 +1422,7 @@ var Upload = defineComponent({
1421
1422
  "ref": "upload"
1422
1423
  }), _objectSpread2({
1423
1424
  "default": function _default() {
1424
- 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 ? createVNode(resolveComponent("ElIcon"), null, {
1425
+ 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 ? createVNode(resolveComponent("ElIcon"), null, {
1425
1426
  "default": function _default() {
1426
1427
  return [createVNode(script$1, null, null)];
1427
1428
  }
@@ -2113,7 +2114,7 @@ function $FormCreate(FormCreate, components, directives) {
2113
2114
  }
2114
2115
  },
2115
2116
  extendOption: Boolean,
2116
- driver: String,
2117
+ driver: [String, Object],
2117
2118
  modelValue: Object,
2118
2119
  disabled: {
2119
2120
  type: Boolean,
@@ -2123,6 +2124,7 @@ function $FormCreate(FormCreate, components, directives) {
2123
2124
  type: Boolean,
2124
2125
  "default": undefined
2125
2126
  },
2127
+ index: [String, Number],
2126
2128
  api: Object,
2127
2129
  name: String,
2128
2130
  subForm: {
@@ -2288,7 +2290,6 @@ function $FormCreate(FormCreate, components, directives) {
2288
2290
  if (JSON.stringify(n || {}) === data.updateValue) return;
2289
2291
 
2290
2292
  if (fapi.config.forceCoverValue) {
2291
- fc.$handle.appendData = {};
2292
2293
  fapi.coverValue(n || {});
2293
2294
  } else {
2294
2295
  fapi.setValue(n || {});
@@ -2296,6 +2297,18 @@ function $FormCreate(FormCreate, components, directives) {
2296
2297
  }, {
2297
2298
  deep: true
2298
2299
  });
2300
+ watch(function () {
2301
+ return props.index;
2302
+ }, function () {
2303
+ fapi.coverValue({});
2304
+ nextTick(function () {
2305
+ nextTick(function () {
2306
+ fapi.clearValidateState();
2307
+ });
2308
+ });
2309
+ }, {
2310
+ flush: 'sync'
2311
+ });
2299
2312
  return _objectSpread2(_objectSpread2({
2300
2313
  fc: markRaw(fc),
2301
2314
  parent: parent ? markRaw(parent) : parent,
@@ -3009,6 +3022,7 @@ function Api(h) {
3009
3022
  var data = _objectSpread2({}, formData || {});
3010
3023
 
3011
3024
  h.deferSyncValue(function () {
3025
+ h.appendData = {};
3012
3026
  api.fields().forEach(function (key) {
3013
3027
  var ctxs = h.fieldCtx[key];
3014
3028
 
@@ -3021,7 +3035,7 @@ function Api(h) {
3021
3035
  }
3022
3036
  });
3023
3037
  extend(h.appendData, data);
3024
- });
3038
+ }, true);
3025
3039
  },
3026
3040
  setValue: function setValue(field) {
3027
3041
  var formData = field;
@@ -3034,7 +3048,7 @@ function Api(h) {
3034
3048
  ctx.rule.value = formData[key];
3035
3049
  });
3036
3050
  });
3037
- });
3051
+ }, true);
3038
3052
  },
3039
3053
  removeField: function removeField(field) {
3040
3054
  var ctx = h.getCtx(field);
@@ -5215,7 +5229,7 @@ function useInput(Handler) {
5215
5229
  this.deferSyncFn = null;
5216
5230
 
5217
5231
  if (fn.sync) {
5218
- this.syncValue();
5232
+ this.syncForm();
5219
5233
  }
5220
5234
  }
5221
5235
  },
@@ -6840,7 +6854,7 @@ function FormCreateFactory(config) {
6840
6854
  }
6841
6855
 
6842
6856
  if (this.vm.props.driver) {
6843
- this.renderDriver = this.drivers[this.vm.props.driver];
6857
+ this.renderDriver = _typeof(this.vm.props.driver) === 'object' ? this.vm.props.driver : this.drivers[this.vm.props.driver];
6844
6858
  }
6845
6859
 
6846
6860
  if (!this.renderDriver && this.vm.setupState.parent) {
@@ -8142,7 +8156,7 @@ function install(FormCreate) {
8142
8156
  function elmFormCreate() {
8143
8157
  return FormCreateFactory({
8144
8158
  ui: 'element-ui',
8145
- version: '3.2.6',
8159
+ version: '3.2.7',
8146
8160
  manager: manager,
8147
8161
  extendApi: extendApi,
8148
8162
  install: install,