Class PopperSingleTypeahead

All Implemented Interfaces:
Attachable, ElementAttributeMethods<HTMLElement, PopperSingleTypeahead>, ElementClassListMethods<HTMLElement, PopperSingleTypeahead>, ElementConsumerMethods<HTMLElement, PopperSingleTypeahead>, ElementContainerMethods<HTMLElement, PopperSingleTypeahead>, ElementEventMethods<HTMLElement, PopperSingleTypeahead>, ElementIdMethods<HTMLElement, PopperSingleTypeahead>, ElementQueryMethods<HTMLElement>, HTMLElementAttributeMethods<HTMLElement, PopperSingleTypeahead>, HTMLElementDataMethods<HTMLElement, PopperSingleTypeahead>, HTMLElementStyleMethods<HTMLElement, PopperSingleTypeahead>, HTMLElementVisibilityMethods<HTMLElement, PopperSingleTypeahead>, IsElement<HTMLElement>, TypedBuilder<HTMLElement, PopperSingleTypeahead>, Component, Expandable<HTMLElement, PopperSingleTypeahead>, PopperTypeahead<PopperSingleTypeahead>, Modifiers.Disabled<HTMLElement, PopperSingleTypeahead>

@Deprecated(since="0.7.0", forRemoval=true) public class PopperSingleTypeahead extends ComponentDelegate<HTMLElement, PopperSingleTypeahead> implements PopperTypeahead<PopperSingleTypeahead>
Deprecated, for removal: This API element is subject to removal in a future version.
This implementation uses the Popper.js API, which is due to be removed soon. Use SingleTypeahead instead.
A typeahead is a select variant that replaces the typical button toggle for opening the select menu with a text input and button toggle combo. As a user enters characters into the text input, the menu options will be filtered to match.
  • Method Details

    • singleTypeahead

      public static PopperSingleTypeahead singleTypeahead(String id, String placeholder)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new PopperSingleTypeahead component with a MenuToggle of type MenuToggleType.typeahead and a SearchInput.
    • singleTypeahead

      public static PopperSingleTypeahead singleTypeahead(BaseSearchInput<?> searchInput)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new PopperSingleTypeahead instance using the provided BaseSearchInput.
      Parameters:
      searchInput - the BaseSearchInput used to configure the typeahead component. This input determines the search behavior and the interaction model of the typeahead.
      Returns:
      a new PopperSingleTypeahead instance initialized with a MenuToggle of type MenuToggleType.typeahead.
    • add

      public PopperSingleTypeahead add(Menu menu)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • allowNewItems

      public PopperSingleTypeahead allowNewItems(Function<String,String> prompt, Function<String, Promise<MenuItem>> createItem)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: PopperTypeahead
      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.
      Specified by:
      allowNewItems in interface PopperTypeahead<PopperSingleTypeahead>
      Parameters:
      prompt - a Function that takes a String input representing the user's data and returns a String response, typically used to prompt the user or display a message.
      createItem - a Function that takes a String input representing the user's data and returns a Promise of a MenuItem, representing the newly created item.
      Returns:
      an instance of the enclosing type, enabling method chaining for further configuration.
    • that

      public PopperSingleTypeahead that()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      that in interface TypedBuilder<HTMLElement, PopperSingleTypeahead>
    • onSearch

      public PopperSingleTypeahead onSearch(SearchFilter searchFilter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: PopperTypeahead
      Configures the search behavior for this typeahead.
      Specified by:
      onSearch in interface PopperTypeahead<PopperSingleTypeahead>
      Parameters:
      searchFilter - a SearchFilter that defines the search logic. The first parameter is a MenuItem representing a menu item, and the second parameter is a String representing the search query. The predicate should return true for items matching the search.
      Returns:
      the PopperSingleTypeahead instance for method chaining.
    • onNoResults

      public PopperSingleTypeahead onNoResults(NoResults noResults)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: PopperTypeahead
      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.
      Specified by:
      onNoResults in interface PopperTypeahead<PopperSingleTypeahead>
      Parameters:
      noResults - a NoResults implementation responsible for defining how the "no results" menu item is created and displayed when no matches are found.
      Returns:
      the instance of the current type enabling method chaining.
    • noDefaultSelectHandler

      public PopperSingleTypeahead noDefaultSelectHandler()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • clear

      public void clear()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • clear

      public void clear(boolean fireEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • select

      public void select(String identifier)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • select

      public void select(String identifier, boolean fireEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • select

      public void select(MenuItem item)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • select

      public void select(MenuItem item, boolean fireEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • attach

      public void attach(MutationRecord mutationRecord)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      attach in interface Attachable
    • detach

      public void detach(MutationRecord mutationRecord)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      detach in interface Attachable
    • addMenu

      public PopperSingleTypeahead addMenu(Menu menu)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • applyToMenuToggle

      public PopperSingleTypeahead applyToMenuToggle(Consumer<MenuToggle> consumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Provides access to the underlying menu toggle using a fluent API style
    • disabled

      public PopperSingleTypeahead disabled(boolean disabled)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      disabled in interface Modifiers.Disabled<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
    • isDisabled

      public boolean isDisabled()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      isDisabled in interface Modifiers.Disabled<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
    • flip

      public PopperSingleTypeahead flip(boolean flip)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • placement

      public PopperSingleTypeahead placement(PopperPlacement placement)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • stayOpen

      public PopperSingleTypeahead stayOpen()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • stayOpen

      public PopperSingleTypeahead stayOpen(Predicate<Event> stayOpen)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specifies a condition that determines whether the menu should remain open when an event occurs.
      Parameters:
      stayOpen - a Predicate that evaluates an Event to determine if the menu remains open.
      Returns:
      the current instance with the condition applied, enabling method chaining.
    • zIndex

      public PopperSingleTypeahead zIndex(int zIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • ariaLabel

      public PopperSingleTypeahead ariaLabel(String label)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onLoaded

      Deprecated, for removal: This API element is subject to removal in a future version.
    • onToggle

      public PopperSingleTypeahead onToggle(ToggleHandler<PopperSingleTypeahead> toggleHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • collapse

      public void collapse(boolean fireEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      collapse in interface Expandable<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
    • expand

      public void expand(boolean fireEvent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      expand in interface Expandable<HTMLElement, B extends TypedBuilder<HTMLElement, B>>