pub type_comp: String,
#[serde(rename = "@value_comp")]
pub value_comp: String,
+ #[serde(rename = "@plus_minus")]
+ pub plus_minus: String,
+ #[serde(rename = "@thousands_separator")]
+ pub thousands_separator: String,
#[serde(rename = "$text")]
pub text: String,
}
writeln!(output, "fi.add_validator(Box::new(v));");
},
+ "zak_form_element_validator_is_number" => {
+ writeln!(output, r#"let mut v = zakform::validators::ValidatorNumber::new("{}_number_{}");"#, e.id, i);
+
+ if validator.plus_minus == "TRUE" {
+ writeln!(output, "v.set_plus_minus(true);");
+ }
+ if validator.thousands_separator != "" {
+ writeln!(output, "v.set_thousands_separator(Some('{}'));", validator.thousands_separator.as_str().chars().nth(0).unwrap());
+ } else {
+ writeln!(output, "v.set_thousands_separator(None);");
+ }
+
+ writeln!(output, "fi.add_validator(Box::new(v));");
+ },
_ => { },
};
}