@form-create/iview 2.7.3 → 2.7.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@form-create/iview",
3
- "version": "2.7.3",
3
+ "version": "2.7.5",
4
4
  "description": "Iview版本低代码表单|FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。内置20种常用表单组件和自定义组件,再复杂的表单都可以轻松搞定。",
5
5
  "main": "./dist/form-create.min.js",
6
6
  "module": "./dist/form-create.esm.js",
@@ -46,13 +46,13 @@
46
46
  "dependencies": {
47
47
  "@form-create/component-ivu-checkbox": "^2.7.1",
48
48
  "@form-create/component-ivu-frame": "^2.7.2",
49
- "@form-create/component-ivu-group": "^2.7.3",
49
+ "@form-create/component-ivu-group": "^2.7.5",
50
50
  "@form-create/component-ivu-radio": "^2.7.1",
51
51
  "@form-create/component-ivu-select": "^2.7.1",
52
52
  "@form-create/component-ivu-tree": "^2.7.1",
53
53
  "@form-create/component-ivu-upload": "^2.7.1",
54
54
  "@form-create/component-subform": "^2.7.1",
55
- "@form-create/core": "^2.7.3",
55
+ "@form-create/core": "^2.7.5",
56
56
  "@form-create/utils": "^2.7.0"
57
57
  },
58
58
  "publishConfig": {
@@ -64,5 +64,5 @@
64
64
  "v-jsoneditor": "^1.4.2",
65
65
  "vue": "2.7"
66
66
  },
67
- "gitHead": "e20c2a0c6d4746e1ddfbcd66e804f6d80925ee90"
67
+ "gitHead": "63b1bb5c4d88b65bdd48517d6b3b3090792d6c1a"
68
68
  }
package/src/core/api.js CHANGED
@@ -24,7 +24,7 @@ export default function extendApi(api, h) {
24
24
  return new Promise((resolve, reject) => {
25
25
  const forms = api.children;
26
26
  const all = [h.$manager.validate()];
27
- forms.forEach(v => {
27
+ forms.filter(v=>!v.isScope).forEach(v => {
28
28
  all.push(v.validate());
29
29
  })
30
30
  Promise.all(all).then(() => {
@@ -43,7 +43,7 @@ export default function extendApi(api, h) {
43
43
  if (!ctx) return;
44
44
  const sub = h.subForm[ctx.id];
45
45
  const all = [h.$manager.validateField(ctx.id)];
46
- toArray(sub).forEach(v => {
46
+ toArray(sub).filter(v=>!v.isScope).forEach(v => {
47
47
  all.push(v.validate());
48
48
  })
49
49
  Promise.all(all).then(() => {
@@ -115,7 +115,8 @@ export default function extendApi(api, h) {
115
115
  },
116
116
  submit(successFn, failFn) {
117
117
  return new Promise((resolve, reject) => {
118
- api.validate().then(() => {
118
+ const promise = h.options.validateOnSubmit === false ? Promise.resolve() : api.validate();
119
+ promise.then(() => {
119
120
  let formData = api.formData();
120
121
  is.Function(successFn) && invoke(() => successFn(formData, api));
121
122
  is.Function(h.options.onSubmit) && invoke(() => h.options.onSubmit(formData, api));
@@ -146,10 +146,10 @@ export default {
146
146
  const form = this.options.form;
147
147
  const titleSlot = this.getSlot('title');
148
148
  const children = [titleSlot ? titleSlot({
149
- title: ctx.refRule?.__$title.value,
149
+ title: ctx.refRule?.__$title?.value,
150
150
  rule: ctx.rule,
151
151
  options: this.options
152
- }) : ((ctx.refRule?.__$title.value) + (form.labelSuffix || form['label-suffix'] || ''))];
152
+ }) : ((ctx.refRule?.__$title?.value) + (form.labelSuffix || form['label-suffix'] || ''))];
153
153
 
154
154
  if (!isFalse(infoProp.show) && (infoProp.info || infoProp.native) && !isFalse(infoProp.icon)) {
155
155
  const prop = {
@@ -167,7 +167,7 @@ export default {
167
167
 
168
168
  const field = 'content';
169
169
  if (infoProp.info && !hasProperty(prop.props, field)) {
170
- prop.props[field] = ctx.refRule?.__$info.value;
170
+ prop.props[field] = ctx.refRule?.__$info?.value;
171
171
  }
172
172
  children[infoProp.align !== 'left' ? 'unshift' : 'push'](this.$r(mergeProps([infoProp, prop]), [
173
173
  this.$r({
@@ -15,7 +15,7 @@ const required = {
15
15
  },
16
16
  ...val,
17
17
  };
18
- const title = rule.__fc__.refRule.__$title.value;
18
+ const title = rule.__fc__.refRule?.__$title?.value;
19
19
  if (!validate.message) {
20
20
  validate.message = api.t('required', {title}) || (title + (api.getLocale() === 'en' ? ' is required' : '不能为空'));
21
21
  } else {