@@ -31,13 +31,37 @@ def create_default_input_selection_style() -> BaseStyle:
31
31
32
32
33
33
class InputSelection (Generic [_T ]):
34
+ """
35
+ Input selection prompt. Ask the user to choose among a set of options.
36
+
37
+ Example usage::
38
+
39
+ input_selection = InputSelection(
40
+ message="Please select a dish:",
41
+ options=[
42
+ ("pizza", "Pizza with mushrooms"),
43
+ ("salad", "Salad with tomatoes"),
44
+ ("sushi", "Sushi"),
45
+ ],
46
+ default="pizza",
47
+ )
48
+ result = input_selection.prompt()
49
+
50
+ :param message: Plain text or formatted text to be shown before the options.
51
+ :param options: Sequence of `(value, label)` tuples.
52
+ :param default: Default value. If none is given, the first option is
53
+ considered the default.
54
+ :param mouse_support: Enable mouse support.
55
+ :param style: :class:`.Style` instance for the color scheme.
56
+ """
57
+
34
58
def __init__ (
35
59
self ,
36
60
* ,
37
61
message : AnyFormattedText ,
38
62
options : Sequence [tuple [_T , AnyFormattedText ]],
39
63
default : _T | None = None ,
40
- mouse_support : bool = True ,
64
+ mouse_support : bool = False ,
41
65
style : BaseStyle | None = None ,
42
66
symbol : str = ">" ,
43
67
show_frame : FilterOrBool = False ,
@@ -156,14 +180,37 @@ def select_input(
156
180
message : AnyFormattedText ,
157
181
options : Sequence [tuple [_T , AnyFormattedText ]],
158
182
default : _T | None = None ,
159
- mouse_support : bool = True ,
183
+ mouse_support : bool = False ,
160
184
style : BaseStyle | None = None ,
161
185
symbol : str = ">" ,
162
186
show_frame : bool = False ,
163
187
enable_suspend : FilterOrBool = False ,
164
188
enable_abort : FilterOrBool = True ,
165
189
interrupt_exception : type [BaseException ] = KeyboardInterrupt ,
166
190
) -> _T :
191
+ """
192
+ Input selection prompt. Ask the user to choose among a set of options.
193
+
194
+ Example usage::
195
+
196
+ result= select_input(
197
+ message="Please select a dish:",
198
+ options=[
199
+ ("pizza", "Pizza with mushrooms"),
200
+ ("salad", "Salad with tomatoes"),
201
+ ("sushi", "Sushi"),
202
+ ],
203
+ default="pizza",
204
+ )
205
+
206
+ :param message: Plain text or formatted text to be shown before the options.
207
+ :param options: Sequence of `(value, label)` tuples.
208
+ :param default: Default value. If none is given, the first option is
209
+ considered the default.
210
+ :param mouse_support: Enable mouse support.
211
+ :param style: :class:`.Style` instance for the color scheme.
212
+ """
213
+
167
214
return InputSelection [_T ](
168
215
message = message ,
169
216
options = options ,
0 commit comments