Class for an editable dropdown field.
A non-empty array of options for a dropdown list, or a function which generates these options.
Optionalopt_validator: FunctionA function that is called to validate changes to the field's value. Takes in a language-neutral dropdown option & returns a validated language-neutral dropdown option, or null to abort the change.
Optionalopt_config: ObjectA map of options used to configure the field. See the [field creation documentation]https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/dropdown#creation for a list of properties this parameter supports.
Mouse cursor style when over the hotspot that initiates the editor.
Has this field been disposed of?
Editable fields usually show some sort of UI indicating they are editable. They will also be saved by the XML renderer.
Maximum characters of text to display before adding an ellipsis.
Name of field. Unique within each block. Static labels are usually unnamed.
The prefix field label, of common words set after options are trimmed.
Serializable fields are saved by the XML renderer, non-serializable fields are not. Editable fields should also be serializable.
The suffix field label, of common words set after options are trimmed.
Sets the field's value based on the given XML element. Should only be called by Blockly.Xml.
The element containing info about the field's state.
Returns whether or not we should flip the field in RTL.
True if we should flip in RTL.
Return a list of the options for this dropdown.
Optionalopt_useCache: booleanFor dynamic options, whether or not to use the cached options or to re-generate them.
A non-empty array of option tuples: (human-readable text or image, language-neutral name).
Search through the list of inputs and their fields in order to find the parent input of a field.
The input that the field belongs to.
Gets the group element for this editable field. Used for measuring the size and for positioning.
The group element.
Get the text from this field.
Current text.
Returns the tooltip text for this field.
The tooltip text for this field.
Gets the validation function for editable fields, or null if not set.
Validation function, or null.
Get the current value of the field.
Current value.
Check whether this field defines the showEditor_ function.
Whether this field is clickable.
Check whether this field is currently editable. Some fields are never EDITABLE (e.g. text labels). Other fields may be EDITABLE but may exist on non-editable blocks.
Whether this field is editable and on an editable block
True if the option list is generated by a function. Otherwise false.
Check whether this field should be serialized by the XML renderer. Handles the logic for backwards compatibility and incongruous states.
Whether this field should be serialized or not.
Returns whether or not the field is tab navigable.
True if the field is tab navigable.
Gets whether this editable field is visible or not.
True if visible.
Handles the given keyboard shortcut.
The shortcut to be handled.
True if the shortcut has been handled, false otherwise.
Add the cursor SVG to this fields SVG group.
The SVG root of the cursor to be added to the field group.
Add the marker SVG to this fields SVG group.
The SVG root of the marker to be added to the field group.
Sets the tooltip for this field.
The text for the tooltip, a function that returns the text for the tooltip, a parent object whose tooltip will be used, or null to display the tooltip of the parent block. To not display a tooltip pass the empty string.
Sets a new validation function for editable fields, or clears a previously set validator.
The validator function takes in the new field value, and returns validated value. The validated value could be the input value, a modified version of the input value, or null to abort the change.
If the function does not return anything (or returns undefined) the new value is accepted as valid. This is to allow for fields using the validated function as a field-level change event notification.
The validator function or null to clear a previous validator.
Used to change the value of the field. Handles validation and events. Subclasses should override doClassValidation_ and doValueUpdate_ rather than this method.
New value.
Show an editor when the field is clicked only if the field is clickable.
Optionalopt_e: EventOptional mouse event that triggered the field to open, or undefined if triggered programmatically.
Add or remove the UI indicating if this field is editable or not.
Fake class which should be extended to avoid inheriting static properties