Options
All
  • Public
  • Public/Protected
  • All
Menu

A controller class for managing a text input widget that filters the contents of some other UI element

see

Application

param

Hierarchy

  • SearchFilter

Index

Constructors

  • new SearchFilter(__namedParameters?: { inputSelector: any; contentSelector: any; initial: string; callback: any; delay: number }): SearchFilter
  • Parameters

    • __namedParameters: { inputSelector: any; contentSelector: any; initial: string; callback: any; delay: number } = {}
      • inputSelector: any
      • contentSelector: any
      • initial: string
      • callback: any
      • delay: number

    Returns SearchFilter

Properties

query: string

The value of the current query string

callback: Function

A callback function to trigger when the tab is changed

rgx: RegExp

The regular expression corresponding to the query that should be matched against

_inputSelector: string

The CSS selector used to target the tab navigation element

_input: HTMLElement

A reference to the HTML navigation element the tab controller is bound to

_contentSelector: string

The CSS selector used to target the tab content element

_content: HTMLElement

A reference to the HTML container element of the tab content

_filter: Function

A debounced function which applies the search filtering

Methods

  • bind(html: HTMLElement): void
  • Bind the SearchFilter controller to an HTML application

    Parameters

    • html: HTMLElement

    Returns void

  • filter(event: KeyboardEvent, query: string): void
  • Perform a filtering of the content by invoking the callback function

    Parameters

    • event: KeyboardEvent

      The triggering keyboard event

    • query: string

      The input search string

    Returns void

  • cleanQuery(query: string): string