Creates a new TextInput.
The arguments.
Gets the align-items CSS property.
Sets the align-items CSS property.
Gets the align-self CSS property.
Sets the align-self CSS property.
Gets the Binding object for the element.
Sets the Binding object for the element.
Gets whether the input should blur when the enter key is pressed.
Sets whether the input should blur when the enter key is pressed.
Gets whether the input should blur when the escape key is pressed.
Sets whether the input should blur when the escape key is pressed.
Get the DOMTokenList
of the underlying DOM element. This is essentially a shortcut to
element.dom.classList
.
Gets the root DOM node for this Element.
Gets whether the Element or its parent chain is enabled or not.
Sets whether the Element or its parent chain is enabled or not. Defaults to true
.
Gets whether the Element is in an error state.
Sets whether the Element is in an error state.
Gets the flex-basis CSS property.
Sets the flex-basis CSS property.
Gets the flex-direction CSS property.
Sets the flex-direction CSS property.
Gets the flex-grow CSS property.
Sets the flex-grow CSS property.
Gets the flex-shrink CSS property.
Sets the flex-shrink CSS property.
Gets the flex-wrap CSS property.
Sets the flex-wrap CSS property.
Gets the height of the Element in pixels.
Sets the height of the Element in pixels. Can also be an empty string to remove it.
Gets whether the Element is hidden.
Sets whether the Element is hidden.
Gets whether the Element is hidden all the way up to the root. If the Element itself or any of its parents are hidden then this is true.
Gets whether the Element will ignore parent events & variable states.
Sets whether the Element will ignore parent events & variable states.
Gets the input DOM element.
Gets the justify-content CSS property.
Sets the justify-content CSS property.
Gets the justify-self CSS property.
Sets the justify-self CSS property.
Gets the method to call when keyup is called on the input DOM element.
Sets the method to call when keyup is called on the input DOM element.
Gets / sets the validate method for the input.
Sets the placeholder text of the input.
Sets the placeholder text of the input.
Gets whether the Element is read only.
Sets whether the Element is read only.
Sets whether the input should flash on changes.
Sets whether the input should flash on changes.
Shortcut to Element.dom.style.
Gets the tabIndex of the Element.
Sets the tabIndex of the Element.
Gets the width of the Element in pixels.
Sets the width of the Element in pixels. Can also be an empty string to remove it.
Links the specified observers and paths to the Element's data binding.
An array of observers or a single observer.
A path for the observer(s) or an array of paths that maps to each separate observer.
Unbinds an event listener for the specified event name. If a callback function is provided, only that specific listener is removed. If no callback is provided, all listeners for the event are removed. If no event name is provided, all listeners for all events are removed.
Optional
name: stringThe name of the event to unbind. If not provided, all events are unbound.
Optional
fn: HandleEventThe specific callback function to remove. If not provided, all listeners for the event are removed.
The current instance for chaining.
// Register an event listener
const callback = (arg1, arg2) => {
console.log('Event triggered with arguments:', arg1, arg2);
};
events.on('testEvent', callback);
// Unbind the specific event listener
events.unbind('testEvent', callback);
// Unbind all listeners for a specific event
events.unbind('testEvent');
// Unbind all listeners for all events
events.unbind();
Static
createCreates a new Element of the desired type.
The type of the Element (registered by Element#register).
Arguments for the Element.
The new Element or undefined if type is not found.
Static
registerThe type we want to reference this Element by.
The actual class of the Element.
Optional
defaultArguments: anyDefault arguments when creating this type.
Static
unregisterStatic
Readonly
EVENT_Fired when the mouse is clicked on the Element but only if the Element is enabled. The native DOM MouseEvent is passed as a parameter to the event handler.
Static
Readonly
EVENT_Fired after the element has been destroyed. Both the DOM element and the owner Element instance are passed as parameters to the event handler.
Static
Readonly
EVENT_Fired when the Element gets disabled.
Static
Readonly
EVENT_Fired when the Element gets enabled.
Static
Readonly
EVENT_Fired when the Element gets hidden.
Static
Readonly
EVENT_Fired when the Element or any of its parent get hidden.
Static
Readonly
EVENT_Fired when the mouse starts hovering on the Element. The native DOM MouseEvent is passed as a parameter to the event handler.
Static
Readonly
EVENT_Fired when the mouse stops hovering on the Element. The native DOM MouseEvent is passed as a parameter to the event handler.
Static
Readonly
EVENT_Fired when the Element's parent gets set.
Static
Readonly
EVENT_Fired when the readOnly property of an Element changes.
Static
Readonly
EVENT_Fired when the Element stops being hidden.
Static
Readonly
EVENT_Fired when the Element and all of its parents become visible.
The TextInput is an input element of type text.