@form-create/element-ui 2.5.24 → 2.5.25

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 v2.5.24
2
+ * @form-create/element-ui v2.5.25
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -307,10 +307,11 @@
307
307
  render: function render() {
308
308
  var _this2 = this;
309
309
  var h = arguments[0];
310
- return h("ElCheckboxGroup", helper([{}, this.formCreateInject.prop, {
311
- "attrs": {
312
- "value": this.trueValue
313
- },
310
+ return h("ElCheckboxGroup", helper([{}, this.formCreateInject.prop, {}, {
311
+ "props": {
312
+ value: this.trueValue
313
+ }
314
+ }, {
314
315
  "on": {
315
316
  "input": this.onInput
316
317
  }
@@ -318,10 +319,11 @@
318
319
  var props = _objectSpread2({}, opt);
319
320
  var Type = _this2.type === 'button' ? 'ElCheckboxButton' : 'ElCheckbox';
320
321
  delete props.value;
321
- return h(Type, {
322
- "props": _objectSpread2({}, props),
322
+ return h(Type, helper([{}, {
323
+ "props": props
324
+ }, {
323
325
  "key": Type + index + '-' + opt.value
324
- });
326
+ }]));
325
327
  }), getSlot(this.$slots)]);
326
328
  }
327
329
  };
@@ -762,36 +764,37 @@
762
764
  });
763
765
  return h("div", {
764
766
  "class": "_fc-frame"
765
- }, [node, h("el-dialog", {
766
- "attrs": {
767
- "appendToBody": true,
768
- "modal": this.previewMask,
769
- "title": modalTitle,
770
- "visible": this.previewVisible
771
- },
767
+ }, [node, h("el-dialog", helper([{}, {
768
+ "props": {
769
+ appendToBody: true,
770
+ modal: this.previewMask,
771
+ title: modalTitle,
772
+ visible: this.previewVisible
773
+ }
774
+ }, {
772
775
  "on": {
773
776
  "close": this.handleCancel
774
777
  }
775
- }, [h("img", {
778
+ }]), [h("img", {
776
779
  "style": "width: 100%",
777
780
  "attrs": {
778
781
  "src": this.previewImage
779
782
  }
780
- })]), h("el-dialog", {
781
- "attrs": {
782
- "appendToBody": true,
783
- "visible": this.frameVisible
784
- },
785
- "props": _objectSpread2({}, _objectSpread2({
783
+ })]), h("el-dialog", helper([{}, {
784
+ "props": _objectSpread2(_objectSpread2({
786
785
  width: width,
787
- title: title
788
- }, this.modal)),
786
+ title: title,
787
+ appendToBody: true
788
+ }, this.modal), {}, {
789
+ visible: this.frameVisible
790
+ })
791
+ }, {
789
792
  "on": {
790
793
  "close": function close() {
791
794
  return _this9.closeModel(true);
792
795
  }
793
796
  }
794
- }, [this.frameVisible || !this.reload ? h("iframe", {
797
+ }]), [this.frameVisible || !this.reload ? h("iframe", {
795
798
  "ref": "frame",
796
799
  "attrs": {
797
800
  "src": src,
@@ -863,10 +866,11 @@
863
866
  render: function render() {
864
867
  var _this2 = this;
865
868
  var h = arguments[0];
866
- return h("ElRadioGroup", helper([{}, this.formCreateInject.prop, {
867
- "attrs": {
868
- "value": this.trueValue
869
- },
869
+ return h("ElRadioGroup", helper([{}, this.formCreateInject.prop, {}, {
870
+ "props": {
871
+ value: this.trueValue
872
+ }
873
+ }, {
870
874
  "on": {
871
875
  "input": this.onInput
872
876
  }
@@ -874,10 +878,11 @@
874
878
  var props = _objectSpread2({}, opt);
875
879
  var Type = _this2.type === 'button' ? 'ElRadioButton' : 'ElRadio';
876
880
  delete props.value;
877
- return h(Type, {
878
- "props": _objectSpread2({}, props),
881
+ return h(Type, helper([{}, {
882
+ "props": props
883
+ }, {
879
884
  "key": Type + index + '-' + opt.value
880
- });
885
+ }]));
881
886
  }), getSlot(this.$slots)]);
882
887
  }
883
888
  };
@@ -936,10 +941,11 @@
936
941
  var options = ctx.props.formCreateInject.options;
937
942
  return h("ElSelect", helper([{}, ctx.data]), [(Array.isArray(options) ? options : []).map(function (props, index) {
938
943
  var slot = props.slot;
939
- return h("ElOption", {
940
- "props": _objectSpread2({}, props),
944
+ return h("ElOption", helper([{}, {
945
+ "props": props
946
+ }, {
941
947
  "key": '' + index + '-' + props.value
942
- }, [slot ? h("template", {
948
+ }]), [slot ? h("template", {
943
949
  "slot": props.slotName || 'default'
944
950
  }, [is.Function(slot) ? props.slot(h) : slot]) : null]);
945
951
  }), ctx.children]);
@@ -1240,17 +1246,18 @@
1240
1246
  }
1241
1247
  return h("div", {
1242
1248
  "class": '_fc-upload'
1243
- }, [[this.formCreateInject.prop.props.showFileList ? [] : this.makeFiles(), this.makeUpload()], h("el-dialog", {
1244
- "attrs": {
1245
- "appendToBody": true,
1246
- "modal": this.previewMask,
1247
- "title": this.modalTitle,
1248
- "visible": this.previewVisible
1249
- },
1249
+ }, [[this.formCreateInject.prop.props.showFileList ? [] : this.makeFiles(), this.makeUpload()], h("el-dialog", helper([{}, {
1250
+ "props": {
1251
+ appendToBody: true,
1252
+ modal: this.previewMask,
1253
+ title: this.modalTitle,
1254
+ visible: this.previewVisible
1255
+ }
1256
+ }, {
1250
1257
  "on": {
1251
1258
  "close": this.handleCancel
1252
1259
  }
1253
- }, [h("img", {
1260
+ }]), [h("img", {
1254
1261
  "attrs": {
1255
1262
  "alt": "example",
1256
1263
  "src": this.previewImage
@@ -1670,10 +1677,7 @@
1670
1677
  "span": button ? 20 : 24
1671
1678
  }
1672
1679
  }, [h("ElFormItem", [h(Type, helper([{
1673
- "key": key,
1674
- "attrs": {
1675
- "inFor": true
1676
- }
1680
+ "key": key
1677
1681
  }, {
1678
1682
  "on": {
1679
1683
  'update:value': function updateValue(formData) {
@@ -1689,20 +1693,21 @@
1689
1693
  return _this9.add$f(index, key, $f);
1690
1694
  }
1691
1695
  }
1692
- }, {
1693
- "attrs": {
1694
- "value": _this9.field ? _defineProperty({}, _this9.field, _this9._value(_this9.value[index])) : _this9.value[index],
1695
- "rule": rule,
1696
- "option": options,
1697
- "extendOption": true
1696
+ }, {}, {
1697
+ "props": {
1698
+ value: _this9.field ? _defineProperty({}, _this9.field, _this9._value(_this9.value[index])) : _this9.value[index],
1699
+ rule: rule,
1700
+ option: options,
1701
+ extendOption: true,
1702
+ inFor: true
1698
1703
  }
1699
- }]))])]), button ? h("ElCol", {
1700
- "attrs": {
1701
- "span": 2,
1702
- "pull": 1,
1703
- "push": 1
1704
+ }]))])]), button ? h("ElCol", helper([{}, {
1705
+ "props": {
1706
+ span: 2,
1707
+ pull: 1,
1708
+ push: 1
1704
1709
  }
1705
- }, [_this9.makeIcon(keys.length, index, key)]) : null]);
1710
+ }]), [_this9.makeIcon(keys.length, index, key)]) : null]);
1706
1711
  })]);
1707
1712
  }
1708
1713
  };
@@ -1803,11 +1808,11 @@
1803
1808
  'emit-event': this.emitEvent,
1804
1809
  input: this.add$f
1805
1810
  }
1806
- }, {
1807
- "attrs": {
1808
- "rule": rule,
1809
- "option": options,
1810
- "extendOption": true
1811
+ }, {}, {
1812
+ "props": {
1813
+ rule: rule,
1814
+ option: options,
1815
+ extendOption: true
1811
1816
  }
1812
1817
  }]));
1813
1818
  }
@@ -2663,8 +2668,11 @@
2663
2668
  },
2664
2669
  getCache: function getCache(ctx) {
2665
2670
  var cache = this.cache[ctx.id];
2666
- cache.use = true;
2667
- return cache.vnode;
2671
+ if (cache) {
2672
+ cache.use = true;
2673
+ return cache.vnode;
2674
+ }
2675
+ return undefined;
2668
2676
  }
2669
2677
  });
2670
2678
  }
@@ -4598,7 +4606,8 @@
4598
4606
  }
