m3e/option

option provides Lustre support for the M3E Option component

Types

Config holds the configuration for an Option

pub type Config {
  Config(
    interaction: types.Interaction,
    selection: types.SelectionState,
    value: option.Option(String),
  )
}

Constructors

Option holds all information to create an Option

Fields:

  • interaction: Whether the element is enabled or disabled
  • selection: Whether the element is selected
  • value: A string representing the value of the option
pub opaque type Option

Values

pub fn default_config() -> Config

default_config creates a new Config with default values

pub fn disabled(
  o: Option,
  interaction: types.Interaction,
) -> Option

disabled sets the interaction field

pub fn from_config(c: Config) -> Option

from_config creates an Option from a Config record

pub fn new() -> Option

new creates a new Option with default values

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

render creates an M3E Option component from an Option

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

render_config creates a Lustre Element directly from a Config

pub fn selected(
  o: Option,
  selection: types.SelectionState,
) -> Option

selected sets the selection field

pub fn value(o: Option, value: option.Option(String)) -> Option

value sets the value field

Search Document