Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TrivialTagComboBoxConfig<E>

Type parameters

  • E

Hierarchy

Index

Properties

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 entryMerger

entryMerger: function

Used to merge the current partial tag with the newly selected by the user. (composite tags feature)

param

the current partial entry

param

the entry selected/entered by the user

returns

a new entry that will replace the current partial entry. This may in turn be a partial or complete entry.

default

always returns the newEntryPart

Type declaration

    • (partialEntry: E, newEntryPart: E): E
    • Parameters

      • partialEntry: E
      • newEntryPart: E

      Returns E

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 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 freeTextSeparators

freeTextSeparators: string[]

List of characters that, when entered by the user, trigger the creation of a tag/entry.

default

[",", ";"]

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 removePartialTagOnBlur

removePartialTagOnBlur: boolean

Whether or not a partial tag should be removed when the component looses the focus.

default

true

Optional selectedEntries

selectedEntries: E[]

Initially selected entries.

default

[]

Optional selectedEntry

selectedEntry: E

The initially selected entry. (Caution: use selectedEntries for TrivialTagBox).

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 selectionAcceptor

selectionAcceptor: function

Decides whether the user's input/selection is accepted or not. This can serve many purposes, including

  • implementing duplicate prevention
  • limiting the number of selectable tags
  • allowing or disallowing free text entries (this was previously possible using the now removed allowFreeText option)
  • allowing only free text entries of a certain form
  • ...
param

the entry to be accepted or not

returns

true if the entry is accepted, false if not

default

accepting all non-free-text entries

Type declaration

    • (entry: E): boolean
    • Parameters

      • entry: E

      Returns boolean

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 tagCompleteDecider

tagCompleteDecider: function

Function deciding whether an entry entered by the user is complete or not (partial). A partial entry is an entry that needs more input from the user's side.

param
returns

true if the entry is considered complete, false if not

default

always returns true

Type declaration

    • (entry: E): boolean
    • Parameters

      • entry: E

      Returns boolean

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 list of selected entries

returns

the string to set as the value of the original input

Type declaration

    • (entries: E[]): string
    • Parameters

      • entries: E[]

      Returns string

Generated using TypeDoc