@form-create/iview 2.5.10 → 2.5.14
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/dist/form-create.js +415 -345
- package/dist/form-create.min.js +2 -2
- package/dist/form-create.min.js.map +1 -1
- package/package.json +13 -13
- package/src/core/api.js +18 -16
- package/src/core/manager.js +16 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@form-create/iview",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.14",
|
|
4
4
|
"description": "iview动态表单|form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions through JSON. Supports 3 UI frameworks, and supports the generation of any Vue components. Built-in 20 kinds of commonly used form components and custom components, no matter how complex forms can be easily handled.",
|
|
5
5
|
"main": "./dist/form-create.min.js",
|
|
6
6
|
"module": "./dist/form-create.min.js",
|
|
@@ -43,27 +43,27 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "http://www.form-create.com",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@form-create/component-ivu-checkbox": "^2.5.
|
|
47
|
-
"@form-create/component-ivu-frame": "^2.5.
|
|
48
|
-
"@form-create/component-ivu-group": "^2.5.
|
|
49
|
-
"@form-create/component-ivu-radio": "^2.5.
|
|
50
|
-
"@form-create/component-ivu-select": "^2.5.
|
|
51
|
-
"@form-create/component-ivu-tree": "^2.5.
|
|
52
|
-
"@form-create/component-ivu-upload": "^2.5.
|
|
53
|
-
"@form-create/component-subform": "^2.5.
|
|
54
|
-
"@form-create/core": "^2.5.
|
|
55
|
-
"@form-create/utils": "^2.5.
|
|
46
|
+
"@form-create/component-ivu-checkbox": "^2.5.14",
|
|
47
|
+
"@form-create/component-ivu-frame": "^2.5.11",
|
|
48
|
+
"@form-create/component-ivu-group": "^2.5.12",
|
|
49
|
+
"@form-create/component-ivu-radio": "^2.5.14",
|
|
50
|
+
"@form-create/component-ivu-select": "^2.5.12",
|
|
51
|
+
"@form-create/component-ivu-tree": "^2.5.11",
|
|
52
|
+
"@form-create/component-ivu-upload": "^2.5.11",
|
|
53
|
+
"@form-create/component-subform": "^2.5.12",
|
|
54
|
+
"@form-create/core": "^2.5.14",
|
|
55
|
+
"@form-create/utils": "^2.5.11"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@form-create/component-wangeditor": "^2.5.
|
|
61
|
+
"@form-create/component-wangeditor": "^2.5.13",
|
|
62
62
|
"@vue/cli-plugin-babel": "^4.5.9",
|
|
63
63
|
"@vue/cli-service": "^4.5.3",
|
|
64
64
|
"@vue/composition-api": "^1.0.0-beta.22",
|
|
65
65
|
"iview": "^3.3.3",
|
|
66
66
|
"v-jsoneditor": "^1.4.2"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "7cc4214285236caa9e9899af4086cb58a99b35c2"
|
|
69
69
|
}
|
package/src/core/api.js
CHANGED
|
@@ -47,13 +47,13 @@ export default function extendApi(api, h) {
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
validateField: (field, callback) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const sub = h.subForm[
|
|
50
|
+
const ctx = h.getFieldCtx(field);
|
|
51
|
+
if (!ctx) return;
|
|
52
|
+
const sub = h.subForm[ctx.id];
|
|
53
53
|
let len = 0;
|
|
54
54
|
let flag;
|
|
55
55
|
const validate = () => {
|
|
56
|
-
h.$manager.validateField(
|
|
56
|
+
h.$manager.validateField(ctx.id, (...args) => {
|
|
57
57
|
if (args[0]) {
|
|
58
58
|
flag = args;
|
|
59
59
|
} else if (flag) {
|
|
@@ -86,22 +86,24 @@ export default function extendApi(api, h) {
|
|
|
86
86
|
clearValidateState(fields, clearSub = true) {
|
|
87
87
|
api.helper.tidyFields(fields).forEach(field => {
|
|
88
88
|
if (clearSub) this.clearSubValidateState(field);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
h.getCtxs(field).forEach(ctx => {
|
|
90
|
+
h.$manager.clearValidateState(ctx);
|
|
91
|
+
});
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
clearSubValidateState(fields) {
|
|
95
95
|
api.helper.tidyFields(fields).forEach(field => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
subForm
|
|
104
|
-
|
|
96
|
+
h.getCtxs(field).forEach(ctx => {
|
|
97
|
+
const subForm = h.subForm[ctx.id];
|
|
98
|
+
if (!subForm) return;
|
|
99
|
+
if (Array.isArray(subForm)) {
|
|
100
|
+
subForm.forEach(form => {
|
|
101
|
+
form.clearValidateState();
|
|
102
|
+
})
|
|
103
|
+
} else if (subForm) {
|
|
104
|
+
subForm.clearValidateState();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
105
107
|
})
|
|
106
108
|
},
|
|
107
109
|
btn: {
|
package/src/core/manager.js
CHANGED
|
@@ -105,7 +105,7 @@ export default {
|
|
|
105
105
|
props: {
|
|
106
106
|
labelWidth,
|
|
107
107
|
...(rule.wrap || {}),
|
|
108
|
-
prop: ctx.
|
|
108
|
+
prop: ctx.id,
|
|
109
109
|
rules: rule.validate,
|
|
110
110
|
},
|
|
111
111
|
class: rule.className,
|
|
@@ -132,33 +132,32 @@ export default {
|
|
|
132
132
|
type: titleProp.type || 'span',
|
|
133
133
|
}]), children);
|
|
134
134
|
|
|
135
|
-
if (!isFalse(infoProp.show) && (infoProp.info || infoProp.native)) {
|
|
136
|
-
if (infoProp.icon !== false) {
|
|
137
|
-
children[infoProp.align !== 'left' ? 'unshift' : 'push'](this.$r({
|
|
138
|
-
type: 'icon',
|
|
139
|
-
props: {type: infoProp.icon === true ? iviewConfig.infoIcon : infoProp.icon, size: 16},
|
|
140
|
-
style: 'margin-top: -1px',
|
|
141
|
-
key: `${uni}i`
|
|
142
|
-
}));
|
|
143
|
-
}
|
|
144
|
-
|
|
135
|
+
if (!isFalse(infoProp.show) && (infoProp.info || infoProp.native) && !isFalse(infoProp.icon)) {
|
|
145
136
|
const prop = {
|
|
146
137
|
type: infoProp.type || 'poptip',
|
|
147
138
|
props: {...infoProp},
|
|
148
139
|
key: `${uni}pop`,
|
|
149
140
|
slot: 'label'
|
|
150
141
|
};
|
|
151
|
-
|
|
152
142
|
const field = 'content';
|
|
153
143
|
if (infoProp.info && !hasProperty(prop.props, field)) {
|
|
154
144
|
prop.props[field] = infoProp.info;
|
|
155
145
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
146
|
+
children[infoProp.align !== 'left' ? 'unshift' : 'push'](this.$r(mergeProps([infoProp, prop]), [
|
|
147
|
+
this.$r({
|
|
148
|
+
type: 'icon',
|
|
149
|
+
props: {type: infoProp.icon === true ? iviewConfig.infoIcon : infoProp.icon, size: 16},
|
|
150
|
+
style: 'margin-top: -1px',
|
|
151
|
+
key: `${uni}i`
|
|
152
|
+
})
|
|
153
|
+
]));
|
|
160
154
|
}
|
|
161
|
-
return
|
|
155
|
+
return this.$r(mergeProps([titleProp, {
|
|
156
|
+
props: titleProp,
|
|
157
|
+
slot: titleProp.slot || 'label',
|
|
158
|
+
key: `${uni}tit`,
|
|
159
|
+
type: titleProp.type || 'span',
|
|
160
|
+
}]), children);
|
|
162
161
|
},
|
|
163
162
|
makeCol(rule, uni, children) {
|
|
164
163
|
const col = rule.col;
|