Combobox
将可编辑文本、筛选、可选标签项和原生建议界面结合在一起。
#导入
从 quickgui 导入 Combobox。
use quickgui::*;#用法
let mut state = ComboboxState::new(items);
state.set_query("pro");
div().child(text_input(state.query()))#结构
Combobox::rootCombobox::inputCombobox::option_partCombobox::labelCombobox::valueCombobox::iconCombobox::input_groupCombobox::clearCombobox::triggerCombobox::chipsCombobox::chipCombobox::chip_removeCombobox::backdropCombobox::portalCombobox::positionerCombobox::popupCombobox::arrowCombobox::statusCombobox::emptyCombobox::listCombobox::rowCombobox::itemCombobox::item_indicatorCombobox::groupCombobox::group_labelCombobox::collectionCombobox::separator
#API 参考
展开条目查看说明和完整签名。短横线表示声明中未记录默认值。
ComboboxState
查看源码pub fn new(items: impl IntoIterator<Item = PickerItem<T>>) -> Result<Self, PickerError>with_layoutpub fn with_layout(mut self, layout: ComboboxPopoverLayout) -> Self—
Configures with layout for this part.
pub fn with_layout(mut self, layout: ComboboxPopoverLayout) -> Self查看源码with_filter_modepub fn with_filter_mode(mut self, mode: PickerFilterMode) -> Self—
Configures with filter mode for this part.
pub fn with_filter_mode(mut self, mode: PickerFilterMode) -> Self查看源码with_selected_sourcepub fn with_selected_source(mut self, source_index: usize) -> Self—
Set an initial selection before a runtime context exists.
pub fn with_selected_source(mut self, source_index: usize) -> Self查看源码with_selected_idpub fn with_selected_id(mut self, id: impl Into<ElementId>) -> Self—
Set an initial stable-ID selection before a runtime context exists.
pub fn with_selected_id(mut self, id: impl Into<ElementId>) -> Self查看源码layoutpub const fn layout(&self) -> ComboboxPopoverLayout—
set_layoutpub fn set_layout(&mut self, layout: ComboboxPopoverLayout, cx: &mut EventContext) -> bool—
Replace popover geometry and synchronously dismiss an obsolete fixed-size child.
pub fn set_layout(&mut self, layout: ComboboxPopoverLayout, cx: &mut EventContext) -> bool查看源码itemspub fn items(&self) -> &[PickerItem<T>]—
set_itemspub fn set_items( &mut self, items: impl IntoIterator<Item = PickerItem<T>>, cx: &mut EventContext, ) -> Result<(), PickerError>—
Atomically replace the bounded suggestion source. A committed item with a stable ID is rebound across filtering or reordering. If it is temporarily absent, its cloned committed value and label remain authoritative while its current source index becomes `None`.
pub fn set_items( &mut self, items: impl IntoIterator<Item = PickerItem<T>>, cx: &mut EventContext, ) -> Result<(), PickerError>查看源码filter_modepub const fn filter_mode(&self) -> PickerFilterMode—
set_filter_modepub fn set_filter_mode(&mut self, mode: PickerFilterMode, cx: &mut EventContext) -> bool—
Configures set filter mode for this part.
pub fn set_filter_mode(&mut self, mode: PickerFilterMode, cx: &mut EventContext) -> bool查看源码querypub fn query(&self) -> &Arc<str>—
input_valuepub fn input_value(&self) -> &Arc<str>—
The visible input value: an edit query while open, otherwise the committed label.
pub fn input_value(&self) -> &Arc<str>查看源码selected_source_indexpub fn selected_source_index(&self) -> Option<usize>—
Configures selected source index for this part.
pub fn selected_source_index(&self) -> Option<usize>查看源码selected_itempub fn selected_item(&self) -> Option<&PickerItem<T>>—
selected_valuepub fn selected_value(&self) -> Option<&T>—
selected_labelpub fn selected_label(&self) -> Option<&Arc<str>>—
set_selected_sourcepub fn set_selected_source(&mut self, source_index: usize, cx: &mut EventContext) -> bool—
Replace the committed selection and close any open suggestion child.
pub fn set_selected_source(&mut self, source_index: usize, cx: &mut EventContext) -> bool查看源码set_selected_idpub fn set_selected_id(&mut self, id: impl Into<ElementId>, cx: &mut EventContext) -> bool—
Configures set selected id for this part.
pub fn set_selected_id(&mut self, id: impl Into<ElementId>, cx: &mut EventContext) -> bool查看源码clear_selectionpub fn clear_selection(&mut self, cx: &mut EventContext) -> bool—
Configures clear selection for this part.
pub fn clear_selection(&mut self, cx: &mut EventContext) -> bool查看源码multiplepub fn multiple(mut self, multiple: bool) -> Self—
Accept more than one committed value, Base UI's `multiple`. A multiple combobox keeps its committed values as bounded chips instead of writing one label back into the input, so the input stays an editing query after every commit.
pub fn multiple(mut self, multiple: bool) -> Self查看源码set_multiplepub fn set_multiple(&mut self, multiple: bool) -> bool—
Replace the multiple flag in place, reporting whether anything changed.
pub fn set_multiple(&mut self, multiple: bool) -> bool查看源码is_multiplepub const fn is_multiple(&self) -> bool—
auto_highlightpub const fn auto_highlight(mut self, auto_highlight: bool) -> Self—
Highlight the first result as soon as one exists, Base UI's `autoHighlight`.
pub const fn auto_highlight(mut self, auto_highlight: bool) -> Self查看源码auto_highlightspub const fn auto_highlights(&self) -> bool—
open_on_input_clickpub const fn open_on_input_click(mut self, open_on_input_click: bool) -> Self—
Open the suggestion surface when the input itself is clicked, Base UI's `openOnInputClick`.
pub const fn open_on_input_click(mut self, open_on_input_click: bool) -> Self查看源码opens_on_input_clickpub const fn opens_on_input_click(&self) -> bool—
highlight_item_on_hoverpub const fn highlight_item_on_hover(mut self, highlight: bool) -> Self—
Move the highlight with the pointer, Base UI's `highlightItemOnHover`.
pub const fn highlight_item_on_hover(mut self, highlight: bool) -> Self查看源码highlights_item_on_hoverpub const fn highlights_item_on_hover(&self) -> bool—
Configures highlights item on hover for this part.
pub const fn highlights_item_on_hover(&self) -> bool查看源码loop_focuspub const fn loop_focus(mut self, loop_focus: bool) -> Self—
Wrap the highlight at the ends of the result set, Base UI's `loop`.
pub const fn loop_focus(mut self, loop_focus: bool) -> Self查看源码loops_focuspub const fn loops_focus(&self) -> bool—
read_onlypub const fn read_only(mut self, read_only: bool) -> Self—
Refuse value changes while staying focusable, Base UI's `readOnly`.
pub const fn read_only(mut self, read_only: bool) -> Self查看源码is_read_onlypub const fn is_read_only(&self) -> bool—
requiredpub const fn required(mut self, required: bool) -> Self—
Require a value before submission, Base UI's `required`.
pub const fn required(mut self, required: bool) -> Self查看源码is_requiredpub const fn is_required(&self) -> bool—
set_filterpub fn set_filter(&mut self, filter: Option<PickerFilter>, cx: &mut EventContext) -> bool—
Replace the built-in filter policy with an application-supplied predicate, Base UI's `filter`. Passing `None` restores [`Self::filter_mode`], whose combobox default is [`PickerFilterMode::Contains`].
pub fn set_filter(&mut self, filter: Option<PickerFilter>, cx: &mut EventContext) -> bool查看源码with_filterpub fn with_filter(mut self, filter: PickerFilter) -> Self—
Declare an application-supplied filter predicate at construction time.
pub fn with_filter(mut self, filter: PickerFilter) -> Self查看源码filterpub fn filter(&self) -> Option<&PickerFilter>—
The custom filter predicate, when one is installed.
pub fn filter(&self) -> Option<&PickerFilter>查看源码chip_labelspub fn chip_labels(&self) -> impl Iterator<Item = &Arc<str>>—
Every committed chip label, in commit order, Base UI's `Combobox.Chips` contents.
pub fn chip_labels(&self) -> impl Iterator<Item = &Arc<str>>查看源码chip_valuespub fn chip_values(&self) -> impl Iterator<Item = &T>—
Every committed chip value, in commit order.
pub fn chip_values(&self) -> impl Iterator<Item = &T>查看源码chip_countpub fn chip_count(&self) -> usize—
add_chip_sourcepub fn add_chip_source(&mut self, source_index: usize) -> bool—
Commit one more source row as a chip, up to [`MAX_COMBOBOX_VALUES`]. Returns `false` for a disabled row, an already-committed row, a read-only combobox, or a chip set that is already full.
pub fn add_chip_source(&mut self, source_index: usize) -> bool查看源码remove_chippub fn remove_chip(&mut self, chip_index: usize) -> bool—
Remove one chip, Base UI's `Combobox.ChipRemove`.
pub fn remove_chip(&mut self, chip_index: usize) -> bool查看源码clear_chipspub fn clear_chips(&mut self) -> bool—
set_pressedpub const fn set_pressed(&mut self, pressed: bool) -> bool—
Record that the trigger is held down, Base UI's `data-pressed`.
pub const fn set_pressed(&mut self, pressed: bool) -> bool查看源码set_focusedpub const fn set_focused(&mut self, focused: bool) -> bool—
Record input focus, and mark the control touched when focus leaves it.
pub const fn set_focused(&mut self, focused: bool) -> bool查看源码reset_touchedpub const fn reset_touched(&mut self) -> bool—
Forget that the control was interacted with, for a form that has just been reset. This is the counterpart of [`Self::reset_dirty`]: a value applied from a declaration is not an interaction, so a host that seeds the control reports Base UI's `data-touched` only for what the user really did.
pub const fn reset_touched(&mut self) -> bool查看源码reset_dirtypub const fn reset_dirty(&mut self) -> bool—
Forget that the value changed, for a form that has just been submitted or reset.
pub const fn reset_dirty(&mut self) -> bool查看源码is_dirtypub const fn is_dirty(&self) -> bool—
is_touchedpub const fn is_touched(&self) -> bool—
is_focusedpub const fn is_focused(&self) -> bool—
statepub fn state(&self) -> ComboboxPartState—
A copyable render-state snapshot the application styles from.
pub fn state(&self) -> ComboboxPartState查看源码status_textpub fn status_text(&self) -> Arc<str>—
The live-region text a mounted `Status` part announces, Base UI's `Combobox.Status`. The wording is intentionally minimal and English-free of punctuation so an application can replace it; QuickGUI owns only the counting and the exactly-once announcement.
pub fn status_text(&self) -> Arc<str>查看源码is_empty_resultpub fn is_empty_result(&self) -> bool—
Whether the `Empty` part should be mounted, Base UI's `Combobox.Empty`.
pub fn is_empty_result(&self) -> bool查看源码popover_windowpub const fn popover_window(&self) -> Option<WindowHandle>—
Configures popover window for this part.
pub const fn popover_window(&self) -> Option<WindowHandle>查看源码is_openpub const fn is_open(&self) -> bool—
is_disabledpub const fn is_disabled(&self) -> bool—
set_disabledpub fn set_disabled(&mut self, disabled: bool, cx: &mut EventContext) -> bool—
Configures set disabled for this part.
pub fn set_disabled(&mut self, disabled: bool, cx: &mut EventContext) -> bool查看源码is_invalidpub const fn is_invalid(&self) -> bool—
set_invalidpub fn set_invalid(&mut self, invalid: bool) -> bool—
validation_messagepub fn validation_message(&self) -> Option<&Arc<str>>—
Configures validation message for this part.
pub fn validation_message(&self) -> Option<&Arc<str>>查看源码set_validation_messagepub fn set_validation_message(&mut self, message: impl Into<Arc<str>>) -> bool—
Configures set validation message for this part.
pub fn set_validation_message(&mut self, message: impl Into<Arc<str>>) -> bool查看源码clear_validation_messagepub fn clear_validation_message(&mut self) -> bool—
Configures clear validation message for this part.
pub fn clear_validation_message(&mut self) -> bool查看源码result_countpub fn result_count(&self) -> usize—
total_match_countpub fn total_match_count(&self) -> usize—
active_result_indexpub fn active_result_index(&self) -> Option<usize>—
active_source_indexpub fn active_source_index(&self) -> Option<usize>—
closepub fn close(&mut self, cx: &mut EventContext) -> bool—
surface_idpub fn surface_id(id: impl Into<ElementId>) -> ElementId—
label_idpub fn label_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the mounted label part.
pub fn label_id(id: impl Into<ElementId>) -> ElementId查看源码value_idpub fn value_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the mounted value part.
pub fn value_id(id: impl Into<ElementId>) -> ElementId查看源码icon_idpub fn icon_id(id: impl Into<ElementId>) -> ElementId—
input_group_idpub fn input_group_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the input group wrapping the input and its affordances.
pub fn input_group_id(id: impl Into<ElementId>) -> ElementId查看源码clear_idpub fn clear_id(id: impl Into<ElementId>) -> ElementId—
trigger_idpub fn trigger_id(id: impl Into<ElementId>) -> ElementId—
chips_idpub fn chips_id(id: impl Into<ElementId>) -> ElementId—
chip_idpub fn chip_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId—
Stable identity of one chip.
pub fn chip_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId查看源码chip_remove_idpub fn chip_remove_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId—
Stable identity of one chip's remove control.
pub fn chip_remove_id(id: impl Into<ElementId>, chip_index: usize) -> ElementId查看源码backdrop_idpub fn backdrop_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the optional owner-window backdrop.
pub fn backdrop_id(id: impl Into<ElementId>) -> ElementId查看源码arrow_idpub fn arrow_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the decorative popup arrow.
pub fn arrow_id(id: impl Into<ElementId>) -> ElementId查看源码status_idpub fn status_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the result-count live region.
pub fn status_id(id: impl Into<ElementId>) -> ElementId查看源码empty_idpub fn empty_id(id: impl Into<ElementId>) -> ElementId—
list_idpub fn list_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the scrolling result list inside the popup.
pub fn list_id(id: impl Into<ElementId>) -> ElementId查看源码collection_idpub fn collection_id(id: impl Into<ElementId>) -> ElementId—
Stable identity of the collection wrapper inside the list.
pub fn collection_id(id: impl Into<ElementId>) -> ElementId查看源码option_id_for_sourcepub fn option_id_for_source( &self, id: impl Into<ElementId>, source_index: usize, ) -> Option<ElementId>—
Configures option id for source for this part.
pub fn option_id_for_source( &self, id: impl Into<ElementId>, source_index: usize, ) -> Option<ElementId>查看源码ComboboxState::root_with
查看源码pub fn root_with(root: Element) -> ElementDecorate the optional application-owned structural wrapper, Base UI's `Combobox.Root`.
ComboboxState::root
查看源码pub fn root() -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
ComboboxState::label_with
查看源码pub fn label_with(id: impl Into<ElementId>, label: Element) -> ElementDecorate the caller-owned visible label, Base UI's `Combobox.Label`.
ComboboxState::label
查看源码pub fn label(id: impl Into<ElementId>) -> ElementCreate the unstyled label part. Use [`Self::label_with`] to supply an existing element.
ComboboxState::value_with
查看源码pub fn value_with(id: impl Into<ElementId>, value: Element) -> ElementDecorate the caller-owned committed-value text, Base UI's `Combobox.Value`. The input already exposes the value, so this part is decoration.
ComboboxState::value
查看源码pub fn value(id: impl Into<ElementId>) -> ElementCreate the unstyled value part. Use [`Self::value_with`] to supply an existing element.
ComboboxState::icon_with
查看源码pub fn icon_with(id: impl Into<ElementId>, icon: Element) -> ElementDecorate the caller-owned affordance glyph, Base UI's `Combobox.Icon`.
ComboboxState::icon
查看源码pub fn icon(id: impl Into<ElementId>) -> ElementCreate the unstyled icon part. Use [`Self::icon_with`] to supply an existing element.
ComboboxState::input_group_with
查看源码pub fn input_group_with(id: impl Into<ElementId>, group: Element) -> ElementDecorate the wrapper holding the input, chips, and affordances, Base UI's `Combobox.InputGroup`.
ComboboxState::input_group
查看源码pub fn input_group(id: impl Into<ElementId>) -> ElementCreate the unstyled input group part. Use [`Self::input_group_with`] to supply an existing element.
ComboboxState::input_with
查看源码pub fn input_with(&self, id: impl Into<ElementId>, input: Element) -> ElementDecorate the caller-owned editable input, Base UI's `Combobox.Input`. The full interaction — filtering, navigation, the suggestion surface, and committing — is attached by [`Self::element`]; this part adds the form-state projection Base UI publishes alongside it, so a composition that already owns the interaction still reports the same required, read-only, and label relationships.
ComboboxState::input
查看源码pub fn input(&self, id: impl Into<ElementId>) -> ElementCreate the unstyled input part. Use [`Self::input_with`] to supply an existing element.
ComboboxState::chips_with
查看源码pub fn chips_with(id: impl Into<ElementId>, chips: Element) -> ElementDecorate the caller-owned chip container, Base UI's `Combobox.Chips`.
ComboboxState::chips
查看源码pub fn chips(id: impl Into<ElementId>) -> ElementCreate the unstyled chips part. Use [`Self::chips_with`] to supply an existing element.
ComboboxState::chip_with
查看源码pub fn chip_with( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, chip: Element, ) -> ElementDecorate one caller-owned chip, Base UI's `Combobox.Chip`.
ComboboxState::chip
查看源码pub fn chip( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, ) -> ElementCreate the unstyled chip part. Use [`Self::chip_with`] to supply an existing element.
ComboboxState::chip_remove_with
查看源码pub fn chip_remove_with( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, remove: Element, ) -> ElementDecorate one chip's remove control, Base UI's `Combobox.ChipRemove`. The control is a real button with an accessible name, so a keyboard user can reach and remove a chip without the pointer.
ComboboxState::chip_remove
查看源码pub fn chip_remove( id: impl Into<ElementId>, chip_index: usize, label: impl Into<Arc<str>>, ) -> ElementCreate the unstyled chip remove part. Use [`Self::chip_remove_with`] to supply an existing element.
ComboboxState::clear_with
查看源码pub fn clear_with( id: impl Into<ElementId>, label: impl Into<Arc<str>>, clear: Element, ) -> ElementDecorate the caller-owned clear control, Base UI's `Combobox.Clear`. Mount it only while the control holds a value; Base UI hides it otherwise.
ComboboxState::clear
查看源码pub fn clear(id: impl Into<ElementId>, label: impl Into<Arc<str>>) -> ElementCreate the unstyled clear part. Use [`Self::clear_with`] to supply an existing element.
ComboboxState::trigger_with
查看源码pub fn trigger_with( &self, id: impl Into<ElementId>, label: impl Into<Arc<str>>, trigger: Element, ) -> ElementDecorate the caller-owned surface trigger, Base UI's `Combobox.Trigger`.
ComboboxState::trigger
查看源码pub fn trigger(&self, id: impl Into<ElementId>, label: impl Into<Arc<str>>) -> ElementCreate the unstyled trigger part. Use [`Self::trigger_with`] to supply an existing element.
ComboboxState::backdrop_with
查看源码pub fn backdrop_with(id: impl Into<ElementId>, backdrop: Element) -> ElementDecorate an optional caller-painted owner-window backdrop, Base UI's `Combobox.Backdrop`.
ComboboxState::backdrop
查看源码pub fn backdrop(id: impl Into<ElementId>) -> ElementCreate the unstyled backdrop part. Use [`Self::backdrop_with`] to supply an existing element.
ComboboxState::portal_with
查看源码pub fn portal_with(&self, id: impl Into<ElementId>, portal: Element) -> ElementDecorate the suggestion-surface boundary, Base UI's `Combobox.Portal`. The suggestion surface is its own native window, so the portal, the positioner, and the popup are one element and all three names decorate it identically.
ComboboxState::portal
查看源码pub fn portal(&self, id: impl Into<ElementId>) -> ElementCreate the unstyled portal part. Use [`Self::portal_with`] to supply an existing element.
ComboboxState::positioner_with
查看源码pub fn positioner_with(&self, id: impl Into<ElementId>, positioner: Element) -> ElementDecorate the suggestion-surface boundary, Base UI's `Combobox.Positioner`.
ComboboxState::positioner
查看源码pub fn positioner(&self, id: impl Into<ElementId>) -> ElementCreate the unstyled positioner part. Use [`Self::positioner_with`] to supply an existing element.
ComboboxState::popup_with
查看源码pub fn popup_with(&self, id: impl Into<ElementId>, popup: Element) -> ElementDecorate the caller-owned suggestion surface, Base UI's `Combobox.Popup`.
ComboboxState::popup
查看源码pub fn popup(&self, id: impl Into<ElementId>) -> ElementCreate the unstyled popup part. Use [`Self::popup_with`] to supply an existing element.
ComboboxState::arrow_with
查看源码pub fn arrow_with(id: impl Into<ElementId>, arrow: Element) -> ElementPosition a caller-owned decorative arrow, Base UI's `Combobox.Arrow`.
ComboboxState::arrow
查看源码pub fn arrow(id: impl Into<ElementId>) -> ElementCreate the unstyled arrow part. Use [`Self::arrow_with`] to supply an existing element.
ComboboxState::status_with
查看源码pub fn status_with(id: impl Into<ElementId>, status: Element) -> ElementDecorate the caller-owned live region, Base UI's `Combobox.Status`. Render [`Self::status_text`] inside it. The region is polite and is rebuilt only when the application rebuilds the tree, so an unchanged count announces exactly once.
ComboboxState::status
查看源码pub fn status(id: impl Into<ElementId>) -> ElementCreate the unstyled status part. Use [`Self::status_with`] to supply an existing element.
ComboboxState::empty_with
查看源码pub fn empty_with(id: impl Into<ElementId>, empty: Element) -> ElementDecorate the caller-owned no-results part, Base UI's `Combobox.Empty`. Mount it only while [`Self::is_empty_result`] is true. The `Status` region already announces the count, so this part is visual.
ComboboxState::empty
查看源码pub fn empty(id: impl Into<ElementId>) -> ElementCreate the unstyled empty part. Use [`Self::empty_with`] to supply an existing element.
ComboboxState::list_with
查看源码pub fn list_with(&self, id: impl Into<ElementId>, list: Element) -> ElementDecorate the caller-owned scrolling result list, Base UI's `Combobox.List`.
ComboboxState::list
查看源码pub fn list(&self, id: impl Into<ElementId>) -> ElementCreate the unstyled list part. Use [`Self::list_with`] to supply an existing element.
ComboboxState::collection_with
查看源码pub fn collection_with(id: impl Into<ElementId>, collection: Element) -> ElementDecorate a caller-owned wrapper around the mounted rows, Base UI's `Combobox.Collection`.
ComboboxState::collection
查看源码pub fn collection(id: impl Into<ElementId>) -> ElementCreate the unstyled collection part. Use [`Self::collection_with`] to supply an existing element.
ComboboxState::row_with
查看源码pub fn row_with(row: Element) -> ElementDecorate a caller-owned row wrapper for a grid-shaped result, Base UI's `Combobox.Row`.
ComboboxState::row
查看源码pub fn row() -> ElementCreate the unstyled row part. Use [`Self::row_with`] to supply an existing element.
ComboboxState::item_with
查看源码pub fn item_with( &self, id: impl Into<ElementId>, source_index: usize, state: ComboboxItemPartState, item: Element, ) -> Option<Element>Decorate one caller-owned result row, Base UI's `Combobox.Item`.
ComboboxState::item
查看源码pub fn item( &self, id: impl Into<ElementId>, source_index: usize, state: ComboboxItemPartState, ) -> Option<Element>Create the unstyled item part. Use [`Self::item_with`] to supply an existing element.
ComboboxState::item_indicator_with
查看源码pub fn item_indicator_with(indicator: Element) -> ElementDecorate one row's selected mark, Base UI's `Combobox.ItemIndicator`.
ComboboxState::item_indicator
查看源码pub fn item_indicator() -> ElementCreate the unstyled item indicator part. Use [`Self::item_indicator_with`] to supply an existing element.
ComboboxState::group_with
查看源码pub fn group_with(group: Element) -> ElementDecorate a caller-composed result group, Base UI's `Combobox.Group`.
ComboboxState::group
查看源码pub fn group() -> ElementCreate the unstyled group part. Use [`Self::group_with`] to supply an existing element.
ComboboxState::group_label_with
查看源码pub fn group_label_with(label_id: impl Into<ElementId>, label: Element) -> ElementDecorate a group's visible label, Base UI's `Combobox.GroupLabel`.
ComboboxState::group_label
查看源码pub fn group_label(label_id: impl Into<ElementId>) -> ElementCreate the unstyled group label part. Use [`Self::group_label_with`] to supply an existing element.
ComboboxState::separator_with
查看源码pub fn separator_with(separator: Element) -> ElementDecorate a caller-owned divider between groups, Base UI's `Combobox.Separator`.
ComboboxState::separator
查看源码pub fn separator() -> ElementCreate the unstyled separator part. Use [`Self::separator_with`] to supply an existing element.
ComboboxState::element
查看源码pub fn element<V, PopoverRoot, RenderOption, QueryChanged, Change>( &mut self, cx: &mut ViewContext<'_, V>, id: impl Into<ElementId>, label: impl Into<Arc<str>>, access: fn(&mut V) -> &mut ComboboxState<T>, input: Element, popover_root: PopoverRoot, render_option: RenderOption, query_changed: QueryChanged, change: Change, ) -> Element where V: 'static, T: 'static, PopoverRoot: Fn(ComboboxListState) -> Element + Clone + 'static, RenderOption: Fn(&PickerItem<T>, ComboboxOptionState) -> Element + Clone + 'static, QueryChanged: Fn(&mut V, Arc<str>, &mut EventContext) + Clone + 'static, Change: Fn(&mut V, T, &mut EventContext) + Clone + 'static,Build the complete unstyled constrained interaction from caller-owned parts.
ComboboxState::element_with
查看源码pub fn element_with<V, PopoverRoot, RenderOption, QueryChanged, Change>( &mut self, cx: &mut ViewContext<'_, V>, id: impl Into<ElementId>, label: impl Into<Arc<str>>, access: StateAccessor<V, ComboboxState<T>>, input: Element, popover_root: PopoverRoot, render_option: RenderOption, query_changed: QueryChanged, change: Change, ) -> Element where V: 'static, T: 'static, PopoverRoot: Fn(ComboboxListState) -> Element + Clone + 'static, RenderOption: Fn(&PickerItem<T>, ComboboxOptionState) -> Element + Clone + 'static, QueryChanged: Fn(&mut V, Arc<str>, &mut EventContext) + Clone + 'static, Change: Fn(&mut V, T, &mut EventContext) + Clone + 'static,Build the constrained combobox against a per-instance retained-state accessor. A host that renders many declared comboboxes through one view passes an accessor that captures which [`ComboboxState`] each registered listener resolves.
