x-ui-design 0.5.14 → 0.5.16
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 +5 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/lib/hooks/useForm.ts +6 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -732,6 +732,11 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange, scrollToFir
|
|
|
732
732
|
const fieldWarnings = [];
|
|
733
733
|
await Promise.all([rules].flat(1).map(async rule => {
|
|
734
734
|
rule = typeof rule === 'function' ? rule(formInstance) : rule;
|
|
735
|
+
console.log({
|
|
736
|
+
name,
|
|
737
|
+
rule: JSON.parse(JSON.stringify(rule)),
|
|
738
|
+
value
|
|
739
|
+
});
|
|
735
740
|
if (rule.required && (rule.validateBooleanFalse && !value || value === undefined || value === null || value === '' || Array.isArray(value) && !value.length)) {
|
|
736
741
|
fieldErrors.push(rule.message || 'This field is required');
|
|
737
742
|
}
|
|
@@ -741,7 +746,6 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange, scrollToFir
|
|
|
741
746
|
if ((typeof value === 'string' || typeof value === 'number' || Array.isArray(value)) && rule.max !== undefined && String(value).length > rule.max) {
|
|
742
747
|
fieldErrors.push(rule.message || `Must be at most ${rule.max} characters`);
|
|
743
748
|
}
|
|
744
|
-
debugger;
|
|
745
749
|
if (value !== undefined && rule.pattern && !rule.pattern.test(String(value))) {
|
|
746
750
|
fieldErrors.push(rule.message || 'Invalid format');
|
|
747
751
|
}
|