@form-create/element-ui 3.2.25 → 3.2.27

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.25
2
+ * @form-create/element-ui v3.2.27
3
3
  * (c) 2018-2025 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -1453,6 +1453,7 @@ var Upload = defineComponent({
1453
1453
  httpRequest: Function,
1454
1454
  modalTitle: String,
1455
1455
  listType: String,
1456
+ uploadText: String,
1456
1457
  formCreateInject: Object,
1457
1458
  modelValue: [Array, String, Object]
1458
1459
  },
@@ -1547,7 +1548,7 @@ var Upload = defineComponent({
1547
1548
  "type": "primary"
1548
1549
  }, {
1549
1550
  "default": function _default() {
1550
- return [_this.formCreateInject.t('clickToUpload') || '点击上传'];
1551
+ return [_this.formCreateInject.t('clickToUpload') || _this.uploadText || '点击上传'];
1551
1552
  }
1552
1553
  }))];
1553
1554
  }
@@ -2758,6 +2759,7 @@ function $FormCreate(FormCreate, components, directives) {
2758
2759
  index: [String, Number],
2759
2760
  api: Object,
2760
2761
  locale: [String, Object],
2762
+ t: Function,
2761
2763
  name: String,
2762
2764
  subForm: {
2763
2765
  type: Boolean,
@@ -3811,6 +3813,12 @@ function Api(h) {
3811
3813
  }
3812
3814
  });
3813
3815
  },
3816
+ setGlobalData: function setGlobalData(name, value) {
3817
+ api.setData('$globalData.' + name, value);
3818
+ },
3819
+ setGlobalVar: function setGlobalVar(name, value) {
3820
+ api.setData('$var.' + name, value);
3821
+ },
3814
3822
  renderRule: function renderRule(id, onInput, force) {
3815
3823
  var flag = _typeof(id) === 'object';
3816
3824
  var ctx = flag ? byCtx(id) : h.getCtx(id);
@@ -4312,6 +4320,9 @@ function useRender$1(Render) {
4312
4320
  slots: function slots() {
4313
4321
  return _this6.vm.setupState.top.slots;
4314
4322
  },
4323
+ getWrap: function getWrap() {
4324
+ return _this6.vm.refs[ctx.wrapRef];
4325
+ },
4315
4326
  options: [],
4316
4327
  children: [],
4317
4328
  preview: false,
@@ -5660,6 +5671,8 @@ function useInput(Handler) {
5660
5671
  });
5661
5672
  });
5662
5673
  }
5674
+
5675
+ this.$manager.fieldChange(ctx, value, formValue, setFlag);
5663
5676
  },
5664
5677
  onInput: function onInput(ctx, value) {
5665
5678
  var val;
@@ -7301,6 +7314,7 @@ extend(Manager.prototype, {
7301
7314
  getDefaultOptions: function getDefaultOptions() {
7302
7315
  return {};
7303
7316
  },
7317
+ fieldChange: function fieldChange(ctx, value, formValue, setFlag) {},
7304
7318
  render: function render(children) {}
7305
7319
  });
7306
7320
 
@@ -7476,8 +7490,8 @@ var componentValidate = {
7476
7490
  }
7477
7491
 
7478
7492
  var method = options.method;
7479
- delete options.method;
7480
- attr.getProp().validate = [_objectSpread2(_objectSpread2({}, options), {}, {
7493
+
7494
+ var validate = _objectSpread2(_objectSpread2({}, options), {}, {
7481
7495
  validator: function validator() {
7482
7496
  var ctx = byCtx(rule);
7483
7497
 
@@ -7493,7 +7507,10 @@ var componentValidate = {
7493
7507
  }]));
7494
7508
  }
7495
7509
  }
7496
- })];
7510
+ });
7511
+
7512
+ delete validate.method;
7513
+ attr.getProp().validate = [validate];
7497
7514
  }
7498
7515
  },
