class
Opal::FormModule::Form
- Opal::FormModule::Form
- Reference
- Object
Overview
Declarative multi-field form manager with real-time validation and keyboard navigation.
Defined in:
opal/form/form.crConstructors
Instance Method Summary
- #active_field_idx : Int32
- #active_field_idx=(active_field_idx : Int32)
- #confirm(name : String, label : String, default : Bool = false) : ConfirmField
- #fields : Array(FormField)
- #focus_next : Nil
- #focus_prev : Nil
- #multi_select(name : String, label : String, options : Array(String), selected : Array(String) = [] of String) : MultiSelectField
- #password(name : String, label : String, min_length : Int32 = 0, default : String = "", placeholder : String = "") : PasswordField
- #render(buffer : UI::Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
-
#run(driver : Terminal::Driver | Nil = nil) : Hash(String, FormValue) | Nil
Interactively displays and executes the form
- #select(name : String, label : String, options : Array(String), default_idx : Int32 = 0) : SelectField
- #text(name : String, label : String, default : String = "", placeholder : String = "", required : Bool = false) : TextField
- #title : String
- #update_focus : Nil
- #valid? : Bool
- #validate(name : String, &validator : String -> String | Nil) : Nil
- #validate(name : String, validator : ValidatorFn) : Nil
- #validators : Hash(String, Array(ValidatorFn))
- #values : Hash(String, FormValue)
Constructor Detail
Instance Method Detail
def multi_select(name : String, label : String, options : Array(String), selected : Array(String) = [] of String) : MultiSelectField
#
def password(name : String, label : String, min_length : Int32 = 0, default : String = "", placeholder : String = "") : PasswordField
#
def render(buffer : UI::Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
#
Interactively displays and executes the form
def select(name : String, label : String, options : Array(String), default_idx : Int32 = 0) : SelectField
#