Skip to content

@serenity-is/corelib / SingleSelect2

Class: SingleSelect2

Defined in: src/ui/editors/select2.tsx:2538

Extends

Constructors

Constructor

new SingleSelect2(): SingleSelect2

Returns

SingleSelect2

Inherited from

AbstractSelect2.constructor

Properties

autofocus

protected autofocus: boolean

Defined in: src/ui/editors/select2.tsx:1151

Inherited from

AbstractSelect2.autofocus


container

container: HTMLElement

Defined in: src/ui/editors/select2.tsx:1152

Inherited from

AbstractSelect2.container


containerEventName

protected containerEventName: string

Defined in: src/ui/editors/select2.tsx:1154

Inherited from

AbstractSelect2.containerEventName


containerId

protected containerId: string

Defined in: src/ui/editors/select2.tsx:1153

Inherited from

AbstractSelect2.containerId


context

protected context: any

Defined in: src/ui/editors/select2.tsx:1155

Inherited from

AbstractSelect2.context


dropdown: HTMLElement

Defined in: src/ui/editors/select2.tsx:1156

Inherited from

AbstractSelect2.dropdown


elementTabIndex

protected elementTabIndex: string

Defined in: src/ui/editors/select2.tsx:1157

Inherited from

AbstractSelect2.elementTabIndex


enabledInterface

protected enabledInterface: boolean

Defined in: src/ui/editors/select2.tsx:1158

Inherited from

AbstractSelect2.enabledInterface


focusser

protected focusser: HTMLInputElement

Defined in: src/ui/editors/select2.tsx:2540


id()

protected id: (item) => string

Defined in: src/ui/editors/select2.tsx:1159

Parameters

item

any

Returns

string

Inherited from

AbstractSelect2.id


nextSearchTerm

protected nextSearchTerm: string

Defined in: src/ui/editors/select2.tsx:1160

Inherited from

AbstractSelect2.nextSearchTerm


opts

protected opts: Select2Options

Defined in: src/ui/editors/select2.tsx:1161

Inherited from

AbstractSelect2.opts


propertyObserver

protected propertyObserver: MutationObserver

Defined in: src/ui/editors/select2.tsx:1162

Inherited from

AbstractSelect2.propertyObserver


queryCount

protected queryCount: number

Defined in: src/ui/editors/select2.tsx:1163

Inherited from

AbstractSelect2.queryCount


results

protected results: HTMLElement

Defined in: src/ui/editors/select2.tsx:1164

Inherited from

AbstractSelect2.results


resultsPage

protected resultsPage: number

Defined in: src/ui/editors/select2.tsx:1165

Inherited from

AbstractSelect2.resultsPage


search: HTMLInputElement

Defined in: src/ui/editors/select2.tsx:1166

Inherited from

AbstractSelect2.search


select

protected select: HTMLSelectElement

Defined in: src/ui/editors/select2.tsx:1376

Inherited from

AbstractSelect2.select


selection

protected selection: HTMLElement

Defined in: src/ui/editors/select2.tsx:1167

Inherited from

AbstractSelect2.selection


showSearchInput

protected showSearchInput: boolean

Defined in: src/ui/editors/select2.tsx:1168

Inherited from

AbstractSelect2.showSearchInput

Methods

blur()

protected blur(): void

Defined in: src/ui/editors/select2.tsx:2431

Returns

void

Inherited from

AbstractSelect2.blur


cancel()

protected cancel(e?): void

Defined in: src/ui/editors/select2.tsx:2635

Parameters

e?

Event

Returns

void

Overrides

AbstractSelect2.cancel


clear()

protected clear(triggerChange?): void

Defined in: src/ui/editors/select2.tsx:2845

Parameters

triggerChange?

boolean

Returns

void


clearDropdownAlignmentPreference()

protected clearDropdownAlignmentPreference(): void

Defined in: src/ui/editors/select2.tsx:1834

Returns

void

Inherited from

AbstractSelect2.clearDropdownAlignmentPreference


clearSearch()

protected clearSearch(): void

Defined in: src/ui/editors/select2.tsx:3101

Returns

void

Overrides

AbstractSelect2.clearSearch


clearTouchMoved()

protected clearTouchMoved(): void

Defined in: src/ui/editors/select2.tsx:2107

Returns

void

Inherited from

AbstractSelect2.clearTouchMoved


close()

close(): void

Defined in: src/ui/editors/select2.tsx:2609

Returns

void

Overrides

AbstractSelect2.close


countSelectableResults()

protected countSelectableResults(): number

Defined in: src/ui/editors/select2.tsx:2111

Returns

number

Inherited from

AbstractSelect2.countSelectableResults


createContainer()

createContainer(): HTMLElement

Defined in: src/ui/editors/select2.tsx:2542

Returns

HTMLElement

Overrides

AbstractSelect2.createContainer


data()

data(value?): void | Select2Item

