FieldDropdown class
Class for an editable dropdown field.
Signature:
export declare class FieldDropdown extends Field<string>
Extends: Field<string>
Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructs a new instance of the | ||
Constructs a new instance of the |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
| string | ||
SVGElement | null | |||
| number | The y offset from the top of the field to the top of the image, if an image is selected. | |
| number | The total vertical padding above and below an image. | |
boolean | True once the field’s DOM has been created and it is safe to run ARIA updates in response to value changes. | ||
| Menu | null | The dropdown menu. | |
| (Optional) | ||
| (not declared) | Magic constant used to represent a separator in a list of dropdown items. | |
boolean | Serializable fields are saved by the serializer, non-serializable fields are not. Editable fields should also be serializable. |
Methods
Method | Modifiers | Description |
|---|---|---|
Updates the dropdown arrow to match the colour/style of the block. | ||
| Create an SVG based arrow. | |
| Create a tspan based arrow. | |
| Ensure that the input value is a valid language-neutral option. | |
| ||
| Update the value of this dropdown field. | |
| Disposes of events and DOM-references belonging to the dropdown editor. | |
Gets an ARIA-friendly label representation of this field's type. Implementations are responsible for, and encouraged to, return a localized version of the ARIA representation of the field's type. | ||
Gets an ARIA-friendly label representation of this field's value. Implementations are responsible for, and encouraged to, return a localized version of the ARIA representation of the field's value. | ||
Return a list of the options for this dropdown. | ||
| Use the If you use HTMLElement options in Node.js and call this function, ensure that you are supplying an implementation of HTMLElement, such as through jsdom-global. | |
Create the block UI for this dropdown. | ||
This is hacky way of determining if a dropdown field is a full-block field or not. The constants that control the border rect are the same ones that determine how we render full-block dropdown fields. It's a full-block field if it doesn't have the border rect (and it's a simple reporter block). | ||
| Handle the selection of an item in the dropdown menu. | |
Overrides the default label and sets additional aria state. | ||
| Draws the border with the correct width. | |
Update the options on this dropdown. This will reset the selected item to the first item in the list. | ||
| Whether or not the dropdown should add a border rect. | |
| Create a dropdown menu under the text. | |
| Factor out common words in statically defined options. Create prefix and/or suffix labels. | |
| Validates the data structure to be processed as an options list. |