use crate::{AttrMap, BasecoatProps, Children};
use std::borrow::Cow;
#[derive(Clone, Debug, Default)]
pub struct ComboboxOption {
pub value: Cow<'static, str>,
pub label: Cow<'static, str>,
}
impl ComboboxOption {
pub fn new(
value: impl Into<Cow<'static, str>>,
label: impl Into<Cow<'static, str>>,
) -> Self {
Self {
value: value.into(),
label: label.into(),
}
}
}
#[derive(BasecoatProps, Default, Clone, Debug)]
pub struct ComboboxProps {
#[prop(optional, into)]
pub id: Option<Cow<'static, str>>,
#[prop(optional, into)]
pub name: Option<Cow<'static, str>>,
#[prop(optional, into)]
pub placeholder: Option<Cow<'static, str>>,
#[prop(optional, into)]
pub value: Option<Cow<'static, str>>,
#[prop(default)]
pub options: Vec<ComboboxOption>,
#[prop(default)]
pub disabled: bool,
#[prop(optional, into)]
pub class: Option<Cow<'static, str>>,
#[prop(extend)]
pub attrs: AttrMap,
pub children: Children,
}