@evoke-platform/ui-components 1.0.1-dev.0 → 1.0.1-dev.1
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.
@@ -108,6 +108,7 @@ const ValueEditor = (props) => {
|
|
108
108
|
}
|
109
109
|
}
|
110
110
|
else {
|
111
|
+
const [inputValue, setInputValue] = useState('');
|
111
112
|
const isMultiple = inputType === 'array' || ['in', 'notIn'].includes(operator);
|
112
113
|
const options = [
|
113
114
|
...(values?.sort((a, b) => a.label.localeCompare(b.label)) ?? []),
|
@@ -127,7 +128,15 @@ const ValueEditor = (props) => {
|
|
127
128
|
value = newValue?.name ?? newValue?.value?.name ?? '';
|
128
129
|
}
|
129
130
|
handleOnChange(value);
|
130
|
-
},
|
131
|
+
}, onBlur: () => {
|
132
|
+
if (inputValue) {
|
133
|
+
const newValues = Array.isArray(value) ? [...value, inputValue] : [inputValue];
|
134
|
+
handleOnChange(Array.from(new Set(newValues)));
|
135
|
+
}
|
136
|
+
setInputValue('');
|
137
|
+
}, onInputChange: (event, newInputValue) => {
|
138
|
+
setInputValue(newInputValue);
|
139
|
+
}, inputValue: inputValue, renderInput: (params) => (React.createElement(TextField, { inputRef: inputRef, label: params?.label, ...params, size: "small", sx: { backgroundColor: '#fff' } })),
|
131
140
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
132
141
|
getOptionLabel: (option) => {
|
133
142
|
if (typeof option === 'string') {
|