class

Term2::Components::TextInput

Inherits Term2::Model < Reference < Object

Constructors

new(id : String)

Compatibility constructor: TextInput IDs are handled by Zone in some ports.

Source

Class methods

Instance methods

accept_current_suggestion

Accepts the current suggestion, appending the rest of the suggestion text to the current value.

Source
available_suggestions
Source
blur

Blur (unfocus) this model's zone.

Source
char_limit

Limits

Source
char_limit=(char_limit : Int32)

Limits

Source
completion_style
Source
completion_style=(completion_style : Style)
Source
current_suggestion
Source
cursor
Source
cursor=(cursor : Cursor)
Source
cursor_end
Source
cursor_pos
Source
cursor_pos=(pos : Int32)
Source
cursor_start
Source
cursor_style
Source
cursor_style=(cursor_style : Style)
Source
echo_character
Source
echo_character=(echo_character : Char)
Source
echo_mode
Source
echo_mode=(echo_mode : EchoMode)
Source
focus

Focus this model's zone.

Source
focused?

Whether this model is currently focused.

Source
init

Init is the first function that will be called. It returns an optional initial command. To not perform an initial command return nil.

Source
key_map

State

Source
key_map=(key_map : KeyMap)

State

Source
matched_suggestions
Source
next_suggestion

Moves to the next suggestion in the list

Source
placeholder
Source
placeholder=(placeholder : String)
Source
placeholder_style
Source
placeholder_style=(placeholder_style : Style)
Source
position
Source
prev_suggestion

Moves to the previous suggestion in the list

Source
prompt

General settings

Source
prompt=(prompt : String)

General settings

Source
prompt_style

Styles

Source
prompt_style=(prompt_style : Style)

Styles

Source
reset
Source
set_cursor(pos : Int32)
Source
set_suggestions(suggestions : Array(String))
Source
set_value(s : String)

SetValue sets the value of the text input.

Source
show_suggestions
Source
show_suggestions=(show_suggestions : Bool)
Source
suggestions=(s : Array(String))
Source
text_style
Source
text_style=(text_style : Style)
Source
update(msg : Msg) : Tuple(self, Cmd)

Update is called when a message is received. Use it to inspect the message and, in response, update the model and/or send a command.

Source
update_suggestions
Source
validate

Validate function

Source
validate=(validate : String -> Exception | Nil | Nil)

Validate function

Source
value
Source
value=(s : String)

Helper for property setter syntax

Source
view

View renders the program's UI, which is just a string. The view is rendered after every Update.

Source
width
Source
width=(width : Int32)
Source

Nested types