7499
7516
  watch: function watch() {
@@ -8333,10 +8350,17 @@ function FormCreateFactory(config) {
8333
8350
  return 'zh-cn';
8334
8351
  },
8335
8352
  globalLanguageDriver: function globalLanguageDriver(id) {
8353
+ var t = this.vm.setupState.top.props.t;
8336
8354
  var locale = this.vm.setupState.top.props.locale;
8337
8355
  var value = undefined;
8338
8356
 
8339
- if (locale && _typeof(locale) === 'object') {
8357
+ if (t) {
8358
+ value = invoke(function () {
8359
+ return t(id);
8360
+ });
8361
+ }
8362
+
8363
+ if (value == null && locale && _typeof(locale) === 'object') {
8340
8364
  value = deepGet(locale, id);
8341
8365
  }
8342
8366
 
@@ -8394,8 +8418,11 @@ function FormCreateFactory(config) {
8394
8418
  if (id != null) {
8395
8419
  var split = id.split('.');
8396
8420
  var key = split.shift();
8421
+ val = deepGet(this.vm.setupState.top.setupState.fc.tmpData, id);
8397
8422
 
8398
- if (key === '$topForm') {
8423
+ if (val != null) {
8424
+ return val;
8425
+ } else if (key === '$topForm') {
8399
8426
  val = this.$handle.api.top.formData(true);
8400
8427
  } else if (key === '$scopeForm') {
8401
8428
  val = this.$handle.api.scope.formData(true);
@@ -8418,13 +8445,7 @@ function FormCreateFactory(config) {
8418
8445
  } else if (key === '$preview') {
8419
8446
  return this.$handle.preview;
8420
8447
  } else {
8421
- var tmpData = this.vm.setupState.top.setupState.fc.tmpData;
8422
-
8423
- if (!hasProperty(tmpData, key)) {
8424
- tmpData[key] = defValueTag;
8425
- }
8426
-
8427
- val = tmpData[key] !== defValueTag ? deepGet(tmpData, id) : getData(id);
8448
+ val = getData(id);
8428
8449
  split = [];
8429
8450
  }
8430
8451
 
@@ -8983,6 +9004,13 @@ var manager = {
8983
9004
  fItem.clearValidate();
8984
9005
  }
8985
9006
  },
9007
+ fieldChange: function fieldChange(ctx, value, formValue, setFlag) {
9008
+ if (!setFlag) {
9009
+ var _this$vm$refs$ctx$wra, _this$vm$refs$ctx$wra2;
9010
+
9011
+ (_this$vm$refs$ctx$wra = this.vm.refs[ctx.wrapRef]) === null || _this$vm$refs$ctx$wra === void 0 ? void 0 : (_this$vm$refs$ctx$wra2 = _this$vm$refs$ctx$wra.validate('change')) === null || _this$vm$refs$ctx$wra2 === void 0 ? void 0 : _this$vm$refs$ctx$wra2["catch"](function () {});
9012
+ }
9013
+ },
8986
9014
  tidyOptions: function tidyOptions(options) {
8987
9015
  ['submitBtn', 'resetBtn', 'row', 'info', 'wrap', 'col', 'title'].forEach(function (name) {
8988
9016
  tidyBool(options, name);
@@ -9066,6 +9094,8 @@ var manager = {
9066
9094
  var _this$rule$props = this.rule.props,
9067
9095
  inline = _this$rule$props.inline,
9068
9096
  _col = _this$rule$props.col;
9097
+ var cls = rule.wrap["class"];
9098
+ delete rule.wrap["class"];
9069
9099
  delete rule.wrap.title;
9070
9100
  var item = isFalse(rule.wrap.show) ? children : this.$r(mergeProps([rule.wrap, {
9071
9101
  props: _objectSpread2(_objectSpread2({
@@ -9075,7 +9105,7 @@ var manager = {
9075
9105
  prop: ctx.id,
9076
9106
  rules: ctx.injectValidate()
9077
9107
  }),
9078
- "class": this.$render.mergeClass(rule.className, 'fc-form-item'),
9108
+ "class": this.$render.mergeClass(cls || rule.className, 'fc-form-item'),
9079
9109
  key: "".concat(uni, "fi"),
9080
9110
  ref: ctx.wrapRef,
9081
9111
  type: 'formItem'
@@ -9619,7 +9649,7 @@ function install(FormCreate) {
9619
9649
  function elmFormCreate() {
9620
9650
  return FormCreateFactory({
9621
9651
  ui: 'element-ui',
9622
- version: '3.2.25',
9652
+ version: '3.2.27',
9623
9653
  manager: manager,
9624
9654
  extendApi: extendApi,
9625
9655
  install: install,