pub struct TextInputField {
pub id: Option<String>,
pub label: String,
pub placeholder: Option<String>,
pub default_value: Option<String>,
pub required: bool,
pub readonly: bool,
pub input_type: Option<String>,
pub validation: Option<FormValidation>,
pub conditional_validation: Option<ConditionalValidation>,
}Expand description
Single-line text input field.
Fields§
§id: Option<String>Optional unique identifier.
label: StringField label displayed to the user.
placeholder: Option<String>Placeholder text when empty.
default_value: Option<String>Default value.
required: boolWhether the field is required.
readonly: boolWhether the field is read-only.
input_type: Option<String>Input type hint (text, email, url, tel, password).
validation: Option<FormValidation>Validation rules.
conditional_validation: Option<ConditionalValidation>Conditional validation based on another field’s value.
Implementations§
Source§impl TextInputField
impl TextInputField
Sourcepub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
pub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
Set the placeholder text.
Sourcepub fn with_default(self, value: impl Into<String>) -> Self
pub fn with_default(self, value: impl Into<String>) -> Self
Set the default value.
Sourcepub fn with_input_type(self, input_type: impl Into<String>) -> Self
pub fn with_input_type(self, input_type: impl Into<String>) -> Self
Set the input type.
Sourcepub fn with_validation(self, validation: FormValidation) -> Self
pub fn with_validation(self, validation: FormValidation) -> Self
Set validation rules.
Sourcepub fn with_conditional_validation(self, cv: ConditionalValidation) -> Self
pub fn with_conditional_validation(self, cv: ConditionalValidation) -> Self
Set conditional validation.
Trait Implementations§
Source§impl Clone for TextInputField
impl Clone for TextInputField
Source§fn clone(&self) -> TextInputField
fn clone(&self) -> TextInputField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextInputField
impl Debug for TextInputField
Source§impl<'de> Deserialize<'de> for TextInputField
impl<'de> Deserialize<'de> for TextInputField
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TextInputField
impl PartialEq for TextInputField
Source§impl Serialize for TextInputField
impl Serialize for TextInputField
impl Eq for TextInputField
impl StructuralPartialEq for TextInputField
Auto Trait Implementations§
impl Freeze for TextInputField
impl RefUnwindSafe for TextInputField
impl Send for TextInputField
impl Sync for TextInputField
impl Unpin for TextInputField
impl UnsafeUnpin for TextInputField
impl UnwindSafe for TextInputField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.