m3e/select

select provides Lustre support for the M3E Select component

Types

Config holds the configuration for a Select

pub type Config {
  Config(
    interaction: state.Interaction,
    indicator_visibility: IndicatorVisibility,
    id: option.Option(String),
    selection_mode: config.SelectionMode,
    name: option.Option(String),
    requirement: state.Requirement,
  )
}

Constructors

IndicatorVisibility specifies if the selection indicator is visible or hidden

pub type IndicatorVisibility {
  Visible
  Hidden
}

Constructors

  • Visible
  • Hidden

Select provides a form control for selecting a value from a set of predefined options)

Fields:

  • interaction: Whether the element is enabled or disabled
  • indicator_visibility: Whether to hide the selection indicator for single select options
  • id: The id of the element
  • selection_mode: Whether multiple options can be selected
  • name: The name that identifies the element when submitting the associated form
  • requirement: Whether the element is required
pub opaque type Select

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

pub type Slot {
  Arrow
  Value
}

Constructors

  • Arrow
  • Value

Values

pub fn default_config() -> Config

default_config creates a new Config with default values

pub const default_indicator_visibility: IndicatorVisibility
pub fn disabled(
  s: Select,
  interaction: state.Interaction,
) -> Select

disabled sets the interaction field

pub fn from_config(c: Config) -> Select

from_config creates a Select from a Config record

pub fn hide_selection_indicator(
  s: Select,
  indicator_visibility: IndicatorVisibility,
) -> Select

hide_selection_indicator sets the indicator_visibility field

pub fn id(s: Select, id: option.Option(String)) -> Select

id sets the id field

pub fn multi(
  s: Select,
  selection_mode: config.SelectionMode,
) -> Select

multi sets the selection_mode field

pub fn name(s: Select, name: option.Option(String)) -> Select

name sets the name field

pub fn new() -> Select

new creates a new Select with default values

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

render creates a Lustre Element(msg) from a Select

Parameters:

  • s: a Select
  • attributes: additional attributes
  • children: additional children
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 required(
  s: Select,
  requirement: state.Requirement,
) -> Select

required sets the requirement field

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

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

Search Document