Editor
Sub classes¶
| Name | Children | Inherits |
|---|---|---|
| TextEditor promptantic.textual.editors Typed input: text, numbers, or free JSON. |
||
| BooleanEditor promptantic.textual.editors A switch; a three-way select when ``null`` is allowed too. |
||
| ChoiceEditor promptantic.textual.editors A select of the allowed values; just the value when there's only one (``const``). |
||
| MultiChoiceEditor promptantic.textual.editors Pick several of a fixed set (a unique list of choices). |
||
| NullEditor promptantic.textual.editors Nothing to enter: the value is ``null``. |
||
| ListEditor promptantic.textual.editors Items of one kind (add / remove), or the fixed positions of a tuple. |
||
| MapEditor promptantic.textual.editors Free keys with values of one kind (``dict[str, X]``). |
||
| ObjectEditor promptantic.textual.editors Named fields; nested objects fold (the outermost one doesn't). |
||
| UnionEditor promptantic.textual.editors Pick the kind first, then fill that kind's editor. |
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| Widget textual.widget A Widget is the base class for Textual widgets. |
⋔ Inheritance diagram¶
graph TD
2997256436["editors.Editor"]
4188532303["widget.Widget"]
3946681048["dom.DOMNode"]
53685856["message_pump.MessagePump"]
2751680898["builtins.object"]
4188532303 --> 2997256436
3946681048 --> 4188532303
53685856 --> 3946681048
2751680898 --> 53685856
🛈 DocStrings¶
Bases: Widget
Base of all editors: a node, its path in the value, and an error line.
Source code in src/promptantic/textual/editors.py
check
¶
Show what's wrong with this field alone (on every change).
Source code in src/promptantic/textual/editors.py
get_value
¶
The value entered so far (:data:UNSET: nothing).
Raises:
| Type | Description |
|---|---|
FieldError
|
Input that can't become a value (e.g. text in a number field). |