Skip to main content

Class: BlazeDropdown

ui/dropdown.BlazeDropdown

Hierarchy

Constructors

constructor

โ€ข new BlazeDropdown(selected, options, size)

Create a BlazeDropdown.

Parameters

NameTypeDescription
selectedstringThe initially selected option
optionsstring[]The options in the dropdown
sizenumberThe dropdown's font size in rem units

Overrides

BlazeElement.constructor

Defined in

src/ui/dropdown.ts:27

Properties

element

โ€ข Readonly element: HTMLDivElement

Inherited from

BlazeElement.element

Defined in

src/ui/element.ts:9


keys

โ€ข Readonly keys: KeyboardHandler

Inherited from

BlazeElement.keys

Defined in

src/ui/element.ts:11


label

โ€ข Private label: BlazeText<HTMLParagraphElement>

Defined in

src/ui/dropdown.ts:13


mouse

โ€ข Readonly mouse: MouseHandler

Inherited from

BlazeElement.mouse

Defined in

src/ui/element.ts:10


onSelect

โ€ข onSelect: (selected: string) => void

Type declaration

โ–ธ (selected): void

Callback that is called whenever the dropdown's selected option changes.

Parameters
NameType
selectedstring
Returns

void

Defined in

src/ui/dropdown.ts:18


options

โ€ข Private options: string[]

Defined in

src/ui/dropdown.ts:10


select

โ€ข Private select: HTMLSelectElement

Defined in

src/ui/dropdown.ts:12


selected

โ€ข Private selected: string

Defined in

src/ui/dropdown.ts:9


size

โ€ข Private size: number

Defined in

src/ui/dropdown.ts:7


touch

โ€ข Readonly touch: TouchHandler

Inherited from

BlazeElement.touch

Defined in

src/ui/element.ts:12

Methods

addLabel

โ–ธ addLabel(label, aside?): void

Add a label above or to the side of the input.

Parameters

NameTypeDefault valueDescription
labelstringundefinedThe label's text
asidebooleanfalseWether the label is above or to the side of the input

Returns

void

Defined in

src/ui/dropdown.ts:129


addOption

โ–ธ addOption(option): void

Adds an option to the dropdown.

Parameters

NameTypeDescription
optionstringThe option to add

Returns

void

Defined in

src/ui/dropdown.ts:99


getOptions

โ–ธ getOptions(): string[]

Gets the dropdown's options.

Returns

string[]

The dropdown's options

Defined in

src/ui/dropdown.ts:90


getSelected

โ–ธ getSelected(): string

Gets the dropdown's currently selected option.

Returns

string

The dropdown's currently selected option

Defined in

src/ui/dropdown.ts:63


getSize

โ–ธ getSize(): number

Gets the dropdown's font size.

Returns

number

The dropdown's font size in rem units

Defined in

src/ui/dropdown.ts:119


removeLabel

โ–ธ removeLabel(): void

Remove the input's label.

Returns

void

Defined in

src/ui/dropdown.ts:148


setOptions

โ–ธ setOptions(options): void

Sets the options in the dropdown.

Parameters

NameTypeDescription
optionsstring[]The dropdown's new options

Returns

void

Defined in

src/ui/dropdown.ts:72


setSelected

โ–ธ setSelected(selected): void

Sets the dropdown's selected option.

Parameters

NameTypeDescription
selectedstringThe dropdown's new selected option

Returns

void

Defined in

src/ui/dropdown.ts:51


setSize

โ–ธ setSize(size): void

Sets the dropdown's font size.

Parameters

NameTypeDescription
sizenumberThe dropdown's font size in rem units

Returns

void

Defined in

src/ui/dropdown.ts:109