m3e/calendar

Calendar is a calendar used to select a date.

This file was generated by m3e/generator

     DO NOT EDIT

Types

Calendar is a View Model for this component

Fields:

  • date: The selected date.
  • max_date: The maximum date that can be selected.
  • min_date: The minimum date that can be selected.
  • range_end: End of a date range.
  • range_start: Start of a date range.
  • start_at: A date specifying the period (month or year) to start the calendar in.
  • start_view: The initial view used to select a date.
  • previous_month_label: The accessible label given to the button used to move to the previous month.
  • next_month_label: The accessible label given to the button used to move to the next month.
  • previous_year_label: The accessible label given to the button used to move to the previous year.
  • next_year_label: The accessible label given to the button used to move to the next year.
  • previous_multi_year_label: The accessible label given to the button used to move to the previous 24 years.
  • next_multi_year_label: The accessible label given to the button used to move to the next 24 years.
pub opaque type Calendar

Config is a public record for configuring this component.

pub type Config {
  Config(
    date: option.Option(date.Date),
    max_date: option.Option(date.Date),
    min_date: option.Option(date.Date),
    range_end: option.Option(date.Date),
    range_start: option.Option(date.Date),
    start_at: option.Option(date.Date),
    start_view: calendar_view.CalendarView,
    previous_month_label: String,
    next_month_label: String,
    previous_year_label: String,
    next_year_label: String,
    previous_multi_year_label: String,
    next_multi_year_label: String,
  )
}

Constructors

Slots are used in child elements to insert content into this component

pub type Slot {
  Header
}

Constructors

  • Header

Values

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

date sets the value of date for this Calendar.

pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_max_date: option.Option(date.Date)
pub const default_min_date: option.Option(date.Date)
pub const default_next_month_label: String
pub const default_next_multi_year_label: String
pub const default_next_year_label: String
pub const default_previous_month_label: String
pub const default_previous_multi_year_label: String
pub const default_previous_year_label: String
pub const default_range_end: option.Option(date.Date)
pub const default_range_start: option.Option(date.Date)
pub const default_start_at: option.Option(date.Date)
pub fn from_config(config: Config) -> Calendar

from_config creates a new Calendar from the given configuration.

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

max_date sets the value of max_date for this Calendar.

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

min_date sets the value of min_date for this Calendar.

pub fn new() -> Calendar

new creates a new Calendar with the default configuration.

pub fn next_month_label(
  record: Calendar,
  next_month_label: String,
) -> Calendar

next_month_label sets the value of next_month_label for this Calendar.

pub fn next_multi_year_label(
  record: Calendar,
  next_multi_year_label: String,
) -> Calendar

next_multi_year_label sets the value of next_multi_year_label for this Calendar.

pub fn next_year_label(
  record: Calendar,
  next_year_label: String,
) -> Calendar

next_year_label sets the value of next_year_label for this Calendar.

pub fn previous_month_label(
  record: Calendar,
  previous_month_label: String,
) -> Calendar

previous_month_label sets the value of previous_month_label for this Calendar.

pub fn previous_multi_year_label(
  record: Calendar,
  previous_multi_year_label: String,
) -> Calendar

previous_multi_year_label sets the value of previous_multi_year_label for this Calendar.

pub fn previous_year_label(
  record: Calendar,
  previous_year_label: String,
) -> Calendar

previous_year_label sets the value of previous_year_label for this Calendar.

pub fn range_end(
  record: Calendar,
  range_end: option.Option(date.Date),
) -> Calendar

range_end sets the value of range_end for this Calendar.

pub fn range_start(
  record: Calendar,
  range_start: option.Option(date.Date),
) -> Calendar

range_start sets the value of range_start for this Calendar.

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

render creates a Lustre Element for a Calendar

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

render_config creates a Lustre Element from a Calendar Config

pub fn slot(s: Slot) -> attribute.Attribute(msg)

slot returns a Lustre Attribute(msg) for the given slot name

pub fn start_at(
  record: Calendar,
  start_at: option.Option(date.Date),
) -> Calendar

start_at sets the value of start_at for this Calendar.

pub fn start_view(
  record: Calendar,
  start_view: calendar_view.CalendarView,
) -> Calendar

start_view sets the value of start_view for this Calendar.

Search Document