Home Reference Source
import SearchInputTemplate from '~/template/Form/SearchInputTemplate.js'
public class | source

SearchInputTemplate

Extends:

Template → SearchInputTemplate

Implements:

Abstract base for inputs which search

Constructor Summary

Public Constructor
public

Creates an empty language input template with no language selected.

Member Summary

Public Members
public

results: Element

List of all results

public

The input for the typical text input

public get
public

value: BehaviorSubject

Emits the language when applicable

Method Summary

Public Methods
public abstract

compare(a: T, b: T): boolean

Override to specify comparator

public

displayResults(resultObject: T[])

Display array of results

public abstract

Fixed template to embed in

public abstract

observeCancelFor(template: Template): Observable

Observable for fixed template

public
public abstract

Template for a given result

Inherited Summary

From class Template
public static get

An empty template

public static

Performs a move TemplateType for a given HTML id to return a template based on the id's root.

public static

fromInnerHTML(wrapper: HTMLElement, innerHTML: string, type: TemplateType): Template

From innerHTML will wrap in div

public static

Creates template <div> with text.

public get

underlyingNode: HTMLElement

Returns the underlying element

public

defineLinkedClass(name: string, className: string, node: HTMLElement)

Defines a linked class

public

defineLinkedInput(name: string, input: HTMLElement)

Defines a linked input

public

defineLinkedText(name: string, defaultValue: string): Text

Creates a field w/ updating text

public abstract

async didInitialLoad()

Called when loaded the first time

public abstract

Called when the view has loaded

public

Called when disappeared

public

getParent(defaultElement: HTMLElement): HTMLElement

Gets the original parent or else a default

public

loadBeforeContext(elem: HTMLElement): HTMLElement

Loads before an element

public

loadInContext(parent: HTMLElement, allowDupliacte: boolean): HTMLElement

Loads the template in a context

public

loadReplacingContext(source: HTMLElement): HTMLElement

Loads and replaces

public

prependInContext(parent: HTMLElement, allowDupliacte: boolean): HTMLElement

Prepends the template in a context

public

Removes from the context.

public

unique(): HTMLElement

Returns a unique instance of the template as an HTMLElement.

public

async willInitialLoad()

Called before loaded the first time

public

Called right before the view will appear on screen

public

Called before disappearing

Public Constructors

public constructor(o: Object) source

Creates an empty language input template with no language selected.

Override:

Template#constructor

Params:

NameTypeAttributeDescription
o Object

options

o.query Query

Object used for searching

o.placeholder string
  • optional
  • default: ""

placeholder for the input

o.inputType TextInputType
  • optional
  • default: Title

Default input type

Public Members

public results: Element source

List of all results

public textInput: TextInputTemplate source

The input for the typical text input

public get userInput source

public value: BehaviorSubject source

Emits the language when applicable

Public Methods

public abstract compare(a: T, b: T): boolean source

Override to specify comparator

Params:

NameTypeAttributeDescription
a T

First object of type of search type

b T

Second object

Return:

boolean

if equal

public displayResults(resultObject: T[]) source

Display array of results

Params:

NameTypeAttributeDescription
resultObject T[]
  • nullable: true

Iterable of results

public abstract fixedTemplateFor(result: T): Template source

Fixed template to embed in

Params:

NameTypeAttributeDescription
result T

Return:

Template

template w/ cancelable observable

public abstract observeCancelFor(template: Template): Observable source

Observable for fixed template

Params:

NameTypeAttributeDescription
template Template

The template from which to return 'cancel'

Return:

Observable

can emit any value doesn't matter

public observeValue() source

public abstract resultTemplateFor(result: T): Template source

Template for a given result

Params:

NameTypeAttributeDescription
result T

Return:

Template

template w/ lifecyle events