Defined in: src/ui/editors/select2.tsx:3106

Parameters

value?

Select2Item

Returns

void | Select2Item

Overrides

AbstractSelect2.data


destroy()

destroy(): void

Defined in: src/ui/editors/select2.tsx:2644

Returns

void

Overrides

AbstractSelect2.destroy


disable()

disable(): void

Defined in: src/ui/editors/select2.tsx:1697

Returns

void

Inherited from

AbstractSelect2.disable


enable()

enable(enabled?): void

Defined in: src/ui/editors/select2.tsx:1688

Parameters

enabled?

boolean

Returns

void

Inherited from

AbstractSelect2.enable


enableInterface()

protected enableInterface(): boolean

Defined in: src/ui/editors/select2.tsx:2563

Returns

boolean

Overrides

AbstractSelect2.enableInterface


ensureHighlightVisible()

protected ensureHighlightVisible(): void

Defined in: src/ui/editors/select2.tsx:2006

Returns

void

Inherited from

AbstractSelect2.ensureHighlightVisible


externalSearch()

protected externalSearch(term): void

Defined in: src/ui/editors/select2.tsx:1992

Opens control, sets input value, and updates results.

Parameters

term

string

Returns

void

Inherited from

AbstractSelect2.externalSearch


findHighlightableChoices()

protected findHighlightableChoices(): Element[]

Defined in: src/ui/editors/select2.tsx:2053

Returns

Element[]

Inherited from

AbstractSelect2.findHighlightableChoices


focus()

focus(): void

Defined in: src/ui/editors/select2.tsx:2620

Returns

void

Overrides

AbstractSelect2.focus


focusSearch()

protected focusSearch(): void

Defined in: src/ui/editors/select2.tsx:2443

Returns

void

Inherited from

AbstractSelect2.focusSearch


getMaximumSelectionSize()

protected getMaximumSelectionSize(): any

Defined in: src/ui/editors/select2.tsx:2002

Returns

any

Inherited from

AbstractSelect2.getMaximumSelectionSize


getPlaceholder()

protected getPlaceholder(): string

Defined in: src/ui/editors/select2.tsx:2932

Returns

string

Overrides

AbstractSelect2.getPlaceholder


getPlaceholderOption()

protected getPlaceholderOption(): HTMLOptionElement

Defined in: src/ui/editors/select2.tsx:2472

Returns

HTMLOptionElement

Inherited from

AbstractSelect2.getPlaceholderOption


handleSearchBlur()

protected handleSearchBlur(): void

Defined in: src/ui/editors/select2.tsx:2196

Returns

void

Inherited from

AbstractSelect2.handleSearchBlur


handleSearchFocus()

protected handleSearchFocus(): void

Defined in: src/ui/editors/select2.tsx:2192

Returns

void

Inherited from

AbstractSelect2.handleSearchFocus


handleSearchInput()

protected handleSearchInput(): void

Defined in: src/ui/editors/select2.tsx:2188

Returns

void

Inherited from

AbstractSelect2.handleSearchInput


highlight()

protected highlight(index?): number

Defined in: src/ui/editors/select2.tsx:2071

Parameters

index?

number

Returns

number

Inherited from

AbstractSelect2.highlight


highlightUnderEvent()

protected highlightUnderEvent(event): void

Defined in: src/ui/editors/select2.tsx:2115

Parameters

event

Event

Returns

void

Inherited from

AbstractSelect2.highlightUnderEvent


init()

init(opts): void

Defined in: src/ui/editors/select2.tsx:1180

Parameters

opts

Select2Options

Returns

void

Inherited from

AbstractSelect2.init


initContainer()

initContainer(): void

Defined in: src/ui/editors/select2.tsx:2655

Returns

void

Overrides

AbstractSelect2.initContainer


initContainerWidth()

protected initContainerWidth(): void

Defined in: src/ui/editors/select2.tsx:2492

Get the desired width for the container element. This is derived first from option width passed to select2, then the inline 'style' on the original element, and finally falls back to the jQuery calculated element width.

Returns

void

Inherited from

AbstractSelect2.initContainerWidth


initSelection()

protected initSelection(): void

Defined in: src/ui/editors/select2.tsx:2868

Sets selection based on source element's value

Returns

void

Overrides

AbstractSelect2.initSelection


isFocused()

isFocused(): boolean

Defined in: src/ui/editors/select2.tsx:2631

Returns

boolean

Overrides

AbstractSelect2.isFocused


isInterfaceEnabled()

protected isInterfaceEnabled(): boolean

Defined in: src/ui/editors/select2.tsx:1671

Returns

boolean

Inherited from

AbstractSelect2.isInterfaceEnabled


isPlaceholderOptionSelected()

protected isPlaceholderOptionSelected(): boolean

Defined in: src/ui/editors/select2.tsx:2888

Returns

boolean


loadMoreIfNeeded()

protected loadMoreIfNeeded(): void

