@form-create/element-ui 3.2.24 → 3.2.26

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.24
2
+ * @form-create/element-ui v3.2.26
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,
@@ -6757,19 +6759,34 @@ function useLifecycle(Handler) {
6757
6759
 
6758
6760
  var hook = (_ctx$prop = ctx.prop) === null || _ctx$prop === void 0 ? void 0 : (_ctx$prop$hook = _ctx$prop.hook) === null || _ctx$prop$hook === void 0 ? void 0 : _ctx$prop$hook[name];
6759
6761
 
6760
- if (hook) {
6761
- hook = Array.isArray(hook) ? hook : [hook];
6762
- hook.forEach(function (fn) {
6763
- invoke(function () {
6764
- return fn(_objectSpread2(_objectSpread2({}, args || {}), {}, {
6765
- self: ctx.rule,
6766
- rule: ctx.rule,
6767
- $f: _this2.api,
6768
- api: _this2.api,
6769
- option: _this2.vm.props.option
6770
- }));
6762
+ var run = function run(on, p) {
6763
+ if (on) {
6764
+ on = Array.isArray(on) ? on : [on];
6765
+ on.forEach(function (fn) {
6766
+ invoke(function () {
6767
+ return fn(_objectSpread2(_objectSpread2({}, args || {}), {}, {
6768
+ self: ctx.rule,
6769
+ rule: ctx.rule,
6770
+ parent: p === null || p === void 0 ? void 0 : p.rule,
6771
+ $f: _this2.api,
6772
+ api: _this2.api,
6773
+ option: _this2.vm.props.option
6774
+ }));
6775
+ });
6771
6776
  });
6772
- });
6777
+ }
6778
+ };
6779
+
6780
+ run(hook);
6781
+ var deepName = 'deep' + upper(name);
6782
+ var parent = ctx.parent;
6783
+
6784
+ while (parent) {
6785
+ var _parent$prop, _parent$prop$hook;
6786
+
6787
+ var deepHook = (_parent$prop = parent.prop) === null || _parent$prop === void 0 ? void 0 : (_parent$prop$hook = _parent$prop.hook) === null || _parent$prop$hook === void 0 ? void 0 : _parent$prop$hook[deepName];
6788
+ run(deepHook, parent);
6789
+ parent = parent.parent;
6773
6790
  }
6774
6791
  }
6775
6792
  });
@@ -7147,7 +7164,8 @@ function CreateNodeFactory() {
7147
7164
  }
7148
7165
  },
7149
7166
  h: function h(tag, data, children) {
7150
- var isNativeTag = this.vm.appContext.config.isNativeTag(tag);
7167
+ var vm = this.vm || getCurrentInstance();
7168
+ var isNativeTag = vm.appContext.config.isNativeTag(tag);
7151
7169
 
7152
7170
  if (isNativeTag) {
7153
7171
  delete data.formCreateInject;
@@ -7460,8 +7478,8 @@ var componentValidate = {
7460
7478
  }
7461
7479
 
7462
7480
  var method = options.method;
7463
- delete options.method;
7464
- attr.getProp().validate = [_objectSpread2(_objectSpread2({}, options), {}, {
7481
+
7482
+ var validate = _objectSpread2(_objectSpread2({}, options), {}, {
7465
7483
  validator: function validator() {
7466
7484
  var ctx = byCtx(rule);
7467
7485
 
@@ -7477,7 +7495,10 @@ var componentValidate = {
7477
7495
  }]));
7478
7496
  }
7479
7497
  }
7480
- })];
7498
+ });
7499
+
7500
+ delete validate.method;
7501
+ attr.getProp().validate = [validate];
7481
7502
  }
7482
7503
  },
7483
7504
  watch: function watch() {
@@ -8317,10 +8338,17 @@ function FormCreateFactory(config) {
8317
8338
  return 'zh-cn';
8318
8339
  },
8319
8340
  globalLanguageDriver: function globalLanguageDriver(id) {
8341
+ var t = this.vm.setupState.top.props.t;
8320
8342
  var locale = this.vm.setupState.top.props.locale;
8321
8343
  var value = undefined;
8322
8344
 
8323
- if (locale && _typeof(locale) === 'object') {
8345
+ if (t) {
8346
+ value = invoke(function () {
8347
+ return t(id);
8348
+ });
8349
+ }
8350
+
8351
+ if (value == null && locale && _typeof(locale) === 'object') {
8324
8352
  value = deepGet(locale, id);
8325
8353
  }
8326
8354
 
@@ -9050,6 +9078,8 @@ var manager = {
9050
9078
  var _this$rule$props = this.rule.props,
9051
9079
  inline = _this$rule$props.inline,
9052
9080
  _col = _this$rule$props.col;
9081
+ var cls = rule.wrap["class"];
9082
+ delete rule.wrap["class"];
9053
9083
  delete rule.wrap.title;
9054
9084
  var item = isFalse(rule.wrap.show) ? children : this.$r(mergeProps([rule.wrap, {
9055
9085
  props: _objectSpread2(_objectSpread2({
@@ -9059,7 +9089,7 @@ var manager = {
9059
9089
  prop: ctx.id,
9060
9090
  rules: ctx.injectValidate()
9061
9091
  }),
9062
- "class": this.$render.mergeClass(rule.className, 'fc-form-item'),
9092
+ "class": this.$render.mergeClass(cls || rule.className, 'fc-form-item'),
9063
9093
  key: "".concat(uni, "fi"),
9064
9094
  ref: ctx.wrapRef,
9065
9095
  type: 'formItem'
@@ -9603,7 +9633,7 @@ function install(FormCreate) {
9603
9633
  function elmFormCreate() {
9604
9634
  return FormCreateFactory({
9605
9635
  ui: 'element-ui',
9606
- version: '3.2.24',
9636
+ version: '3.2.26',
9607
9637
  manager: manager,
9608
9638
  extendApi: extendApi,
9609
9639
  install: install,