pub struct NodeMenuProps {
pub items: Signal<Vec<NodeMenuItem>>,
pub search_text: RwSignal<String>,
pub on_event: Callback<NodeMenuEvent>,
pub open_at: RwSignal<Option<Position>>,
pub screen_pos: Signal<Option<Position>>,
pub draft_context: Signal<Option<DraftContext>>,
}Expand description
Props for the NodeMenu component.
A searchable node creation menu.
When opened during a draft connection, compatible ports are shown inline.
§Required Props
- items:
Signal<Vec<NodeMenuItem>>- Reactive list of menu items.
- search_text:
RwSignal<String>- Two-way search text signal.
- on_event:
Callback<NodeMenuEvent>- Callback when item is selected or menu is cancelled.
- open_at:
RwSignal<Option<Position>>- Position to open the menu at (canvas coordinates). None = closed.
- screen_pos:
Signal<Option<Position>>- Screen position for rendering the menu (fixed coordinates).
§Optional Props
- draft_context:
impl Into<Signal<Option<DraftContext>>>- If set, menu was opened during a draft connection.
Fields§
§items: Signal<Vec<NodeMenuItem>>Reactive list of menu items.
search_text: RwSignal<String>Two-way search text signal.
on_event: Callback<NodeMenuEvent>Callback when item is selected or menu is cancelled.
open_at: RwSignal<Option<Position>>Position to open the menu at (canvas coordinates). None = closed.
screen_pos: Signal<Option<Position>>Screen position for rendering the menu (fixed coordinates).
draft_context: Signal<Option<DraftContext>>If set, menu was opened during a draft connection.
Implementations§
Source§impl NodeMenuProps
impl NodeMenuProps
Sourcepub fn builder() -> NodeMenuPropsBuilder<((), (), (), (), (), ())>
pub fn builder() -> NodeMenuPropsBuilder<((), (), (), (), (), ())>
Create a builder for building NodeMenuProps.
On the builder, call .items(...), .search_text(...), .on_event(...), .open_at(...), .screen_pos(...), .draft_context(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of NodeMenuProps.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeMenuProps
impl RefUnwindSafe for NodeMenuProps
impl Send for NodeMenuProps
impl Sync for NodeMenuProps
impl Unpin for NodeMenuProps
impl UnsafeUnpin for NodeMenuProps
impl UnwindSafe for NodeMenuProps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for Elwhere
El: IntoElementMaybeSignalType<T, Marker>,
fn into_element_maybe_signal(self) -> ElementMaybeSignal<T>
Source§impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
fn into_element_maybe_signal_type(self) -> ElementMaybeSignalType<T>
Source§impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for Elwhere
El: IntoElementsMaybeSignalType<T, Marker>,
fn into_elements_maybe_signal(self) -> ElementsMaybeSignal<T>
Source§impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
fn into_elements_maybe_signal_type(self) -> ElementsMaybeSignalType<T>
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.