yew_bootstrap/util/
arrange.rs

1use std::fmt;
2
3/// # Arrange horizontal utility
4/// Bootstrap horizontal arranges to position elements.
5#[derive(Clone, PartialEq, Eq)]
6pub enum ArrangeX {
7    Start0,
8    Start50,
9    Start100,
10    End0,
11    End50,
12    End100,
13}
14
15impl fmt::Display for ArrangeX {
16    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17        match &self {
18            ArrangeX::Start0 => write!(f, "start-0"),
19            ArrangeX::Start50 => write!(f, "start-50"),
20            ArrangeX::Start100 => write!(f, "start-100"),
21            ArrangeX::End0 => write!(f, "end-0"),
22            ArrangeX::End50 => write!(f, "end-50"),
23            ArrangeX::End100 => write!(f, "end-100"),
24        }
25    }
26}
27
28/// # Arrange vertical utility
29/// Bootstrap vertical arranges to position elements.
30#[derive(Clone, PartialEq, Eq)]
31pub enum ArrangeY {
32    Top0,
33    Top50,
34    Top100,
35    Bottom0,
36    Bottom50,
37    Bottom100,
38}
39
40impl fmt::Display for ArrangeY {
41    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42        match &self {
43            ArrangeY::Top0 => write!(f, "top-0"),
44            ArrangeY::Top50 => write!(f, "top-50"),
45            ArrangeY::Top100 => write!(f, "top-100"),
46            ArrangeY::Bottom0 => write!(f, "bottom-0"),
47            ArrangeY::Bottom50 => write!(f, "bottom-50"),
48            ArrangeY::Bottom100 => write!(f, "bottom-100"),
49        }
50    }
51}