use dioxus::prelude::*; use dioxus_primitives::select::{ self, SelectGroupLabelProps, SelectGroupProps, SelectListProps, SelectOptionProps, SelectProps, SelectTriggerProps, SelectValueProps, }; #[component] pub fn Select(props: SelectProps) -> Element { rsx! { document::Link { rel: "stylesheet", href: asset!("./style.css") } select::Select { class: "select", value: props.value, default_value: props.default_value, on_value_change: props.on_value_change, disabled: props.disabled, name: props.name, placeholder: props.placeholder, roving_loop: props.roving_loop, typeahead_timeout: props.typeahead_timeout, attributes: props.attributes, {props.children} } } } #[component] pub fn SelectTrigger(props: SelectTriggerProps) -> Element { rsx! { select::SelectTrigger { class: "select-trigger", attributes: props.attributes, {props.children} svg { class: "select-expand-icon", view_box: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", polyline { points: "6 9 12 15 18 9" } } } } } #[component] pub fn SelectValue(props: SelectValueProps) -> Element { rsx! { select::SelectValue { attributes: props.attributes } } } #[component] pub fn SelectList(props: SelectListProps) -> Element { rsx! { select::SelectList { class: "select-list", id: props.id, attributes: props.attributes, {props.children} } } } #[component] pub fn SelectGroup(props: SelectGroupProps) -> Element { rsx! { select::SelectGroup { class: "select-group", disabled: props.disabled, id: props.id, attributes: props.attributes, {props.children} } } } #[component] pub fn SelectGroupLabel(props: SelectGroupLabelProps) -> Element { rsx! { select::SelectGroupLabel { class: "select-group-label", id: props.id, attributes: props.attributes, {props.children} } } } #[component] pub fn SelectOption(props: SelectOptionProps) -> Element { rsx! { select::SelectOption:: { class: "select-option", value: props.value, text_value: props.text_value, disabled: props.disabled, id: props.id, index: props.index, aria_label: props.aria_label, aria_roledescription: props.aria_roledescription, attributes: props.attributes, {props.children} } } } #[component] pub fn SelectItemIndicator() -> Element { rsx! { select::SelectItemIndicator { svg { class: "select-check-icon", view_box: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", path { d: "M5 13l4 4L19 7" } } } } }