m3e/list_option

list_option provides Lustre support for the M3E List Option component

Types

Config is the configuration of a ListOption

pub type Config {
  Config(disabled: Bool, selected: Bool)
}

Constructors

  • Config(disabled: Bool, selected: Bool)

ListOption represents a selectable item within a list container

Fields:

  • disabled: Whether the element is disabled
  • selected: Whether the element is selected
pub opaque type ListOption

Slot gives type-safe names to each of the defined HTML named slots

pub type Slot {
  Leading
  Overline
  SupportingText
  Trailing
}

Constructors

  • Leading
  • Overline
  • SupportingText
  • Trailing

Values

pub fn default_config() -> Config

default_config creates a Config with default values

pub fn disabled(lo: ListOption, disabled: Bool) -> ListOption

disabled sets the disabled field

pub fn from_config(config: Config) -> ListOption

from_config creates a ListOption from a Config

Parameters:

  • config: a Config
pub fn new() -> ListOption

new creates a ListOption with default values

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

render creates a Lustre Element from a ListOption

Parameters:

  • lo: a ListOption
  • attributes: a list of additional Attributes
  • children: the main content
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

Parameters:

  • config: a Config
pub fn selected(lo: ListOption, selected: Bool) -> ListOption

selected sets the selected field

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

slot creates a Lustre ‘slot’ Attribute(msg) for a Slot

Search Document