use super::*;
#[cfg(any(target_arch = "wasm32", test))]
#[derive(Clone, Copy, CustomDebug, Data)]
pub(crate) struct DropdownGeometryPolicy {
#[get(pub(crate), type(copy))]
pub(crate) align_start: bool,
#[get(pub(crate), type(copy))]
pub(crate) anchor_trigger: bool,
#[get(pub(crate), type(copy))]
pub(crate) content_width: bool,
#[get(pub(crate), type(copy))]
pub(crate) gap: f64,
}
#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
pub struct EuvDropdownItem {
#[get(type(copy))]
pub label: &'static str,
#[get(type(copy))]
pub value: &'static str,
#[get(type(copy))]
pub active: bool,
#[get(type(copy))]
pub disabled: bool,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownProps {
pub open: Signal<bool>,
pub items: Vec<EuvDropdownItem>,
#[debug(skip)]
pub on_select: Option<Rc<dyn Fn(&'static str)>>,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownMenuProps {
pub open: Signal<bool>,
pub parent_open: Option<Signal<bool>>,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownMenuContentProps {
pub open: Signal<bool>,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownTriggerProps {
pub open: Signal<bool>,
}
#[derive(Clone, Copy, CustomDebug, Default)]
pub struct EuvDropdownMenuGroupProps {
pub label: &'static str,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownMenuCheckboxItemProps {
pub label: &'static str,
pub checked: Signal<bool>,
pub disabled: bool,
pub open: Signal<bool>,
pub close_on_click: bool,
#[debug(skip)]
pub on_checked_change: Option<Rc<dyn Fn(bool)>>,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownMenuRadioGroupProps {
pub label: &'static str,
pub selection: EuvDropdownMenuRadioGroupState,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownMenuRadioGroupState {
pub value: Signal<String>,
pub controlled: bool,
#[debug(skip)]
pub on_value_change: Option<Rc<dyn Fn(String)>>,
}
#[derive(Clone, CustomDebug, Default)]
pub struct EuvDropdownMenuRadioItemProps {
pub label: &'static str,
pub value: &'static str,
pub selection: EuvDropdownMenuRadioGroupState,
pub disabled: bool,
pub open: Signal<bool>,
pub close_on_click: bool,
}
#[derive(Clone, Copy, CustomDebug, Default)]
pub struct EuvDropdownMenuSubProps {
pub label: &'static str,
pub open: Signal<bool>,
pub parent_open: Signal<bool>,
}
#[derive(Clone, Copy, CustomDebug)]
pub struct EuvDropdownMenuSubTriggerProps {
pub label: &'static str,
pub open: Signal<bool>,
pub disabled: bool,
pub open_on_hover: bool,
pub delay_ms: u32,
pub close_delay_ms: u32,
}
#[derive(Clone, Copy, CustomDebug, Default)]
pub struct EuvDropdownMenuSubContentProps {
pub open: Signal<bool>,
}
#[derive(Clone, CustomDebug, Data, New)]
pub struct EuvDropdownMenuItemProps {
#[get(type(copy))]
pub label: &'static str,
#[get(type(copy))]
pub shortcut: &'static str,
#[get(type(copy))]
pub value: &'static str,
#[get(type(copy))]
pub disabled: bool,
#[debug(skip)]
pub on_select: Option<Rc<dyn Fn(&'static str)>>,
pub open: Signal<bool>,
#[get(type(copy))]
pub close_on_click: bool,
}
#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
pub struct EuvDropdownMenuLabelProps {
#[get(type(copy))]
pub text: &'static str,
}
#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
pub struct EuvDropdownMenuSeparatorProps {
#[get(type(copy))]
pub label: &'static str,
}
#[derive(Clone, Copy, CustomDebug, Data, Default, New)]
pub struct EuvDropdownMenuShortcutProps {
#[get(type(copy))]
pub text: &'static str,
}
#[cfg(target_arch = "wasm32")]
#[derive(Data)]
pub(super) struct DropdownSubHover {
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) open: Signal<bool>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) parent: Rc<Cell<Signal<bool>>>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) target: NodeRef<Element>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) options: Cell<(bool, bool, u32, u32)>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) mounted: Cell<bool>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) timer: Cell<Option<i32>>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) intent: Cell<Option<bool>>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) anchor: Cell<Option<(f64, f64)>>,
#[get(pub(super))]
#[set(pub(super))]
#[get_mut(pub(super))]
pub(super) callback: RefCell<Option<Closure<dyn FnMut()>>>,
}