Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TrivialComboBoxConfig<E>

Type parameters

  • E

Hierarchy

Index

Properties

Optional allowFreeText

allowFreeText: boolean

Whether or not to allow free text to be entered by the user.

default

false

Optional autoComplete

autoComplete: boolean

Whether or not to provide auto-completion.

default

true

Optional autoCompleteDelay

autoCompleteDelay: number

The number of milliseconds to wait until auto-completion is performed.

default

0

Optional autoCompleteFunction

autoCompleteFunction: function

Generates an autocompletion string for the current input of the user and currently highlighted entry in the dropdown.

param

the current text input from the user

param

the currently highlighted entry in the dropdown

returns

The full string (not only the completion part) to apply for auto-completion.

default

best effort implementation using entry properties

Type declaration

    • (editorText: string, entry: E): string
    • Parameters

      • editorText: string
      • entry: E

      Returns string

Optional editingMode

editingMode: EditingMode

Optional entries

entries: E[]

The initial list of suggested entries.

Optional entryRenderingFunction

entryRenderingFunction: RenderingFunction<E>

Rendering function used to display a suggested entry (i.e. an entry displayed in the dropdown).

param
returns

HTML string

default

Using the image2LinesTemplate from TrivialCore.

Optional entryToEditorTextFunction

entryToEditorTextFunction: function

Similar to autoCompleteFunction. Used to set the editor's text when focusing the component.

default

entry["displayValue"]

Type declaration

    • (entry: E): string
    • Parameters

      • entry: E

      Returns string

Optional freeTextEntryFactory

freeTextEntryFactory: function

Creates an entry (object) from a string entered by the user.

param

the text entered by the user

default

{ displayValue: freeText, _isFreeTextEntry: true }

Type declaration

    • (freeText: string): E | any
    • Parameters

      • freeText: string

      Returns E | any

Optional matchingOptions

matchingOptions: MatchingOptions

Used for highlighting suggested entries. Also used by the default filtering functions int TrivialCore.

default

{ matchingMode: 'contains', ignoreCase: true, maxLevenshteinDistance: 1 }

Optional noEntriesTemplate

noEntriesTemplate: string

Html string defining what to display when the list of results from the queryFunction is empty.

Optional queryFunction

queryFunction: QueryFunction<E>

Used to retrieve the entries ("suggestions") to be displayed in the dropdown box.

see

QueryFunction

default

creates a client-side query function using the provided entries

Optional selectedEntry

selectedEntry: E

Initially selected entry.

default

null

Optional selectedEntryRenderingFunction

selectedEntryRenderingFunction: RenderingFunction<E>

Rendering function used to display a selected entry (i.e. an entry inside the editor area of the component, not the dropdown).

param
returns

HTML string

default

wrapWithDefaultTagWrapper(entryRenderingFunction(entry))

Optional showClearButton

showClearButton: boolean

The clear button is a the small 'x' at the right of the entry display that can be clicked to clear the selection.

Optional showDropDownOnResultsOnly

showDropDownOnResultsOnly: boolean

It true, opening the dropdown will be delayed until the result callback of the queryFunction is called.

default

false

Optional showTrigger

showTrigger: boolean

The trigger is the button on the right side of the component that can be clicket to open the dropdown.

default

true

Optional spinnerTemplate

spinnerTemplate: string

HTML string defining the spinner to be displayed while entries are being retrieved.

Optional textHighlightingEntryLimit

textHighlightingEntryLimit: number

Performance setting. Defines the maximum number of entries until which text highlighting is performed. Set to 0 to disable text highlighting.

default

100

Optional valueFunction

valueFunction: function

Calculates the value to set on the original input.

param

the selected entry

returns

the string to set as the value of the original input

Type declaration

    • (entry: E): string
    • Parameters

      • entry: E

      Returns string

Generated using TypeDoc