@ultraviolet/form 2.11.0 → 2.13.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.
|
@@ -55,18 +55,10 @@ const SelectInputFieldV2 = ({
|
|
|
55
55
|
const {
|
|
56
56
|
getError
|
|
57
57
|
} = useErrors();
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (option.value === val) {
|
|
63
|
-
formattedValue = option;
|
|
64
|
-
}
|
|
65
|
-
}));
|
|
66
|
-
return formattedValue;
|
|
67
|
-
}
|
|
68
|
-
return options.find(option => option.value === val);
|
|
69
|
-
}, [options]);
|
|
58
|
+
const handleChange = useCallback(value => {
|
|
59
|
+
onChange?.(value);
|
|
60
|
+
field.onChange(value);
|
|
61
|
+
}, [onChange, field]);
|
|
70
62
|
return jsx(SelectInputV2, {
|
|
71
63
|
name: field.name,
|
|
72
64
|
options: options,
|
|
@@ -84,13 +76,13 @@ const SelectInputFieldV2 = ({
|
|
|
84
76
|
},
|
|
85
77
|
placeholder: placeholder,
|
|
86
78
|
readOnly: readOnly,
|
|
87
|
-
|
|
79
|
+
multiselect: multiselect,
|
|
80
|
+
value: field.value,
|
|
88
81
|
placeholderSearch: placeholderSearch,
|
|
89
82
|
helper: helper,
|
|
90
83
|
emptyState: emptyState,
|
|
91
84
|
searchable: searchable,
|
|
92
85
|
clearable: clearable,
|
|
93
|
-
multiselect: multiselect,
|
|
94
86
|
descriptionDirection: descriptionDirection,
|
|
95
87
|
footer: footer,
|
|
96
88
|
labelDescription: labelDescription,
|
|
@@ -105,10 +97,7 @@ const SelectInputFieldV2 = ({
|
|
|
105
97
|
autofocus: autofocus,
|
|
106
98
|
optionalInfoPlacement: optionalInfoPlacement,
|
|
107
99
|
"aria-label": ariaLabel,
|
|
108
|
-
onChange:
|
|
109
|
-
field.onChange(value);
|
|
110
|
-
onChange?.(value);
|
|
111
|
-
}
|
|
100
|
+
onChange: handleChange
|
|
112
101
|
});
|
|
113
102
|
};
|
|
114
103
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/form",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "Ultraviolet Form",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18.x",
|
|
22
|
-
"pnpm": ">=
|
|
22
|
+
"pnpm": ">=9.x"
|
|
23
23
|
},
|
|
24
24
|
"os": [
|
|
25
25
|
"darwin",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@emotion/styled": "11.11.5",
|
|
54
54
|
"react-select": "5.8.0",
|
|
55
55
|
"react-hook-form": "7.51.3",
|
|
56
|
-
"@ultraviolet/ui": "1.
|
|
56
|
+
"@ultraviolet/ui": "1.50.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "rollup -c ../../rollup.config.mjs",
|