yr.tree_selector
tree_selector(
tree: TreeSelectorSource,
label: str | None = None,
min_selections: int = 1,
max_selections: int | None = None,
) → list[str]Present a nested tree and return the selected leaf values.
Parameters
tree
type: TreeSelectorSource
Nested option mapping or an object implementing
__yera_tree__().
label
type: str | None = None
Optional prompt shown above the tree.
min_selections
type: int = 1
Minimum number of leaves that must be selected.
max_selections
type: int | None = None
Optional maximum number of leaves that may be selected.
Raises
TypeError
If the source cannot provide a valid tree mapping.
ValueError
If the supplied tree is malformed.
InputValueError
If the submitted selection violates its cardinality, contains duplicates, or includes a value outside the requested tree.
Returns
type: list[str]
The canonical values of the selected leaves, in submitted order.