@axinom/mosaic-ui 0.66.0-rc.4 → 0.66.0-rc.5
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/components/Explorer/BulkEdit/FormFieldsConfigConverter.d.ts.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Explorer/BulkEdit/FormFieldsConfigConverter.tsx +5 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.66.0-rc.
|
|
3
|
+
"version": "0.66.0-rc.5",
|
|
4
4
|
"description": "UI components for building Axinom Mosaic applications",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"publishConfig": {
|
|
113
113
|
"access": "public"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "e20e2f0767a4e2e9d39c21fa32e5eb26fe485b7a"
|
|
116
116
|
}
|
|
@@ -23,14 +23,7 @@ export const BulkEditFormFieldsConfigConverter = (
|
|
|
23
23
|
const keys = Object.keys(config);
|
|
24
24
|
|
|
25
25
|
const FormFields: React.FC = () => {
|
|
26
|
-
const {
|
|
27
|
-
setFieldValue,
|
|
28
|
-
setFieldTouched,
|
|
29
|
-
setErrors,
|
|
30
|
-
errors,
|
|
31
|
-
validateForm,
|
|
32
|
-
values,
|
|
33
|
-
} = useFormikContext<Data>();
|
|
26
|
+
const { setFieldValue, setFieldTouched, values } = useFormikContext<Data>();
|
|
34
27
|
|
|
35
28
|
// Effect to clear empty fields
|
|
36
29
|
// This will set fields with empty strings or empty arrays to undefined
|
|
@@ -46,19 +39,10 @@ export const BulkEditFormFieldsConfigConverter = (
|
|
|
46
39
|
});
|
|
47
40
|
}, [setFieldValue, values]);
|
|
48
41
|
|
|
49
|
-
const onFieldRemoved = (field: string): void => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (errors[field]) {
|
|
54
|
-
// If there was an error for this field, clear it
|
|
55
|
-
const newErrors = { ...errors };
|
|
56
|
-
delete newErrors[field];
|
|
57
|
-
|
|
58
|
-
setErrors(newErrors);
|
|
59
|
-
|
|
60
|
-
validateForm();
|
|
61
|
-
}
|
|
42
|
+
const onFieldRemoved = async (field: string): Promise<void> => {
|
|
43
|
+
// TODO: Update Formik to get the latest types for setFieldValue
|
|
44
|
+
await setFieldValue(field, undefined, false); // setFieldTouched will validate the form
|
|
45
|
+
await setFieldTouched(field, false);
|
|
62
46
|
};
|
|
63
47
|
|
|
64
48
|
const onFieldAdded = (field: string): void => {
|