revdev-components 0.89.0 → 0.91.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.
package/build/index.js
CHANGED
|
@@ -5360,7 +5360,7 @@ function OptionsAutocomplete(_a) {
|
|
|
5360
5360
|
}
|
|
5361
5361
|
}, [text]);
|
|
5362
5362
|
React.useEffect(function () {
|
|
5363
|
-
onChange(values
|
|
5363
|
+
onChange(values);
|
|
5364
5364
|
}, [values]);
|
|
5365
5365
|
var optionsModified = React.useMemo(function () {
|
|
5366
5366
|
var result = __spreadArray([], options, true);
|
|
@@ -5368,7 +5368,7 @@ function OptionsAutocomplete(_a) {
|
|
|
5368
5368
|
var textParsed_1 = text.trim().toLowerCase();
|
|
5369
5369
|
var hasOption = options.find(function (x) { return x.label === textParsed_1; });
|
|
5370
5370
|
if (!hasOption) {
|
|
5371
|
-
result.push({ label: text, value: text });
|
|
5371
|
+
result.push({ label: text, value: text, isNew: true });
|
|
5372
5372
|
}
|
|
5373
5373
|
}
|
|
5374
5374
|
return result;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ValueOption } from "src/interfaces";
|
|
3
|
+
export interface AutocompleteOption extends ValueOption {
|
|
4
|
+
isNew?: boolean;
|
|
5
|
+
}
|
|
3
6
|
interface Props<T> {
|
|
4
|
-
onChange: (options:
|
|
7
|
+
onChange: (options: AutocompleteOption[]) => void;
|
|
5
8
|
placeholder?: string;
|
|
6
|
-
requestAction: (text: string, options:
|
|
9
|
+
requestAction: (text: string, options: AutocompleteOption[]) => void;
|
|
7
10
|
requestResponse: {
|
|
8
11
|
isSuccess: boolean;
|
|
9
12
|
isLoading: boolean;
|