Raxol.UI.Components.Input.MultiLineInput (Raxol v2.0.1)

View Source

A multi-line input component for text editing, supporting line wrapping, scrolling, selection, and accessibility.

BREAKING: All styling is now theme-driven. The style field and @default_style are removed. Use the theme system for all appearance customization.

Harmonized with modern Raxol component standards (style/theme merging, lifecycle hooks, accessibility props).

Summary

Types

t()

State for the MultiLineInput component. See @type t for field details.

Types

t()

@type t() :: %Raxol.UI.Components.Input.MultiLineInput{
  aria_label: String.t() | nil,
  cursor_pos: {integer(), integer()},
  desired_col: integer() | nil,
  focused: boolean(),
  height: integer(),
  history: any(),
  id: String.t() | nil,
  lines: [String.t()],
  on_change: (String.t() -> any()) | nil,
  on_submit: (-> any()) | nil,
  placeholder: String.t(),
  scroll_offset: {integer(), integer()},
  selection_end: {integer(), integer()} | nil,
  selection_start: {integer(), integer()} | nil,
  shift_held: boolean(),
  theme: map(),
  tooltip: String.t() | nil,
  value: String.t(),
  width: integer(),
  wrap: :none | :char | :word
}

State for the MultiLineInput component. See @type t for field details.

Functions

handle_backspace(state)

handle_blur(state)

handle_clipboard_content(content, state)

handle_copy(state)

handle_copy_selection(state)

handle_cut(state)

handle_delete(state)

handle_delete_selection(direction, state)

handle_enter(state)

handle_event(event, context, state)

Handles events for the MultiLineInput component, such as keypresses, mouse events, and context changes.

handle_focus(state)

handle_input(char_codepoint, state)

handle_move_cursor(direction, state)

handle_move_cursor_doc_end(state)

handle_move_cursor_doc_start(state)

handle_move_cursor_line_end(state)

handle_move_cursor_line_start(state)

handle_move_cursor_page(direction, state)

handle_move_cursor_to(arg, state)

handle_move_cursor_word_left(state)

handle_move_cursor_word_right(state)

handle_paste(state)

handle_select_all(state)

handle_select_to(arg, state)

handle_selection_move(state, direction)

handle_set_shift_held(held, state)

handle_unknown_message(msg, state)

handle_update_props(new_props, state)

init(props)

@spec init(map()) :: t()

Initializes the MultiLineInput state, harmonizing style/theme/extra props and splitting lines for editing.

mount(state)

@spec mount(t()) :: t()

Mounts the MultiLineInput component. Performs any setup needed after initialization.

render(state, context)

Renders the MultiLineInput component using the current state and context.

unmount(state)

@spec unmount(t()) :: t()

Unmounts the MultiLineInput component, performing any necessary cleanup.