pub struct DropdownField {
pub id: Option<String>,
pub label: String,
pub options: Vec<DropdownOption>,
pub default_value: Option<String>,
pub placeholder: Option<String>,
pub required: bool,
pub readonly: bool,
pub multiple: bool,
pub conditional_validation: Option<ConditionalValidation>,
}Expand description
Dropdown selection field.
Fields§
§id: Option<String>Optional unique identifier.
label: StringField label displayed to the user.
options: Vec<DropdownOption>Available options.
default_value: Option<String>Default selected value.
placeholder: Option<String>Placeholder text when no selection.
required: boolWhether a selection is required.
readonly: boolWhether the field is read-only.
multiple: boolAllow multiple selections.
conditional_validation: Option<ConditionalValidation>Conditional validation based on another field’s value.
Implementations§
Source§impl DropdownField
impl DropdownField
Sourcepub fn new(label: impl Into<String>, options: Vec<DropdownOption>) -> Self
pub fn new(label: impl Into<String>, options: Vec<DropdownOption>) -> Self
Create a new dropdown field.
Sourcepub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
pub fn with_placeholder(self, placeholder: impl Into<String>) -> Self
Set the placeholder.
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_conditional_validation(self, cv: ConditionalValidation) -> Self
pub fn with_conditional_validation(self, cv: ConditionalValidation) -> Self
Set conditional validation.
Trait Implementations§
Source§impl Clone for DropdownField
impl Clone for DropdownField
Source§fn clone(&self) -> DropdownField
fn clone(&self) -> DropdownField
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 DropdownField
impl Debug for DropdownField
Source§impl<'de> Deserialize<'de> for DropdownField
impl<'de> Deserialize<'de> for DropdownField
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 DropdownField
impl PartialEq for DropdownField
Source§impl Serialize for DropdownField
impl Serialize for DropdownField
impl Eq for DropdownField
impl StructuralPartialEq for DropdownField
Auto Trait Implementations§
impl Freeze for DropdownField
impl RefUnwindSafe for DropdownField
impl Send for DropdownField
impl Sync for DropdownField
impl Unpin for DropdownField
impl UnsafeUnpin for DropdownField
impl UnwindSafe for DropdownField
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.