Raxol.UI.Components.Input.MultiLineInput (Raxol v0.4.0)

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.

Functions

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

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

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

Renders the MultiLineInput component using the current state and context.

Unmounts the MultiLineInput component, performing any necessary cleanup.

Updates the MultiLineInput component state in response to messages or prop changes.

Types

t()

@type t() :: %Raxol.UI.Components.Input.MultiLineInput{
  aria_label: String.t() | nil,
  cursor_pos: {integer(), integer()},
  focused: boolean(),
  height: integer(),
  history: any(),
  id: String.t() | nil,
  lines: [String.t()],
  on_change: (String.t() -> 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_event(event, context, state)

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

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)

@spec render(t(), map()) :: any()

Renders the MultiLineInput component using the current state and context.

unmount(state)

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

Unmounts the MultiLineInput component, performing any necessary cleanup.

update(msg, state)

@spec update(term(), t()) :: {:noreply, t(), any()} | {:noreply, t()} | any()

Updates the MultiLineInput component state in response to messages or prop changes.