1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/// The `Corner` type
///
/// [MWC Documentation](https://github.com/material-components/material-components-web-components/tree/v0.27.0/packages/menu#propertiesattributes)
#[derive(Clone, PartialEq)]
pub enum Corner {
    TopLeft,
    TopRight,
    BottomLeft,
    BottomRight,
    TopStart,
    TopEnd,
    BottomStart,
    BottomEnd,
}

impl ToString for Corner {
    fn to_string(&self) -> String {
        use Corner::*;
        match self {
            TopLeft => "TOP_LEFT",
            TopRight => "TOP_RIGHT",
            BottomLeft => "BOTTOM_LEFT",
            BottomRight => "BOTTOM_RIGHT",
            TopStart => "TOP_START",
            TopEnd => "TOP_END ",
            BottomStart => "BOTTOM_START",
            BottomEnd => "BOTTOM_END",
        }
        .to_string()
    }
}

/// The `MenuCorner` type
///
/// [MWC Documentation](https://github.com/material-components/material-components-web-components/tree/v0.27.0/packages/menu#propertiesattributes)
#[derive(Clone, PartialEq)]
pub enum MenuCorner {
    Start,
    End,
}

impl ToString for MenuCorner {
    fn to_string(&self) -> String {
        use MenuCorner::*;
        match self {
            Start => "START",
            End => "END",
        }
        .to_string()
    }
}

/// The `DefaultFocusState` type
///
/// [MWC Documentation](https://github.com/material-components/material-components-web-components/tree/v0.27.0/packages/menu#propertiesattributes)
#[derive(Clone, PartialEq)]
pub enum DefaultFocusState {
    None,
    ListRoot,
    FirstItem,
    LastItem,
}

impl ToString for DefaultFocusState {
    fn to_string(&self) -> String {
        use DefaultFocusState::*;
        match self {
            None => "NONE",
            ListRoot => "LIST_ROOT",
            FirstItem => "FIRST_ITEM",
            LastItem => "LAST_ITEM",
        }
        .to_string()
    }
}