rumtk_web/components/Form/mod.rs
1/*
2 * rumtk attempts to implement HL7 and medical protocols for interoperability in medicine.
3 * This toolkit aims to be reliable, simple, performant, and standards compliant.
4 * Copyright (C) 2025 Luis M. Santos, M.D.
5 * Copyright (C) 2025 MedicalMasses L.L.C.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21pub mod form;
22pub mod form_element;
23pub mod form_utils;
24pub mod props;
25
26///
27/// This is an API macro for defining a form that can be used to render it later in your web pages.
28///
29#[macro_export]
30macro_rules! rumtk_web_add_form {
31 ( $name:expr, $build_fxn:expr ) => {{
32 use $crate::components::Form::form_utils::register_form_elements;
33
34 register_form_elements($name, $build_fxn)
35 }};
36}
37
38///
39/// This is an API macro to get the list of rendered elements that will be fed into the form shell
40/// to render your form in your web page.
41///
42#[macro_export]
43macro_rules! rumtk_web_get_form {
44 ( $name:expr ) => {{
45 use $crate::components::Form::form_utils::get_form;
46
47 get_form($name)
48 }};
49}