Interface PopperTypeahead<M extends org.patternfly.component.menu.PopperMenuToggleMenu<M>>
- Type Parameters:
M- A type that extendsPopperMenuToggleMenu, representing the specific implementation of the typeahead.
- All Known Implementing Classes:
PopperMultiTypeahead, PopperSingleTypeahead
@Deprecated
public interface PopperTypeahead<M extends org.patternfly.component.menu.PopperMenuToggleMenu<M>>
Deprecated.
A generic interface representing a typeahead component, which allows for dynamic filtering, searching,
and optionally creating new menu items based on user-provided input. This component offers flexible
configuration for handling search queries, displaying "no results" messages, and managing custom
item creation.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MallowNewItems(Function<String, Promise<MenuItem>> createItem) Deprecated.Allows the creation of new menu items based on user input.Deprecated.Allows the creation of new menu items based on user input.onNoResults(NoResults noResults) Deprecated.Configures the behavior for generating a "no results" menu item when no matching items are found in the menu list for the given input text.onSearch(SearchFilter searchFilter) Deprecated.Configures the search behavior for this typeahead.
-
Method Details
-
allowNewItems
Deprecated.Allows the creation of new menu items based on user input. This method enables the typeahead component to dynamically add custom items when the provided input does not match any existing items. A default prompt is used to guide the user with a message like "Create new item ''". -
allowNewItems
Deprecated.Allows the creation of new menu items based on user input. This method enables a typeahead component to provide functionality for dynamically adding custom items when the user-provided input does not match any existing items.- Parameters:
prompt- aFunctionthat takes aStringinput representing the user's data and returns aStringresponse, typically used to prompt the user or display a message.createItem- aFunctionthat takes aStringinput representing the user's data and returns aPromiseof aMenuItem, representing the newly created item.- Returns:
- an instance of the enclosing type, enabling method chaining for further configuration.
-