zuicon_mdl2/
test_parameter.rs1use yew::prelude::{html, Component, Context, Html, Properties};
8
9pub struct TestParameter {}
10
11#[derive(Properties, Debug, Clone, PartialEq, Eq)]
12pub struct Props {
13 #[prop_or_default]
14 pub class: Option<&'static str>,
15
16 #[prop_or_default]
17 pub width: Option<&'static str>,
18
19 #[prop_or_default]
20 pub height: Option<&'static str>,
21
22 #[prop_or_default]
23 pub color: Option<&'static str>,
24
25 #[prop_or_default]
26 pub fill: Option<&'static str>,
27
28 #[prop_or_default]
29 pub spin: bool,
30
31 #[prop_or_default]
32 pub rotate: i16,
33}
34
35impl Component for TestParameter {
36 type Properties = Props;
37 type Message = ();
38
39 fn create(_ctx: &Context<Self>) -> Self {
40 Self {}
41 }
42
43 fn view(&self, ctx: &Context<Self>) -> Html {
44 let props = ctx.props();
45 let mut style = String::new();
47 if props.rotate != 0 {
48 style += &format!("transform: rotate({}deg);", props.rotate);
49 }
50 html! {
51 <svg
52 xmlns={ "http://www.w3.org/2000/svg" }
53 class={ props.class.unwrap_or("") }
54 width={ props.width.unwrap_or("16") }
55 height={ props.height.unwrap_or("16") }
56 focusable={ "false" }
57 data-icon={ "TestParameter" }
58 viewBox={ "0 0 16 16" }
59 fill={ props.fill.unwrap_or("currentColor") }
60 style={ style }
61 >
62 <path d="M125 716q0 106 33 191t94 144 147 92 191 32q74 0 147-12t140-45v108q-72 30-150 40t-155 11q-126 0-231-39t-181-111T42 952 0 721q0-129 44-238t122-187 187-123 238-45q115 0 217 34t178 100 121 160 45 216q0 33-4 65t-12 65h-112v186q-74 63-169 63-76 0-119-35t-46-115q-24 72-72 111t-125 39q-55 0-94-22t-65-58-38-83-12-96q0-65 17-130t52-117 89-86 128-33q21 0 43 6t41 18 33 29 22 39l11-81h116l-23 259q-2 29-6 58t-4 59q0 18 2 42t9 45 21 37 40 15q46 0 75-30t47-74 23-91 7-83q0-99-33-176t-92-129-139-79-177-27q-104 0-189 38T252 372t-94 154-33 190zm403 202q34 0 59-14t44-38 31-54 19-62 10-63 3-58q0-29-5-54t-19-43-34-29-54-11q-49 0-81 26t-53 66-28 86-9 85q0 28 6 57t19 52 36 39 56 15zm1435 945q14 28 14 57 0 26-10 49t-27 41-41 28-50 10h-754q-26 0-49-10t-41-27-28-41-10-50q0-29 14-57l299-598v-241h-128V896h640v128h-128v241l299 598zm-242-199l-185-369v-271h-128v271l-185 369h498z" />
63 </svg>
64 }
65 }
66}