x-ui-design 0.3.59 → 0.3.61
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
CHANGED
|
@@ -640,12 +640,6 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange) => {
|
|
|
640
640
|
}));
|
|
641
641
|
}
|
|
642
642
|
function setFieldValue(name, value, errors, reset = undefined) {
|
|
643
|
-
console.log('setFieldValue', {
|
|
644
|
-
name,
|
|
645
|
-
value,
|
|
646
|
-
errors,
|
|
647
|
-
reset
|
|
648
|
-
});
|
|
649
643
|
if (!reset && reset !== null && ([undefined, null].includes(value) || formRef.current[name] === value)) {
|
|
650
644
|
return;
|
|
651
645
|
}
|
|
@@ -715,12 +709,6 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange) => {
|
|
|
715
709
|
const fieldWarnings = [];
|
|
716
710
|
await Promise.all([rules].flat(1).map(async rule => {
|
|
717
711
|
rule = typeof rule === 'function' ? rule(formInstance) : rule;
|
|
718
|
-
console.log('validateField', {
|
|
719
|
-
name,
|
|
720
|
-
rule,
|
|
721
|
-
value,
|
|
722
|
-
form: formRef.current
|
|
723
|
-
});
|
|
724
712
|
if (rule.required && (rule.validateBooleanFalse && !value || value === undefined || value === null || value === '' || Array.isArray(value) && !value.length)) {
|
|
725
713
|
fieldErrors.push(rule.message || 'This field is required');
|
|
726
714
|
}
|
|
@@ -753,10 +741,6 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange) => {
|
|
|
753
741
|
}
|
|
754
742
|
async function validateFields(nameList) {
|
|
755
743
|
const fieldsToValidate = nameList || Object.keys(formRef.current);
|
|
756
|
-
console.log({
|
|
757
|
-
fieldsToValidate,
|
|
758
|
-
form: formRef.current
|
|
759
|
-
});
|
|
760
744
|
const results = await Promise.all(fieldsToValidate.map(name => validateField(name)));
|
|
761
745
|
return results.every(valid => valid);
|
|
762
746
|
}
|
|
@@ -1060,6 +1044,10 @@ const FormItemChildComponent = ({
|
|
|
1060
1044
|
setFieldValue(name, rawValue);
|
|
1061
1045
|
onChange?.(e, option);
|
|
1062
1046
|
};
|
|
1047
|
+
console.log({
|
|
1048
|
+
name,
|
|
1049
|
+
child: child.type
|
|
1050
|
+
});
|
|
1063
1051
|
return /*#__PURE__*/React$1.createElement(child.type, _extends({}, props, {
|
|
1064
1052
|
name: name,
|
|
1065
1053
|
onChange: handleChange
|
|
@@ -1357,7 +1345,6 @@ const Checkbox = /*#__PURE__*/forwardRef(({
|
|
|
1357
1345
|
if (checked !== undefined) {
|
|
1358
1346
|
setInternalChecked(checked);
|
|
1359
1347
|
}
|
|
1360
|
-
console.log('checkbox', name);
|
|
1361
1348
|
}, [checked]);
|
|
1362
1349
|
return /*#__PURE__*/React$1.createElement("div", {
|
|
1363
1350
|
className: `${prefixCls}-wrapper`
|