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
use crate::bool_to_option;
use wasm_bindgen::prelude::*;
use yew::prelude::*;
use yew::virtual_dom::AttrValue;
#[wasm_bindgen(module = "/build/mwc-formfield.js")]
extern "C" {
#[derive(Debug)]
type Formfield;
#[wasm_bindgen(getter, static_method_of = Formfield)]
fn _dummy_loader() -> JsValue;
}
loader_hack!(Formfield);
#[derive(Properties, PartialEq, Clone)]
pub struct FormfieldProps {
pub children: Children,
#[prop_or_default]
pub label: Option<AttrValue>,
#[prop_or_default]
pub align_end: bool,
#[prop_or_default]
pub space_between: bool,
#[prop_or_default]
pub nowrap: bool,
}
component!(
MatFormfield,
FormfieldProps,
|props: &FormfieldProps| {
html! {
<mwc-formfield
label={props.label.clone()}
alignEnd={bool_to_option(props.align_end)}
spaceBetween={bool_to_option(props.space_between)}
nowrap={bool_to_option(props.nowrap)}
>{props.children.clone()}</mwc-formfield>
}
},
Formfield,
"formfield"
);