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
use *;
/// Builds the submit handler of the form.
///
/// The handler cancels the browser's native submission — a form without an
/// action would otherwise navigate the page with a `GET` query — and then
/// notifies the caller.
///
/// # Arguments
///
/// - `Option<Rc<dyn Fn()>>` - The callback invoked on submit.
///
/// # Returns
///
/// - `Option<Rc<dyn Fn(Event)>>` - The submit handler of the form.
/// A form shell that wraps the caller's fields.
///
/// The component renders a `<form>` carrying the `c_euv_form` class and
/// wraps the children the caller passed in, so a page can drop
/// `euv_field`, `euv_input` or `euv_select` components straight into it and
/// get a consistent vertical rhythm without writing any markup.
///
/// When `submit_label` is not empty the form ends with a `c_euv_form_actions`
/// row holding a submit button built from `euv_button`, so the primary
/// action of the form looks like every other primary action in the app. The
/// submit handler cancels the browser's native submission, which keeps the
/// page from navigating with a `GET` query.
///
/// # Arguments
///
/// - `VirtualNode<EuvFormProps>` - The props node carrying the submit label
/// and the submit callback.
///
/// # Returns
///
/// - `VirtualNode` - The form element wrapping the caller's fields.