vibe.handlers.text

Handler for Text Input Data Types.

Implements the DataTypeHandler interface for various text-based inputs (e.g., text, email, password, textarea). Handles widget rendering, form data processing, and runtime validation specific to these types.

TextHandler

Handler for basic text input types.

render_widget

render_widget(name: str, current_value: str | None, error_message: str | None = None) -> str

Render the input widget HTML for this text-like field.

Keeps rendering server-side so templates remain the source of truth.

get_widget_template_name

get_widget_template_name() -> str

Return the Jinja template used by this handler's widget.

get_additional_widget_context

get_additional_widget_context(name: str, current_value: str | None, error_message: str | None = None) -> dict[str, Any]

Provide extra context for widget rendering beyond common fields.

process_form_data

process_form_data(name: str, form_data: MultiDictLike) -> str

Parse posted form data into a canonical Python value.

validate_input

validate_input(value: str | None, check_required: bool = True) -> str | None

Validate a parsed value against handler-specific constraints.