Enum patternfly_yew::Orientation
source · pub enum Orientation {
Left,
Right,
Top,
Bottom,
}Variants§
Implementations§
source§impl Orientation
impl Orientation
sourcepub fn as_classes(&self) -> Vec<&'static str> ⓘ
pub fn as_classes(&self) -> Vec<&'static str> ⓘ
Examples found in repository?
src/popover/mod.rs (line 186)
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
fn view(&self, ctx: &Context<Self>) -> Html {
let mut classes = Classes::from("pf-c-popover");
classes.extend(ctx.props().orientation.as_classes());
let style = if ctx.props().hidden {
"display: none;".to_string()
} else {
ctx.props().styles.to_string()
};
let onclose = ctx.link().callback(|_| PopoverPopupMsg::Close);
return html! {
<div
ref={&ctx.props().r#ref}
style={style}
class={classes}
role="dialog"
aria-model="true"
>
<div class="pf-c-popover__arrow"></div>
<div class="pf-c-popover__content">
<Button
variant={Variant::Plain}
icon={Icon::Times}
aria_label="Close"
onclick={onclose}
/>
if let Some(header) = &ctx.props().header {
<h1 class="pf-c-title pf-m-md">
{ header.clone() }
</h1>
}
<div class="pf-c-popover__body">
{ for ctx.props().children.iter() }
</div>
if let Some(footer) = &ctx.props().footer {
<footer class="pf-c-popover__footer">
{ footer.clone() }
</footer>
}
</div>
</div>
};
}Trait Implementations§
source§impl Clone for Orientation
impl Clone for Orientation
source§fn clone(&self) -> Orientation
fn clone(&self) -> Orientation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Orientation
impl Debug for Orientation
source§impl PartialEq<Orientation> for Orientation
impl PartialEq<Orientation> for Orientation
source§fn eq(&self, other: &Orientation) -> bool
fn eq(&self, other: &Orientation) -> bool
impl Copy for Orientation
impl Eq for Orientation
impl StructuralEq for Orientation
impl StructuralPartialEq for Orientation
Auto Trait Implementations§
impl RefUnwindSafe for Orientation
impl Send for Orientation
impl Sync for Orientation
impl Unpin for Orientation
impl UnwindSafe for Orientation
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.