pub struct ScrimProps<TcontentSignal: Signal<Item = Option<Dom>> = Always<Option<Dom>>, ThideSignal: Signal<Item = bool> = Always<bool>, TOnClick: Fn(Click) = fn(_: Click), TApplyFn: FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement> = fn(_: DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement>> {
    pub content: TcontentSignal,
    pub hide: ThideSignal,
    pub on_click: TOnClick,
    pub apply: Option<TApplyFn>,
}
Expand description

Overlays a semi-opaque toggleable scrim over a component

Fields§

§content: TcontentSignal§hide: ThideSignal§on_click: TOnClick§apply: Option<TApplyFn>

Implementations§

source§

impl ScrimProps

source

pub fn new() -> Self

source§

impl<TcontentSignal: Signal<Item = Option<Dom>>, ThideSignal: Signal<Item = bool>, TOnClick: Fn(Click), TApplyFn: FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement>> ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>

source

pub fn content( self, v: Option<Dom> ) -> ScrimProps<Always<Option<Dom>>, ThideSignal, TOnClick, TApplyFn>

The Dom that will be overlaid by the scrim when it is visible

source

pub fn content_signal<TcontentSignalNew: Signal<Item = Option<Dom>>>( self, v: TcontentSignalNew ) -> ScrimProps<TcontentSignalNew, ThideSignal, TOnClick, TApplyFn>

The Dom that will be overlaid by the scrim when it is visible

source§

impl<TcontentSignal: Signal<Item = Option<Dom>>, ThideSignal: Signal<Item = bool>, TOnClick: Fn(Click), TApplyFn: FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement>> ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>

source

pub fn hide( self, v: bool ) -> ScrimProps<TcontentSignal, Always<bool>, TOnClick, TApplyFn>

bool signal which toggles the visibility of the shaded overlay

source

pub fn hide_signal<ThideSignalNew: Signal<Item = bool>>( self, v: ThideSignalNew ) -> ScrimProps<TcontentSignal, ThideSignalNew, TOnClick, TApplyFn>

bool signal which toggles the visibility of the shaded overlay

source§

impl<TcontentSignal: Signal<Item = Option<Dom>>, ThideSignal: Signal<Item = bool>, TOnClick: Fn(Click), TApplyFn: FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement>> ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>

source

pub fn on_click<TOnClickNew: Fn(Click)>( self, v: TOnClickNew ) -> ScrimProps<TcontentSignal, ThideSignal, TOnClickNew, TApplyFn>

source§

impl<TcontentSignal: Signal<Item = Option<Dom>>, ThideSignal: Signal<Item = bool>, TOnClick: Fn(Click), TApplyFn: FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement>> ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>

source

pub fn apply<TApplyFnNew: FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement>>( self, v: TApplyFnNew ) -> ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFnNew>

Trait Implementations§

source§

impl<TcontentSignal: Signal<Item = Option<Dom>>, ThideSignal: Signal<Item = bool>, TOnClick: Fn(Click), TApplyFn: FnOnce(DomBuilder<HtmlElement>) -> DomBuilder<HtmlElement>> ScrimPropsTrait for ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>

§

type TcontentSignal = TcontentSignal

§

type ThideSignal = ThideSignal

§

type TOnClick = TOnClick

§

type TApplyFn = TApplyFn

source§

fn take(self) -> ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>

Auto Trait Implementations§

§

impl<TcontentSignal, ThideSignal, TOnClick, TApplyFn> RefUnwindSafe for ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>where TApplyFn: RefUnwindSafe, TOnClick: RefUnwindSafe, TcontentSignal: RefUnwindSafe, ThideSignal: RefUnwindSafe,

§

impl<TcontentSignal, ThideSignal, TOnClick, TApplyFn> Send for ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>where TApplyFn: Send, TOnClick: Send, TcontentSignal: Send, ThideSignal: Send,

§

impl<TcontentSignal, ThideSignal, TOnClick, TApplyFn> Sync for ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>where TApplyFn: Sync, TOnClick: Sync, TcontentSignal: Sync, ThideSignal: Sync,

§

impl<TcontentSignal, ThideSignal, TOnClick, TApplyFn> Unpin for ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>where TApplyFn: Unpin, TOnClick: Unpin, TcontentSignal: Unpin, ThideSignal: Unpin,

§

impl<TcontentSignal, ThideSignal, TOnClick, TApplyFn> UnwindSafe for ScrimProps<TcontentSignal, ThideSignal, TOnClick, TApplyFn>where TApplyFn: UnwindSafe, TOnClick: UnwindSafe, TcontentSignal: UnwindSafe, ThideSignal: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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<T, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.