blockly > Input

Input class

Class for an input with optional fields.

Signature:

export declare class Input 

Constructors

Constructor Modifiers Description
(constructor)(name, sourceBlock) Constructs a new instance of the Input class

Properties

Property Modifiers Type Description
align Align Alignment of input's fields (left, right or centre).
connection Connection | null
fieldRow Field[]
name string
type readonly inputTypes

Methods

Method Modifiers Description
appendField(field, opt_name) Add a field (or label from string), and all prefix and suffix fields, to the end of the input's field row.
dispose() Sever all links to this input.
getShadowDom() Returns the XML representation of the connection's shadow block.
getSourceBlock() Get the source block for this input.
init() Initialize the fields on this input.
insertFieldAt(index, field, opt_name) Inserts a field (or label from string), and all prefix and suffix fields, at the location of the input's field row.
isVisible() Gets whether this input is visible or not.
makeConnection(type) protected Constructs a connection based on the type of this input's source block. Properly handles constructing headless connections for headless blocks and rendered connections for rendered blocks.
removeField(name, opt_quiet) Remove a field from this input.
setAlign(align) Change the alignment of the connection's field(s).
setCheck(check) Change a connection's compatibility.
setShadowDom(shadow) Changes the connection's shadow block.