diff options
Diffstat (limited to 'src/viewmodel/mod.rs')
-rw-r--r-- | src/viewmodel/mod.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/viewmodel/mod.rs b/src/viewmodel/mod.rs index d5d0de3..edd1a8e 100644 --- a/src/viewmodel/mod.rs +++ b/src/viewmodel/mod.rs @@ -2,10 +2,11 @@ use yew::prelude::*; use crate::view::VCardPropertyInputComponent; pub mod vcard; +pub mod utility; pub mod address; pub mod name; pub mod telephone; -pub mod utility; +pub mod dates; /// Trait for types that represent the data of a vcard property used inside of a `VCardPropertyInputComponent`. @@ -48,6 +49,7 @@ pub enum VCardPropertyInputField { placeholder: Option<String>, oninput: Callback<InputData>, value: String, + typ: String }, CheckBox { label: String, @@ -67,7 +69,8 @@ impl VCardPropertyInputField { placeholder, oninput, value: _, - } => Self::text_field_input(label, id, placeholder, oninput), + typ, + } => Self::text_field_input(label, id, placeholder, oninput, typ), Self::CheckBox { label, id, @@ -77,7 +80,7 @@ impl VCardPropertyInputField { } } /// Returns an `Html` representation of a text input field with the given parameters. - fn text_field_input(label: &str, id: &Option<String>, placeholder: &Option<String>, oninput: &Callback<InputData>) -> Html { + fn text_field_input(label: &str, id: &Option<String>, placeholder: &Option<String>, oninput: &Callback<InputData>, typ: &str) -> Html { html!{ <div class="field column is-one-fifth-widescreen @@ -87,7 +90,7 @@ impl VCardPropertyInputField { <label class="label">{ label }</label> <div class="control"> <input id=id.as_ref().unwrap_or(&"".to_string()) - type="text" + type=typ placeholder=placeholder.as_ref().unwrap_or(&"".to_string()) oninput=oninput /> |