windjammer_ui/components/generated/
center.rs

1#![allow(clippy::all)]
2#![allow(noop_method_call)]
3pub struct Center {
4    child: String,
5    width: String,
6    height: String,
7    class: String,
8}
9
10impl Center {
11    #[inline]
12    pub fn new(child: String) -> Center {
13        Center {
14            child,
15            width: "100%".to_string(),
16            height: "100%".to_string(),
17            class: String::new(),
18        }
19    }
20    #[inline]
21    pub fn width(mut self, width: String) -> Center {
22        self.width = width;
23        self
24    }
25    #[inline]
26    pub fn height(mut self, height: String) -> Center {
27        self.height = height;
28        self
29    }
30    #[inline]
31    pub fn class(mut self, class: String) -> Center {
32        self.class = class;
33        self
34    }
35    pub fn render(&self) -> String {
36        let mut html = String::new();
37        html.push_str("<div class=\"wj-center ");
38        html.push_str(self.class.as_str());
39        html.push_str(
40            "\" style=\"display: flex; align-items: center; justify-content: center; width: ",
41        );
42        html.push_str(self.width.as_str());
43        html.push_str("; height: ");
44        html.push_str(self.height.as_str());
45        html.push_str(";\">");
46        html.push_str(self.child.as_str());
47        html.push_str("</div>");
48        html
49    }
50}