class Term::Prompt::MultiList

Overview

A class responsible for rendering multi select list menu. Used by {Prompt} to display interactive choice menu.

Defined in:

prompt/multi_list.cr

Constant Summary

HELP = "(Use %s arrow%s keys, press Space to select and Enter to finish%s)"

Constructors

Instance Method Summary

Instance methods inherited from class Term::Prompt::List

arrows_help arrows_help, call(question : Nil | String, possibilities, &block : List -> )
call(question, possibilities)
call
, choice(*args, **kwargs) choice, choices
choices(*values)
choices
, default default, default=(value) default=, default_help default_help, enumerate? enumerate?, help help, help=(help : String | Nil) help=, keybackspace keybackspace, keydelete keydelete, keydown keydown, keyleft keyleft, keynum(key) keynum, keypress(key, event) keypress, keyreturn keyreturn, keyright keyright, keyup keyup, page_size : Int32 page_size, page_size=(page_size : Int32) page_size=, paginated? paginated?, paginator paginator, search_choice_in(searchable) search_choice_in, separator : String | Nil separator, separator=(separator : String | Nil) separator=, symbols : Hash(Symbol, String) symbols, symbols=(symbols : Hash(Symbol, String)) symbols=, sync_paginators sync_paginators

Constructor methods inherited from class Term::Prompt::List

new(prompt : Term::Prompt, **options) new

Constructor Detail

def self.new(prompt, **options) #

Create instance of TTY::Prompt::MultiList menu.


[View source]

Instance Method Detail

def answer #

All values for the choices selected


[View source]
def keyenter #

Callback fired when enter/return key is pressed


[View source]
def keyspace #

Callback fired when space key is pressed


[View source]
def max : Int32 | Nil #

[View source]
def max=(max : Int32 | Nil) #

[View source]
def min : Int32 | Nil #

[View source]
def min=(min : Int32 | Nil) #

[View source]
def minmax_help #

Header part showing the minimum/maximum number of choices

@return [String]

@api private


[View source]
def render_header #

Render initial help text and then currently selected choices


[View source]
def render_menu #

Render menu with choices to select from


[View source]
def selected_names #

Generate selected items names


[View source]
def setup_defaults #

Setup default options and active selection


[View source]