m3e/date_input

DateInput is a segmented input for entering date and/or time values using a keyboard.

This file was generated by m3e/generator

     DO NOT EDIT

Types

Config is a public record for configuring this component.

pub type Config {
  Config(
    value: option.Option(date.Date),
    type_: date_input_type.DateInputType,
    show_seconds: ShowSeconds,
    time_format: date_input_time_format.DateInputTimeFormat,
    min_date: option.Option(date.Date),
    max_date: option.Option(date.Date),
    min_time: option.Option(time_parts.TimeParts),
    max_time: option.Option(time_parts.TimeParts),
    month_label: String,
    day_label: String,
    year_label: String,
    hour_label: String,
    minute_label: String,
    second_label: String,
    period_label: String,
    disabled: Disabled,
    readonly: Readonly,
    required: Required,
    name: String,
  )
}

Constructors

DateInput is a View Model for this component

Fields:

  • value: The value of the input.
  • type_: The interaction mode for editing date and/or time values.
  • show_seconds: Whether to show seconds.
  • time_format: Format used when editing time values.
  • min_date: The minimum date that can be selected.
  • max_date: The maximum date that can be selected.
  • min_time: The minimum time that can be selected.
  • max_time: The maximum time that can be selected.
  • month_label: The accessible label given to the month segment.
  • day_label: The accessible label given to the day segment.
  • year_label: The accessible label given to the year segment.
  • hour_label: The accessible label given to the hour segment.
  • minute_label: The accessible label given to the minute segment.
  • second_label: The accessible label given to the second segment.
  • period_label: The accessible label given to the period segment (AM/PM).
  • disabled: Whether the element is disabled.
  • readonly: A value indicating whether the element is read-only.
  • required: Whether a value is required for the element.
  • name: The name that identifies the element when submitting the associated form.
pub opaque type DateInput

Disabled is whether the element is disabled.

pub type Disabled {
  IsDisabled
  IsNotDisabled
}

Constructors

  • IsDisabled
  • IsNotDisabled

Readonly is a value indicating whether the element is read-only.

pub type Readonly {
  IsReadonly
  IsNotReadonly
}

Constructors

  • IsReadonly
  • IsNotReadonly

Required is whether a value is required for the element.

pub type Required {
  IsRequired
  IsNotRequired
}

Constructors

  • IsRequired
  • IsNotRequired

ShowSeconds is whether to show seconds.

pub type ShowSeconds {
  IsShowSeconds
  IsNotShowSeconds
}

Constructors

  • IsShowSeconds
  • IsNotShowSeconds

Values

pub fn day_label(
  record: DateInput,
  day_label: String,
) -> DateInput

day_label sets the value of day_label for this DateInput.

pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_day_label: String
pub const default_disabled: Disabled
pub const default_hour_label: String
pub const default_max_date: option.Option(date.Date)
pub const default_min_date: option.Option(date.Date)
pub const default_minute_label: String
pub const default_month_label: String
pub const default_name: String
pub const default_period_label: String
pub const default_readonly: Readonly
pub const default_required: Required
pub const default_second_label: String
pub const default_show_seconds: ShowSeconds
pub const default_year_label: String
pub fn disabled(
  record: DateInput,
  disabled: Disabled,
) -> DateInput

disabled sets the value of disabled for this DateInput.

pub fn from_config(config: Config) -> DateInput

from_config creates a new DateInput from the given configuration.

pub fn hour_label(
  record: DateInput,
  hour_label: String,
) -> DateInput

hour_label sets the value of hour_label for this DateInput.

pub fn max_date(
  record: DateInput,
  max_date: option.Option(date.Date),
) -> DateInput

max_date sets the value of max_date for this DateInput.

pub fn max_time(
  record: DateInput,
  max_time: option.Option(time_parts.TimeParts),
) -> DateInput

max_time sets the value of max_time for this DateInput.

pub fn min_date(
  record: DateInput,
  min_date: option.Option(date.Date),
) -> DateInput

min_date sets the value of min_date for this DateInput.

pub fn min_time(
  record: DateInput,
  min_time: option.Option(time_parts.TimeParts),
) -> DateInput

min_time sets the value of min_time for this DateInput.

pub fn minute_label(
  record: DateInput,
  minute_label: String,
) -> DateInput

minute_label sets the value of minute_label for this DateInput.

pub fn month_label(
  record: DateInput,
  month_label: String,
) -> DateInput

month_label sets the value of month_label for this DateInput.

pub fn name(record: DateInput, name: String) -> DateInput

name sets the value of name for this DateInput.

pub fn new() -> DateInput

new creates a new DateInput with the default configuration.

pub fn period_label(
  record: DateInput,
  period_label: String,
) -> DateInput

period_label sets the value of period_label for this DateInput.

pub fn readonly(
  record: DateInput,
  readonly: Readonly,
) -> DateInput

readonly sets the value of readonly for this DateInput.

pub fn render(
  model: DateInput,
  attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)

render creates a Lustre Element for a DateInput

pub fn render_config(
  c: Config,
  attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)

render_config creates a Lustre Element from a DateInput Config

pub fn required(
  record: DateInput,
  required: Required,
) -> DateInput

required sets the value of required for this DateInput.

pub fn second_label(
  record: DateInput,
  second_label: String,
) -> DateInput

second_label sets the value of second_label for this DateInput.

pub fn show_seconds(
  record: DateInput,
  show_seconds: ShowSeconds,
) -> DateInput

show_seconds sets the value of show_seconds for this DateInput.

pub fn time_format(
  record: DateInput,
  time_format: date_input_time_format.DateInputTimeFormat,
) -> DateInput

time_format sets the value of time_format for this DateInput.

pub fn type_(
  record: DateInput,
  type_: date_input_type.DateInputType,
) -> DateInput

type_ sets the value of type_ for this DateInput.

pub fn value(
  record: DateInput,
  value: option.Option(date.Date),
) -> DateInput

value sets the value of value for this DateInput.

pub fn year_label(
  record: DateInput,
  year_label: String,
) -> DateInput

year_label sets the value of year_label for this DateInput.

Search Document