pub struct DatePickerProps {Show 15 fields
pub value: Option<DateValue>,
pub default_value: Option<DateValue>,
pub placeholder: Option<String>,
pub format: Option<String>,
pub disabled: Option<bool>,
pub allow_clear: Option<bool>,
pub class: Option<String>,
pub style: Option<String>,
pub on_change: Option<EventHandler<Option<DateValue>>>,
pub show_time: Option<ShowTimeConfig>,
pub ranges: Option<HashMap<String, (DateValue, DateValue)>>,
pub disabled_date: Option<Rc<dyn Fn(DateValue) -> bool>>,
pub disabled_time: Option<Rc<dyn Fn(DateValue) -> bool>>,
pub render_extra_footer: Option<Rc<dyn Fn() -> Element>>,
pub generate_config: Option<DateGenerateConfig>,
}Expand description
Props for the DatePicker component (MVP subset for single date picker).
Fields§
§value: Option<DateValue>Controlled value. When set, the component behaves as a controlled picker.
default_value: Option<DateValue>Initial value in uncontrolled mode.
placeholder: Option<String>Placeholder text shown when no value is selected.
format: Option<String>Display/parse format. MVP: primarily YYYY-MM-DD, reserved for future extension.
disabled: Option<bool>Whether the picker is disabled.
allow_clear: Option<bool>Whether to show a clear icon which resets the current value.
class: Option<String>Extra class on the root element.
style: Option<String>Inline style for the root element.
on_change: Option<EventHandler<Option<DateValue>>>Change callback fired when the selected date changes.
show_time: Option<ShowTimeConfig>Show time picker in addition to date picker.
ranges: Option<HashMap<String, (DateValue, DateValue)>>Preset date ranges for quick selection.
disabled_date: Option<Rc<dyn Fn(DateValue) -> bool>>Disable specific dates: (date) -> bool
disabled_time: Option<Rc<dyn Fn(DateValue) -> bool>>Disable specific times: (date) -> bool (for showTime mode)
Custom footer render: () -> Element
generate_config: Option<DateGenerateConfig>Custom date library configuration (for generateConfig).
Implementations§
Source§impl DatePickerProps
impl DatePickerProps
Sourcepub fn builder() -> DatePickerPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> DatePickerPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building DatePickerProps.
On the builder, call .value(...)(optional), .default_value(...)(optional), .placeholder(...)(optional), .format(...)(optional), .disabled(...)(optional), .allow_clear(...)(optional), .class(...)(optional), .style(...)(optional), .on_change(...)(optional), .show_time(...)(optional), .ranges(...)(optional), .disabled_date(...)(optional), .disabled_time(...)(optional), .render_extra_footer(...)(optional), .generate_config(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of DatePickerProps.
Trait Implementations§
Source§impl Clone for DatePickerProps
impl Clone for DatePickerProps
Source§fn clone(&self) -> DatePickerProps
fn clone(&self) -> DatePickerProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more