x-ui-design 0.6.82 → 0.6.83
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/index.esm.js +7 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/lib/components/Form/Form.tsx +7 -3
- package/package.json +1 -1
- package/src/app/page.tsx +10 -1
package/dist/index.esm.js
CHANGED
|
@@ -1278,11 +1278,15 @@ const Form$1 = ({
|
|
|
1278
1278
|
const formRef = useRef(null);
|
|
1279
1279
|
const formInstance = useMemo(() => {
|
|
1280
1280
|
const _form = form || internalForm;
|
|
1281
|
-
if (
|
|
1282
|
-
|
|
1281
|
+
if (_form && Object.keys(initialValues).length) {
|
|
1282
|
+
Object.keys(initialValues).forEach(name => {
|
|
1283
|
+
if (_form.getFieldValue(name) === undefined) {
|
|
1284
|
+
_form.setFieldValue(name, initialValues[name]);
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
1283
1287
|
}
|
|
1284
1288
|
return _form;
|
|
1285
|
-
}, [form, internalForm]);
|
|
1289
|
+
}, [form, internalForm, initialValues]);
|
|
1286
1290
|
const childrenList = useMemo(() => flattenChildren(children), [children]);
|
|
1287
1291
|
const handleSubmit = useCallback(async e => {
|
|
1288
1292
|
e.preventDefault();
|