x-ui-design 0.2.87 → 0.2.89
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/esm/types/types/form.d.ts +1 -1
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/lib/components/Select/Select.tsx +2 -2
- package/lib/hooks/useForm.ts +3 -3
- package/lib/types/form.ts +1 -1
- package/package.json +1 -1
- package/src/app/page.tsx +1819 -3392
package/dist/index.js
CHANGED
|
@@ -739,7 +739,7 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange) => {
|
|
|
739
739
|
const results = await Promise.all(fieldsToValidate.map(name => validateField(name)));
|
|
740
740
|
return results.every(valid => valid);
|
|
741
741
|
}
|
|
742
|
-
function resetFields(nameList) {
|
|
742
|
+
function resetFields(nameList, showError = true) {
|
|
743
743
|
if (nameList?.length) {
|
|
744
744
|
nameList.forEach(name => {
|
|
745
745
|
formRef.current[name] = initialValues[name];
|
|
@@ -749,13 +749,13 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange) => {
|
|
|
749
749
|
...prev,
|
|
750
750
|
[name]: []
|
|
751
751
|
}));
|
|
752
|
-
setFieldValue(name, initialValues[name], undefined,
|
|
752
|
+
setFieldValue(name, initialValues[name], undefined, showError);
|
|
753
753
|
});
|
|
754
754
|
} else {
|
|
755
755
|
touchedFieldsRef.current.clear();
|
|
756
756
|
warningsRef.current = {};
|
|
757
757
|
Object.keys(formRef.current).forEach(name => {
|
|
758
|
-
setFieldValue(name, initialValues[name], undefined,
|
|
758
|
+
setFieldValue(name, initialValues[name], undefined, showError);
|
|
759
759
|
});
|
|
760
760
|
}
|
|
761
761
|
formSubscribers.current.forEach(callback => callback(getFieldsValue()));
|
|
@@ -2923,7 +2923,7 @@ const SelectComponent = /*#__PURE__*/React$1.forwardRef(({
|
|
|
2923
2923
|
searchValue = '',
|
|
2924
2924
|
autoClearSearchValue = true,
|
|
2925
2925
|
filterOption = true,
|
|
2926
|
-
optionFilterProp
|
|
2926
|
+
optionFilterProp,
|
|
2927
2927
|
children,
|
|
2928
2928
|
options = [],
|
|
2929
2929
|
listHeight = LIST_HEIGHT,
|