UseDraggableOptions

Struct UseDraggableOptions 

Source
pub struct UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>
where DragEl: IntoElementMaybeSignal<EventTarget, DragM>, HandleEl: IntoElementMaybeSignal<EventTarget, HandleM>,
{ /* private fields */ }
Expand description

Implementations§

Source§

impl<DragEl, DragM, HandleEl, HandleM> UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>
where DragEl: IntoElementMaybeSignal<EventTarget, DragM>, HandleEl: IntoElementMaybeSignal<EventTarget, HandleM>,

Source

pub fn exact(self, value: impl Into<Signal<bool>>) -> Self

Only start the dragging when click on the element directly. Defaults to false.

Source

pub fn prevent_default(self, value: impl Into<Signal<bool>>) -> Self

Prevent events defaults. Defaults to false.

Source

pub fn stop_propagation(self, value: impl Into<Signal<bool>>) -> Self

Prevent events propagation. Defaults to false.

Source

pub fn dragging_element<New__DragEl, New__DragM>( self, value: New__DragEl, ) -> UseDraggableOptions<New__DragEl, New__DragM, HandleEl, HandleM>
where New__DragEl: IntoElementMaybeSignal<EventTarget, New__DragM>, HandleEl: IntoElementMaybeSignal<EventTarget, HandleM>,

Element to attach pointermove and pointerup events to. Defaults to window.

Source

pub fn handle<New__HandleEl, New__HandleM>( self, value: Option<New__HandleEl>, ) -> UseDraggableOptions<DragEl, DragM, New__HandleEl, New__HandleM>
where DragEl: IntoElementMaybeSignal<EventTarget, DragM>, New__HandleEl: IntoElementMaybeSignal<EventTarget, New__HandleM>,

Handle that triggers the drag event. Defaults to target.

Source

pub fn pointer_types(self, value: Vec<PointerType>) -> Self

Pointer types that listen to. Defaults to [Mouse, Touch, Pen].

Source

pub fn initial_value(self, value: impl Into<MaybeRwSignal<Position>>) -> Self

Initial position of the element. Defaults to { x: 0, y: 0 }.

Source

pub fn target_offset( self, value: impl Fn(EventTarget) -> (f64, f64) + 'static, ) -> Self

Computes the initial offset of the target element for drag positioning. Defaults to using its bounding client rectangle’s left and top values.

Source

pub fn on_start( self, value: impl Fn(UseDraggableCallbackArgs) -> bool + Send + Sync + 'static, ) -> Self

Callback when the dragging starts. Return false to prevent dragging.

Source

pub fn on_move( self, value: impl Fn(UseDraggableCallbackArgs) + Send + Sync + 'static, ) -> Self

Callback during dragging.

Source

pub fn on_end( self, value: impl Fn(UseDraggableCallbackArgs) + Send + Sync + 'static, ) -> Self

Callback when dragging end.

Trait Implementations§

Source§

impl<DragM, HandleM> Default for UseDraggableOptions<UseWindow, DragM, Option<EventTarget>, HandleM>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<DragEl, DragM, HandleEl, HandleM> Freeze for UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>
where DragEl: Freeze, HandleEl: Freeze,

§

impl<DragEl, DragM, HandleEl, HandleM> !RefUnwindSafe for UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>

§

impl<DragEl, DragM, HandleEl, HandleM> !Send for UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>

§

impl<DragEl, DragM, HandleEl, HandleM> !Sync for UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>

§

impl<DragEl, DragM, HandleEl, HandleM> Unpin for UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>
where DragEl: Unpin, HandleEl: Unpin, DragM: Unpin, HandleM: Unpin,

§

impl<DragEl, DragM, HandleEl, HandleM> !UnwindSafe for UseDraggableOptions<DragEl, DragM, HandleEl, HandleM>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<El, T, Marker> IntoElementMaybeSignal<T, Marker> for El
where El: IntoElementMaybeSignalType<T, Marker>, Marker: ?Sized,

Source§

impl<T, Js> IntoElementMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<El, T, Marker> IntoElementsMaybeSignal<T, Marker> for El
where El: IntoElementsMaybeSignalType<T, Marker>, Marker: ?Sized,

Source§

impl<T, Js> IntoElementsMaybeSignalType<T, Element> for Js
where T: From<Js> + Clone,

Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,