use crate::{AttrMap, BasecoatProps, Children, Markup};
use std::borrow::Cow;
#[derive(Clone, Debug, Default)]
pub struct DropdownItem {
pub label: Cow<'static, str>,
pub value: Option<Cow<'static, str>>,
pub disabled: bool,
}
impl DropdownItem {
pub fn new(label: impl Into<Cow<'static, str>>) -> Self {
Self {
label: label.into(),
value: None,
disabled: false,
}
}
}
#[derive(BasecoatProps, Default, Clone, Debug)]
pub struct DropdownProps {
#[prop(optional, into)]
pub id: Option<Cow<'static, str>>,
#[prop(optional)]
pub trigger: Option<Markup>,
#[prop(default)]
pub items: Vec<DropdownItem>,
#[prop(optional, into)]
pub menu_label: Option<Cow<'static, str>>,
#[prop(optional, into)]
pub placement: Option<Cow<'static, str>>,
#[prop(optional, into)]
pub class: Option<Cow<'static, str>>,
#[prop(extend)]
pub attrs: AttrMap,
pub children: Children,
}