Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SearchFieldOptions

A data type that represents the configuration options for search field component.

Hierarchy

Index

Properties

Optional autocomplete

autocomplete: boolean

A Boolean indicating whether a search request should be triggered whenever the input field's value changes.

autoselect

autoselect: boolean

A Boolean indicating whether the first search result should automatically be selected, allowing the user to use the Enter key to select it.

Optional className

className: string

CSS class name to add to the view's element.

Optional data

data: { formatter?: (data: any) => string; request: (query: string) => Promise<any[]> }

Configuration for requesting and formatting data based on search results.

Type declaration

  • Optional formatter?: (data: any) => string

    A function that is used to format each result returned by the search request before rendering it in the field's search results.

      • (data: any): string
      • Parameters

        • data: any

        Returns string

  • request: (query: string) => Promise<any[]>

    A function that returns a Promise that performs the necessary search request using the specified query from the field.

      • (query: string): Promise<any[]>
      • Parameters

        • query: string

        Returns Promise<any[]>

Optional id

id: string

Unique identifier.

Optional placeholder

placeholder: string

Placeholder text for the input field.

Optional renderer

renderer: Function | string

Renderer for the view, which can either be an HTML string or a function that receives the view's data, if any, and returns the final HTML string to render as the view's content.

Optional requiresData

requiresData: boolean

A Boolean value that indicates whether the view requires valid data to be provided in order for it to be rendered. When this value is true and there is no data provided, then the view will be rendered as empty.

Default value is false.

Optional ui

ui: {}

An object that defines the CSS selectors for various UI elements in the view and their reference keys. When a view has been rendered and added to the DOM, you can reference and access these UI targets using this.ui.#key#, where #key# is the key used with this object.

Type declaration

  • [key: string]: string

Generated using TypeDoc