4599
4607
  }, val);
4600
4608
  if (!validate.message) {
4601
- validate.message = rule.title + '不能为空';
4609
+ var title = rule.title || '';
4610
+ validate.message = ((_typeof(title) === 'object' ? title.title : title) || '') + '不能为空';
4602
4611
  }
4603
4612
  inject.getProp().validate = [validate];
4604
4613
  }
@@ -4668,9 +4677,13 @@
4668
4677
  return fetch(_objectSpread2(_objectSpread2({}, option), {}, {
4669
4678
  onSuccess: function onSuccess(body) {
4670
4679
  if (check()) return;
4671
- set((option.parse || function (v) {
4680
+ var fn = function fn(v) {
4672
4681
  return v.data;
4673
- })(body, rule, api));
4682
+ };
4683
+ if (is.Function(option.parse)) {
4684
+ fn = option.parse;
4685
+ }
4686
+ set(fn(body, rule, api));
4674
4687
  api.sync(rule);
4675
4688
  },
4676
4689
  onError: function onError(e) {
@@ -5794,7 +5807,7 @@
5794
5807
  function elmFormCreate() {
5795
5808
  return FormCreateFactory({
5796
5809
  ui: "".concat("element-ui"),
5797
- version: "".concat("2.5.24"),
5810
+ version: "".concat("2.5.25"),
5798
5811
  manager: manager,
5799
5812
  extendApi: extendApi,
5800
5813
  install: install,