Skip to main content

euv_ui/component/tree_select/view/
struct.rs

1use super::*;
2
3/// Props for the [`euv_tree_select`] component.
4///
5/// The tree the panel shows is a list of [`EuvTreeNode`]s — the same node
6/// type the [`euv_tree`] component renders — so one tree can be shared
7/// between a standalone tree and a select. The selected value lives in a
8/// caller-owned `Signal<String>`, so the control takes part in two-way
9/// binding with the rest of the page; the open state of the panel is
10/// owned by the component itself.
11#[derive(Clone, CustomDebug, Default)]
12pub struct EuvTreeSelectProps {
13    /// The tree the panel shows.
14    pub nodes: Vec<EuvTreeNode>,
15    /// The value of the selected node.
16    pub value: Signal<String>,
17    /// The text shown when nothing is selected.
18    pub placeholder: &'static str,
19    /// The group label above the control.
20    pub label: &'static str,
21    /// The callback fired when a node is chosen.
22    #[debug(skip)]
23    pub on_select: Option<Rc<dyn Fn(&'static str)>>,
24}