@form-create/view-design 2.5.33 → 2.5.34

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,6 +1,6 @@
1
1
  /*!
2
- * @form-create/view-design v2.5.33
3
- * (c) 2018-2023 xaboy
2
+ * @form-create/view-design v2.5.34
3
+ * (c) 2018-2024 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
6
6
  */
@@ -4763,6 +4763,19 @@
4763
4763
  form: function form() {
4764
4764
  return this.vm.$refs[this.ref];
4765
4765
  },
4766
+ getSlot: function getSlot(name) {
4767
+ var _fn = function _fn(vm) {
4768
+ if (vm) {
4769
+ var slot = vm.$scopedSlots[name];
4770
+ if (slot) {
4771
+ return slot;
4772
+ }
4773
+ return _fn(vm.$pfc);
4774
+ }
4775
+ return undefined;
4776
+ };
4777
+ return _fn(this.vm);
4778
+ },
4766
4779
  mergeOptions: function mergeOptions(args, opt) {
4767
4780
  var _this2 = this;
4768
4781
  return mergeProps(args.map(function (v) {
@@ -5687,7 +5700,7 @@
5687
5700
  }
5688
5701
  },
5689
5702
  tidyOptions: function tidyOptions(options) {
5690
- ['submitBtn', 'resetBtn', 'row', 'info', 'wrap', 'col'].forEach(function (name) {
5703
+ ['submitBtn', 'resetBtn', 'row', 'info', 'wrap', 'col', 'title'].forEach(function (name) {
5691
5704
  tidyBool(options, name);
5692
5705
  });
5693
5706
  return options;
@@ -5702,7 +5715,8 @@
5702
5715
  ctx.prop = mergeProps([{
5703
5716
  info: this.options.info || {},
5704
5717
  wrap: this.options.wrap || {},
5705
- col: this.options.col || {}
5718
+ col: this.options.col || {},
5719
+ title: this.options.title || {}
5706
5720
  }, ctx.prop], {
5707
5721
  info: info(),
5708
5722
  title: {},
@@ -5776,7 +5790,7 @@
5776
5790
  key: "".concat(uni, "fi"),
5777
5791
  ref: ctx.wrapRef,
5778
5792
  type: 'formItem'
5779
- }]), [children, isTitle ? this.makeInfo(rule, uni) : null]);
5793
+ }]), [children, isTitle ? this.makeInfo(rule, uni, ctx) : null]);
5780
5794
  return inline === true || isFalse(_col) || isFalse(col.show) ? item : this.makeCol(rule, uni, [item]);
5781
5795
  },
5782
5796
  isTitle: function isTitle(rule) {
@@ -5784,10 +5798,15 @@
5784
5798
  var title = rule.title;
5785
5799
  return !(!title.title && !title["native"] || isFalse(title.show));
5786
5800
  },
5787
- makeInfo: function makeInfo(rule, uni) {
5801
+ makeInfo: function makeInfo(rule, uni, ctx) {
5788
5802
  var titleProp = rule.title;
5789
5803
  var infoProp = rule.info;
5790
- var children = [titleProp.title];
5804
+ var titleSlot = this.getSlot('title');
5805
+ var children = [titleSlot ? titleSlot({
5806
+ title: titleProp.title || '',
5807
+ rule: ctx.rule,
5808
+ options: this.options
5809
+ }) : titleProp.title];
5791
5810
  if (!isFalse(infoProp.show) && (infoProp.info || infoProp["native"]) && !isFalse(infoProp.icon)) {
5792
5811
  var prop = {
5793
5812
  type: infoProp.type || 'poptip',
@@ -5860,7 +5879,7 @@
5860
5879
  }, [item]);
5861
5880
  },
5862
5881
  makeResetBtn: function makeResetBtn() {
5863
- var _this2 = this;
5882
+ var _this = this;
5864
5883
  var resetBtn = this.options.resetBtn;
5865
5884
  this.setSize(resetBtn);
5866
5885
  return this.$r({
@@ -5872,7 +5891,7 @@
5872
5891
  },
5873
5892
  on: {
5874
5893
  click: function click() {
5875
- var fApi = _this2.$handle.api;
5894
+ var fApi = _this.$handle.api;
5876
5895
  resetBtn.click ? resetBtn.click(fApi) : fApi.resetFields();
5877
5896
  }
5878
5897
  },
@@ -5880,7 +5899,7 @@
5880
5899
  }, [resetBtn.innerText]);
5881
5900
  },
5882
5901
  makeSubmitBtn: function makeSubmitBtn() {
5883
- var _this3 = this;
5902
+ var _this2 = this;
5884
5903
  var submitBtn = this.options.submitBtn;
5885
5904
  this.setSize(submitBtn);
5886
5905
  return this.$r({
@@ -5891,7 +5910,7 @@
5891
5910
  },
5892
5911
  on: {
5893
5912
  click: function click() {
5894
- var fApi = _this3.$handle.api;
5913
+ var fApi = _this2.$handle.api;
5895
5914
  submitBtn.click ? submitBtn.click(fApi) : fApi.submit();
5896
5915
  }
5897
5916
  },
@@ -6174,7 +6193,7 @@
6174
6193
  function ivuFormCreate() {
6175
6194
  return FormCreateFactory({
6176
6195
  ui: "".concat("view-design"),
6177
- version: "".concat("2.5.33"),
6196
+ version: "".concat("2.5.34"),
6178
6197
  manager: manager,
6179
6198
  install: install,
6180
6199
  extendApi: extendApi,