Struct leptos_use::UseDraggableOptions
source · pub struct UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,{ /* private fields */ }
Expand description
Options for use_draggable_with_options
.
Implementations§
source§impl<DragEl, DragT, HandleEl, HandleT> UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
impl<DragEl, DragT, HandleEl, HandleT> UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
sourcepub fn exact(self, value: impl Into<MaybeSignal<bool>>) -> Self
pub fn exact(self, value: impl Into<MaybeSignal<bool>>) -> Self
Only start the dragging when click on the element directly. Defaults to false
.
sourcepub fn prevent_default(self, value: impl Into<MaybeSignal<bool>>) -> Self
pub fn prevent_default(self, value: impl Into<MaybeSignal<bool>>) -> Self
Prevent events defaults. Defaults to false
.
sourcepub fn stop_propagation(self, value: impl Into<MaybeSignal<bool>>) -> Self
pub fn stop_propagation(self, value: impl Into<MaybeSignal<bool>>) -> Self
Prevent events propagation. Defaults to false
.
sourcepub fn dragging_element<New__DragEl, New__DragT>(
self,
value: New__DragEl,
) -> UseDraggableOptions<New__DragEl, New__DragT, HandleEl, HandleT>where
New__DragEl: Into<ElementMaybeSignal<New__DragT, EventTarget>>,
New__DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
pub fn dragging_element<New__DragEl, New__DragT>(
self,
value: New__DragEl,
) -> UseDraggableOptions<New__DragEl, New__DragT, HandleEl, HandleT>where
New__DragEl: Into<ElementMaybeSignal<New__DragT, EventTarget>>,
New__DragT: Into<EventTarget> + Clone + 'static,
HandleEl: Into<ElementMaybeSignal<HandleT, EventTarget>>,
HandleT: Into<EventTarget> + Clone + 'static,
Element to attach pointermove
and pointerup
events to. Defaults to window
.
sourcepub fn handle<New__HandleEl, New__HandleT>(
self,
value: Option<New__HandleEl>,
) -> UseDraggableOptions<DragEl, DragT, New__HandleEl, New__HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
New__HandleEl: Into<ElementMaybeSignal<New__HandleT, EventTarget>>,
New__HandleT: Into<EventTarget> + Clone + 'static,
pub fn handle<New__HandleEl, New__HandleT>(
self,
value: Option<New__HandleEl>,
) -> UseDraggableOptions<DragEl, DragT, New__HandleEl, New__HandleT>where
DragEl: Into<ElementMaybeSignal<DragT, EventTarget>>,
DragT: Into<EventTarget> + Clone + 'static,
New__HandleEl: Into<ElementMaybeSignal<New__HandleT, EventTarget>>,
New__HandleT: Into<EventTarget> + Clone + 'static,
Handle that triggers the drag event. Defaults to target
.
sourcepub fn pointer_types(self, value: Vec<PointerType>) -> Self
pub fn pointer_types(self, value: Vec<PointerType>) -> Self
Pointer types that listen to. Defaults to [Mouse, Touch, Pen]
.
sourcepub fn initial_value(self, value: impl Into<MaybeRwSignal<Position>>) -> Self
pub fn initial_value(self, value: impl Into<MaybeRwSignal<Position>>) -> Self
Initial position of the element. Defaults to { x: 0, y: 0 }
.
sourcepub fn on_start(
self,
value: impl Fn(UseDraggableCallbackArgs) -> bool + 'static,
) -> Self
pub fn on_start( self, value: impl Fn(UseDraggableCallbackArgs) -> bool + 'static, ) -> Self
Callback when the dragging starts. Return false
to prevent dragging.
sourcepub fn on_move(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
pub fn on_move(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
Callback during dragging.
sourcepub fn on_end(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
pub fn on_end(self, value: impl Fn(UseDraggableCallbackArgs) + 'static) -> Self
Callback when dragging end.
Trait Implementations§
source§impl Default for UseDraggableOptions<UseWindow, Window, EventTarget, EventTarget>
impl Default for UseDraggableOptions<UseWindow, Window, EventTarget, EventTarget>
Auto Trait Implementations§
impl<DragEl, DragT, HandleEl, HandleT> Freeze for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !RefUnwindSafe for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !Send for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !Sync for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> Unpin for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
impl<DragEl, DragT, HandleEl, HandleT> !UnwindSafe for UseDraggableOptions<DragEl, DragT, HandleEl, HandleT>
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more