@sheinx/base 3.8.1-beta.6 → 3.8.1-beta.7
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/cjs/form/form-field.d.ts.map +1 -1
- package/cjs/form/form-field.js +21 -16
- package/esm/form/form-field.d.ts.map +1 -1
- package/esm/form/form-field.js +21 -16
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["form-field.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGtE,QAAA,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["form-field.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGtE,QAAA,MAAM,SAAS,gGAmHd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/cjs/form/form-field.js
CHANGED
|
@@ -87,23 +87,28 @@ var FormField = function FormField(props) {
|
|
|
87
87
|
var _useContext3 = (0, _react.useContext)(_hooks.FormItemContext),
|
|
88
88
|
label = _useContext3.label;
|
|
89
89
|
var finalFieldId = formFieldId || fieldId || fieldsetPathId;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
90
|
+
try {
|
|
91
|
+
// 只有当 formConfig.formName 存在时才运行 schema 逻辑
|
|
92
|
+
if (formConfig.formName && formSchema && finalFieldId) {
|
|
93
|
+
var schemaFields = finalFieldId.split(separator) || [];
|
|
94
|
+
var schemaMeta = formSchema.buildSchemaFromComponent({
|
|
95
|
+
componentElement: finalChildren,
|
|
96
|
+
rules: props.rules,
|
|
97
|
+
label: label,
|
|
98
|
+
finalFieldId: finalFieldId,
|
|
99
|
+
separator: separator
|
|
100
|
+
});
|
|
101
|
+
schemaFields.forEach(function (field) {
|
|
102
|
+
formSchema.updateSchema({
|
|
103
|
+
path: _hooks.util.getOriginField(field, formConfig.formName),
|
|
104
|
+
meta: schemaMeta
|
|
105
|
+
});
|
|
105
106
|
});
|
|
106
|
-
}
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
110
|
+
_hooks.util.devUseWarning.warn("formSchema buildSchemaFromComponent error: >>".concat(error));
|
|
111
|
+
}
|
|
107
112
|
}
|
|
108
113
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_formFieldContext.FormFieldContext.Provider, {
|
|
109
114
|
value: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["form-field.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGtE,QAAA,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["form-field.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGtE,QAAA,MAAM,SAAS,gGAmHd,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/esm/form/form-field.js
CHANGED
|
@@ -78,23 +78,28 @@ var FormField = function FormField(props) {
|
|
|
78
78
|
var _useContext3 = useContext(FormItemContext),
|
|
79
79
|
label = _useContext3.label;
|
|
80
80
|
var finalFieldId = formFieldId || fieldId || fieldsetPathId;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
try {
|
|
82
|
+
// 只有当 formConfig.formName 存在时才运行 schema 逻辑
|
|
83
|
+
if (formConfig.formName && formSchema && finalFieldId) {
|
|
84
|
+
var schemaFields = finalFieldId.split(separator) || [];
|
|
85
|
+
var schemaMeta = formSchema.buildSchemaFromComponent({
|
|
86
|
+
componentElement: finalChildren,
|
|
87
|
+
rules: props.rules,
|
|
88
|
+
label: label,
|
|
89
|
+
finalFieldId: finalFieldId,
|
|
90
|
+
separator: separator
|
|
91
|
+
});
|
|
92
|
+
schemaFields.forEach(function (field) {
|
|
93
|
+
formSchema.updateSchema({
|
|
94
|
+
path: util.getOriginField(field, formConfig.formName),
|
|
95
|
+
meta: schemaMeta
|
|
96
|
+
});
|
|
96
97
|
});
|
|
97
|
-
}
|
|
98
|
+
}
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
101
|
+
util.devUseWarning.warn("formSchema buildSchemaFromComponent error: >>".concat(error));
|
|
102
|
+
}
|
|
98
103
|
}
|
|
99
104
|
return /*#__PURE__*/_jsx(FormFieldContext.Provider, {
|
|
100
105
|
value: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheinx/base",
|
|
3
|
-
"version": "3.8.1-beta.
|
|
3
|
+
"version": "3.8.1-beta.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"module": "./esm/index.js",
|
|
11
11
|
"typings": "./cjs/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@sheinx/hooks": "3.8.1-beta.
|
|
13
|
+
"@sheinx/hooks": "3.8.1-beta.7",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|