pub struct Picker<M = ()>(/* private fields */);Expand description
picker: a searchable picker sheet (its child is the preview).
Implementations§
Source§impl<M> Picker<M>
impl<M> Picker<M>
Sourcepub fn key(self, key: impl Into<NodeKey>) -> Self
pub fn key(self, key: impl Into<NodeKey>) -> Self
Identity among siblings: keeps the node’s id (and Tern’s view state) across reorders. A string, or an integer.
Sourcepub fn role(self, role: impl Into<String>) -> Self
pub fn role(self, role: impl Into<String>) -> Self
A name of yours, exposed to CSS as data-role.
Keeps the node mounted but not laid out.
Sourcepub fn mark(self, mark: impl Into<Mark>) -> Self
pub fn mark(self, mark: impl Into<Mark>) -> Self
A transient selection mark drawn over the node.
Sourcepub fn aria(self, aria: impl Into<String>) -> Self
pub fn aria(self, aria: impl Into<String>) -> Self
The accessible name of a node that shows no text.
Sourcepub fn href(self, href: impl Into<String>) -> Self
pub fn href(self, href: impl Into<String>) -> Self
A link: ⌘-click opens it; copy and open use it.
Sourcepub fn basis(self, basis: impl Into<Basis>) -> Self
pub fn basis(self, basis: impl Into<Basis>) -> Self
Flex basis: a fraction of the parent, or the content’s size.
Sourcepub fn prop(self, name: &str, value: impl Serialize) -> Self
pub fn prop(self, name: &str, value: impl Serialize) -> Self
Sets any prop untyped; null removes it.
Sourcepub fn on_action(self, act: impl Into<String>, msg: M) -> Self
pub fn on_action(self, act: impl Into<String>, msg: M) -> Self
Sends msg on action events whose action is act (name or
name=value).
Sourcepub fn on_action_with(
self,
act: impl Into<String>,
f: impl Fn(&Action) -> M + Send + Sync + 'static,
) -> Self
pub fn on_action_with( self, act: impl Into<String>, f: impl Fn(&Action) -> M + Send + Sync + 'static, ) -> Self
Maps action events whose action is act to a message.
Sourcepub fn on_toggle(self, f: impl Fn(bool) -> M + Send + Sync + 'static) -> Self
pub fn on_toggle(self, f: impl Fn(bool) -> M + Send + Sync + 'static) -> Self
Maps toggle events (the new collapsed) to a message.
Sourcepub fn on_select(self, f: impl Fn(&str) -> M + Send + Sync + 'static) -> Self
pub fn on_select(self, f: impl Fn(&str) -> M + Send + Sync + 'static) -> Self
Maps select events (the item) to a message. On a list’s item the
item’s own handler runs first.
Sourcepub fn on_activate(self, f: impl Fn(&str) -> M + Send + Sync + 'static) -> Self
pub fn on_activate(self, f: impl Fn(&str) -> M + Send + Sync + 'static) -> Self
Maps activate events (the item) to a message.
Sourcepub fn on_change(self, f: impl Fn(&Change) -> M + Send + Sync + 'static) -> Self
pub fn on_change(self, f: impl Fn(&Change) -> M + Send + Sync + 'static) -> Self
Maps change events to a message.
Sourcepub fn on_edit(self, f: impl Fn(&Edit) -> M + Send + Sync + 'static) -> Self
pub fn on_edit(self, f: impl Fn(&Edit) -> M + Send + Sync + 'static) -> Self
Maps edit events (native editing) to a message.
Sourcepub fn on_send(self, f: impl Fn(&str) -> M + Send + Sync + 'static) -> Self
pub fn on_send(self, f: impl Fn(&str) -> M + Send + Sync + 'static) -> Self
Maps send events (the text to submit) to a message.
Sourcepub fn children<C: Into<Node<M>>>(
self,
children: impl IntoIterator<Item = C>,
) -> Self
pub fn children<C: Into<Node<M>>>( self, children: impl IntoIterator<Item = C>, ) -> Self
Adds children.
Sourcepub fn size(self, value: impl Into<PickerSize>) -> Self
pub fn size(self, value: impl Into<PickerSize>) -> Self
The sheet’s size.
Sourcepub fn layout(self, value: impl Into<PickerLayout>) -> Self
pub fn layout(self, value: impl Into<PickerLayout>) -> Self
The row template.
Sourcepub fn preview(self, value: impl Into<PickerPreview>) -> Self
pub fn preview(self, value: impl Into<PickerPreview>) -> Self
Where the preview sits.
Sourcepub fn placeholder(self, value: impl Into<String>) -> Self
pub fn placeholder(self, value: impl Into<String>) -> Self
The search placeholder.
Sourcepub fn focus(self, value: impl Into<PickerFocus>) -> Self
pub fn focus(self, value: impl Into<PickerFocus>) -> Self
Which part the keys drive.
Sourcepub fn state(self, value: impl Into<PickerState>) -> Self
pub fn state(self, value: impl Into<PickerState>) -> Self
Ready, loading or error.
Sourcepub fn items(self, value: impl Into<Vec<PickerItem>>) -> Self
pub fn items(self, value: impl Into<Vec<PickerItem>>) -> Self
The catalog.
Sourcepub fn items_add(self, value: impl Into<Vec<PickerItem>>) -> Self
pub fn items_add(self, value: impl Into<Vec<PickerItem>>) -> Self
Items added to the catalog.
Sourcepub fn items_del(self, value: impl Into<Vec<String>>) -> Self
pub fn items_del(self, value: impl Into<Vec<String>>) -> Self
Item ids removed from the catalog.
Sourcepub fn order(self, value: impl Into<Vec<OrderEntry>>) -> Self
pub fn order(self, value: impl Into<Vec<OrderEntry>>) -> Self
What to show, in order.
Sourcepub fn hits(self, value: impl Into<BTreeMap<String, Vec<[usize; 2]>>>) -> Self
pub fn hits(self, value: impl Into<BTreeMap<String, Vec<[usize; 2]>>>) -> Self
Match ranges per item id.
Sourcepub fn columns(self, value: impl Into<Vec<PickerColumn>>) -> Self
pub fn columns(self, value: impl Into<Vec<PickerColumn>>) -> Self
Fact columns.
Sourcepub fn actions(self, value: impl Into<Vec<PickerAction>>) -> Self
pub fn actions(self, value: impl Into<Vec<PickerAction>>) -> Self
The action bar.