@form-create/element-ui 2.5.8 → 2.5.12
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 +705 -491
- package/dist/form-create.min.js +2 -2
- package/dist/form-create.min.js.map +1 -1
- package/package.json +12 -12
- package/src/core/api.js +22 -20
- package/src/core/manager.js +5 -3
- package/src/style/index.css +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@form-create/element-ui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.12",
|
|
4
4
|
"description": "element-ui动态表单|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,16 +43,16 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "http://www.form-create.com",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@form-create/component-elm-checkbox": "^2.5.
|
|
47
|
-
"@form-create/component-elm-frame": "^2.5.
|
|
48
|
-
"@form-create/component-elm-group": "^2.5.
|
|
49
|
-
"@form-create/component-elm-radio": "^2.5.
|
|
50
|
-
"@form-create/component-elm-select": "^2.5.
|
|
51
|
-
"@form-create/component-elm-tree": "^2.5.
|
|
52
|
-
"@form-create/component-elm-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-elm-checkbox": "^2.5.12",
|
|
47
|
+
"@form-create/component-elm-frame": "^2.5.11",
|
|
48
|
+
"@form-create/component-elm-group": "^2.5.12",
|
|
49
|
+
"@form-create/component-elm-radio": "^2.5.12",
|
|
50
|
+
"@form-create/component-elm-select": "^2.5.12",
|
|
51
|
+
"@form-create/component-elm-tree": "^2.5.11",
|
|
52
|
+
"@form-create/component-elm-upload": "^2.5.11",
|
|
53
|
+
"@form-create/component-subform": "^2.5.12",
|
|
54
|
+
"@form-create/core": "^2.5.12",
|
|
55
|
+
"@form-create/utils": "^2.5.11"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"element-ui": "^2.13.2",
|
|
66
66
|
"v-jsoneditor": "^1.4.2"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "cc9121b197e8a06d662407f71b923f8462498c58"
|
|
69
69
|
}
|
package/src/core/api.js
CHANGED
|
@@ -21,7 +21,7 @@ export default function extendApi(api, h) {
|
|
|
21
21
|
if (!args[0] || !flag) {
|
|
22
22
|
flag = args;
|
|
23
23
|
}
|
|
24
|
-
callback(...flag);
|
|
24
|
+
callback && callback(...flag);
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -47,19 +47,19 @@ 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) {
|
|
60
|
-
return callback('子表单验证未通过', flag[1]);
|
|
60
|
+
return callback && callback('子表单验证未通过', flag[1]);
|
|
61
61
|
}
|
|
62
|
-
callback(...flag || args);
|
|
62
|
+
callback && callback(...flag || args);
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
65
|
const validFn = (args) => {
|
|
@@ -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: {
|
|
@@ -156,4 +158,4 @@ export default function extendApi(api, h) {
|
|
|
156
158
|
});
|
|
157
159
|
|
|
158
160
|
return api;
|
|
159
|
-
}
|
|
161
|
+
}
|
package/src/core/manager.js
CHANGED
|
@@ -118,10 +118,10 @@ export default {
|
|
|
118
118
|
const {inline, col: _col} = this.rule.props;
|
|
119
119
|
const item = isFalse(rule.wrap.show) ? children : this.$r(mergeProps([rule.wrap, {
|
|
120
120
|
props: {
|
|
121
|
-
label: rule.title.title,
|
|
122
121
|
labelWidth: labelWidth === void 0 ? labelWidth : toString(labelWidth),
|
|
122
|
+
label: isTitle ? rule.title.title : undefined,
|
|
123
123
|
...(rule.wrap || {}),
|
|
124
|
-
prop: ctx.
|
|
124
|
+
prop: ctx.id,
|
|
125
125
|
rules: rule.validate,
|
|
126
126
|
},
|
|
127
127
|
class: rule.className,
|
|
@@ -132,6 +132,7 @@ export default {
|
|
|
132
132
|
return (inline === true || isFalse(_col) || isFalse(col.show)) ? item : this.makeCol(rule, uni, [item]);
|
|
133
133
|
},
|
|
134
134
|
isTitle(rule) {
|
|
135
|
+
if(this.options.form.title === false) return false;
|
|
135
136
|
const title = rule.title;
|
|
136
137
|
return !((!title.title && !title.native) || isFalse(title.show))
|
|
137
138
|
},
|
|
@@ -139,7 +140,8 @@ export default {
|
|
|
139
140
|
const titleProp = rule.title;
|
|
140
141
|
const infoProp = rule.info;
|
|
141
142
|
const isTip = isTooltip(infoProp);
|
|
142
|
-
const
|
|
143
|
+
const form = this.options.form;
|
|
144
|
+
const children = [(titleProp.title || '') + (form.labelSuffix || form['label-suffix'] || '')];
|
|
143
145
|
const titleFn = (pop) => this.$r(mergeProps([titleProp, {
|
|
144
146
|
props: titleProp,
|
|
145
147
|
slot: titleProp.slot || (pop ? (isTip ? 'default' : 'reference') : 'label'),
|