x-ui-design 0.4.99 → 0.5.0
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 +6 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/lib/hooks/useForm.ts +7 -1
- package/package.json +1 -1
- package/src/app/page.tsx +0 -2
package/dist/index.esm.js
CHANGED
|
@@ -719,9 +719,7 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange, scrollToFir
|
|
|
719
719
|
delete rulesRef.current[name];
|
|
720
720
|
delete fieldInstancesRef.current[name];
|
|
721
721
|
} else {
|
|
722
|
-
if (!(name in {
|
|
723
|
-
...formRef.current[stepRef.current]
|
|
724
|
-
})) {
|
|
722
|
+
if (!(name in formRef.current[stepRef.current])) {
|
|
725
723
|
formRef.current[stepRef.current][name] = initialValues?.[name];
|
|
726
724
|
}
|
|
727
725
|
rulesRef.current[name] = rules;
|
|
@@ -765,6 +763,11 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange, scrollToFir
|
|
|
765
763
|
return fieldErrors.length === 0;
|
|
766
764
|
}
|
|
767
765
|
async function validateFields(nameList) {
|
|
766
|
+
console.log({
|
|
767
|
+
0: formRef.current[stepRef.current],
|
|
768
|
+
1: JSON.parse(JSON.stringify(formRef.current)),
|
|
769
|
+
2: stepRef.current
|
|
770
|
+
});
|
|
768
771
|
const fieldsToValidate = nameList || Object.keys(formRef.current[stepRef.current]);
|
|
769
772
|
const results = await Promise.all(fieldsToValidate.map(name => validateField(name)));
|
|
770
773
|
if (_scrollToFirstError.current) {
|