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
|
use syn::{Expr, Ident, LitStr, Type};
mod generate;
mod parse;
pub use generate::form_impl;
pub struct ParsedOnSubmit {
inputs: Vec<Ident>,
block: Expr,
pub(crate) should_use_move: bool,
}
pub enum ParsedChild {
Input {
name: Ident,
rust_type: Type,
html_type: LitStr,
label: LitStr,
reactive: Option<Ident>,
auto_complete: Option<Ident>,
},
Checkbox {
name: Ident,
label: LitStr,
},
Select {
name: Ident,
label: LitStr,
rust_type: Type,
options: Expr, // Vec<(String, Uuid)>
},
Show {
when: Expr,
children: Vec<ParsedChild>,
},
Textarea {
name: Ident,
label: LitStr,
},
}
pub struct ParsedInput {
on_submit: ParsedOnSubmit,
children: Vec<ParsedChild>,
}
|