class

Opal::FormModule::Form

Inherits Reference < Object

Declarative multi-field form manager with real-time validation and keyboard navigation.

Constructors

new(title : String = "Setup Wizard")
Source

Instance methods

active_field_idx
Source
active_field_idx=(active_field_idx : Int32)
Source
confirm(name : String, label : String, default : Bool = false) : ConfirmField
Source
fields
Source
focus_next
Source
focus_prev
Source
multi_select(name : String, label : String, options : Array(String), selected : Array(String) = [] of String) : MultiSelectField
Source
password(name : String, label : String, min_length : Int32 = 0, default : String = "", placeholder : String = "") : PasswordField
Source
render(buffer : UI::Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
run(driver : Terminal::Driver | Nil = nil) : Hash(String, FormValue) | Nil

Interactively displays and executes the form

Source
select(name : String, label : String, options : Array(String), default_idx : Int32 = 0) : SelectField
Source
text(name : String, label : String, default : String = "", placeholder : String = "", required : Bool = false) : TextField
Source
title
Source
update_focus
Source
valid?
Source
validate(name : String, &validator : String -> String | Nil) : Nil
Source
validate(name : String, validator : ValidatorFn) : Nil
Source
validators
Source
values
Source