Class for an editable number field.
Optionalopt_value: string | numberThe initial value of the field. Should cast to a number. Defaults to 0.
Optionalopt_min: string | numberMinimum value.
Optionalopt_max: string | numberMaximum value.
Optionalopt_precision: string | numberPrecision for value.
Optionalopt_validator: FunctionA function that is called to validate changes to the field's value. Takes in a number & returns a validated number, 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/number#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.
Whether the field should consider the whole parent block to be its click target.
The HTML input element.
Maximum characters of text to display before adding an ellipsis.
Name of field. Unique within each block. Static labels are usually unnamed.
Serializable fields are saved by the XML renderer, non-serializable fields are not. Editable fields should also be serializable.
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.
Returns the current maximum value this field can contain. Default is Infinity.
The current maximum value this field can contain.
Returns the current minimum value this field can contain. Default is -Infinity.
The current minimum value this field can contain.
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.
Returns the current precision of this field. The precision being the number to which the field's value is rounded. A precision of 0 means that the value is not rounded.
The number to which this field's value is rounded.
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
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.
Set the maximum, minimum and precision constraints on this field. Any of these properties may be undefined or NaN to be disabled. Setting precision (usually a power of 10) enforces a minimum step between values. That is, the user's value will rounded to the closest multiple of precision. The least significant digit place is inferred from the precision. Integers values can be enforces by choosing an integer precision.
Minimum value.
Maximum value.
Precision for value.
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 maximum value this field can contain. Updates the value to reflect.
Maximum value.
Sets the minimum value this field can contain. Updates the value to reflect.
Minimum value.
Sets the precision of this field's value, i.e. the number to which the value is rounded. Updates the field to reflect.
The number to which the field's value is rounded.
Set whether this field is spellchecked by the browser.
True if checked.
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