Defined in: src/ui/editors/select2.tsx:2126

Returns

void

Inherited from

AbstractSelect2.loadMoreIfNeeded


monitorSource()

protected monitorSource(): void

Defined in: src/ui/editors/select2.tsx:1620

Monitor the original element for changes and update select2 accordingly

Returns

void

Inherited from

AbstractSelect2.monitorSource


moveHighlight()

protected moveHighlight(delta): void

Defined in: src/ui/editors/select2.tsx:2057

Parameters

delta

number

Returns

void

Inherited from

AbstractSelect2.moveHighlight


onSelect()

protected onSelect(data, options): void

Defined in: src/ui/editors/select2.tsx:3003

Parameters

data

Select2Item

options

any

Returns

void

Overrides

AbstractSelect2.onSelect


open()

open(): boolean

Defined in: src/ui/editors/select2.tsx:1846

Opens the dropdown

Returns

boolean

whether or not dropdown was opened. This method will return false if, for example, the dropdown is already open, or if the 'open' event listener on the element called preventDefault().

Inherited from

AbstractSelect2.open


opened()

opened(): boolean

Defined in: src/ui/editors/select2.tsx:1710

Returns

boolean

Inherited from

AbstractSelect2.opened


opening()

protected opening(): void

Defined in: src/ui/editors/select2.tsx:2571

Performs the opening of the dropdown

Returns

void

Overrides

AbstractSelect2.opening


optionToData()

optionToData(element): Select2Item

Defined in: src/ui/editors/select2.tsx:1356

Parameters

element

HTMLOptGroupElement | HTMLOptionElement

Returns

Select2Item

Inherited from

AbstractSelect2.optionToData


positionDropdown()

positionDropdown(): void

Defined in: src/ui/editors/select2.tsx:1714

Returns

void

Inherited from

AbstractSelect2.positionDropdown


postprocessResults()

protected postprocessResults(data, initial, noHighlightUpdate?): void

Defined in: src/ui/editors/select2.tsx:2960

Parameters

data

Select2Result

initial

boolean

noHighlightUpdate?

boolean

Returns

void

Overrides

AbstractSelect2.postprocessResults


prepareOpts()

protected prepareOpts(opts): Select2Options

Defined in: src/ui/editors/select2.tsx:2897

Parameters

opts

Select2Options

Returns

Select2Options

Overrides

AbstractSelect2.prepareOpts


readonly()

readonly(enabled?): void

Defined in: src/ui/editors/select2.tsx:1701

Parameters

enabled?

boolean

Returns

void

Inherited from

AbstractSelect2.readonly


removeHighlight()

protected removeHighlight(): void

Defined in: src/ui/editors/select2.tsx:2099

Returns

void

Inherited from

AbstractSelect2.removeHighlight


selectHighlighted()

protected selectHighlighted(options?): void

Defined in: src/ui/editors/select2.tsx:2447

Parameters

options?

any

Returns

void

Inherited from

AbstractSelect2.selectHighlighted


setPlaceholder()

protected setPlaceholder(): void

Defined in: src/ui/editors/select2.tsx:2943

Returns

void


shouldOpen()

protected shouldOpen(): boolean

Defined in: src/ui/editors/select2.tsx:1824

Returns

boolean

Inherited from

AbstractSelect2.shouldOpen


showSearch()

protected showSearch(showSearchInput): void

Defined in: src/ui/editors/select2.tsx:2991

Parameters

showSearchInput

boolean

Returns

void


tokenize()

protected tokenize(): string

Defined in: src/ui/editors/select2.tsx:2184

Default tokenizer function which does nothing

Returns

string

Inherited from

AbstractSelect2.tokenize


touchMoved()

protected touchMoved(): void

Defined in: src/ui/editors/select2.tsx:2103

Returns

void

Inherited from

AbstractSelect2.touchMoved


triggerChange()

protected triggerChange(details?): void

Defined in: src/ui/editors/select2.tsx:1652

Triggers the change event on the source element

Parameters

details?

any

Returns

void

Inherited from

AbstractSelect2.triggerChange


triggerSelect()

protected triggerSelect(data): boolean

Defined in: src/ui/editors/select2.tsx:1643

Parameters

data

Select2Item

Returns

boolean

Inherited from

AbstractSelect2.triggerSelect


updateResults()

protected updateResults(initial?): void

Defined in: src/ui/editors/select2.tsx:2257

Parameters

initial?

boolean

whether or not this is the call to this method right after the dropdown has been opened

Returns

void

Inherited from

AbstractSelect2.updateResults


updateSelection()

protected updateSelection(data): void

Defined in: src/ui/editors/select2.tsx:3027

Parameters

data

Select2Item

Returns

void


val()

val(val?, triggerChange?): string

Defined in: src/ui/editors/select2.tsx:3057

Parameters

val?

string

triggerChange?

boolean

Returns

string

Overrides

AbstractSelect2.val