@equinor/eds-core-react 0.42.3 → 0.42.4
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/eds-core-react.cjs
CHANGED
|
@@ -9691,6 +9691,7 @@ function AutocompleteInner(props, ref) {
|
|
|
9691
9691
|
helperIcon,
|
|
9692
9692
|
noOptionsText = 'No options',
|
|
9693
9693
|
variant,
|
|
9694
|
+
onClear,
|
|
9694
9695
|
...other
|
|
9695
9696
|
} = props;
|
|
9696
9697
|
|
|
@@ -10123,6 +10124,7 @@ function AutocompleteInner(props, ref) {
|
|
|
10123
10124
|
}
|
|
10124
10125
|
}, [isOpen, refs.floating]);
|
|
10125
10126
|
const clear = () => {
|
|
10127
|
+
if (onClear) onClear();
|
|
10126
10128
|
resetCombobox();
|
|
10127
10129
|
//dont clear items if they are selected and disabled
|
|
10128
10130
|
setSelectedItems([...selectedDisabledItemsSet]);
|
|
@@ -185,6 +185,7 @@ function AutocompleteInner(props, ref) {
|
|
|
185
185
|
helperIcon,
|
|
186
186
|
noOptionsText = 'No options',
|
|
187
187
|
variant,
|
|
188
|
+
onClear,
|
|
188
189
|
...other
|
|
189
190
|
} = props;
|
|
190
191
|
|
|
@@ -617,6 +618,7 @@ function AutocompleteInner(props, ref) {
|
|
|
617
618
|
}
|
|
618
619
|
}, [isOpen, refs.floating]);
|
|
619
620
|
const clear = () => {
|
|
621
|
+
if (onClear) onClear();
|
|
620
622
|
resetCombobox();
|
|
621
623
|
//dont clear items if they are selected and disabled
|
|
622
624
|
setSelectedItems([...selectedDisabledItemsSet]);
|
|
@@ -87,6 +87,10 @@ export type AutocompleteProps<T> = {
|
|
|
87
87
|
* Method that is used to compare objects by value. If omitted, objects are matched by reference.
|
|
88
88
|
*/
|
|
89
89
|
itemCompare?: (value: T, compare: T) => boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Callback for clear all button
|
|
92
|
+
*/
|
|
93
|
+
onClear?: () => void;
|
|
90
94
|
} & HTMLAttributes<HTMLDivElement>;
|
|
91
95
|
declare function AutocompleteInner<T>(props: AutocompleteProps<T>, ref: React.ForwardedRef<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
92
96
|
export declare const Autocomplete: <T>(props: AutocompleteProps<T> & {
|