m3e/autocomplete

autocomplete provides Lustre support for the M3E Autocomplete component

Types

Activation specifies if the first option should be automatically activated

pub type Activation {
  AutoActivate
  ManualActivate
}

Constructors

  • AutoActivate
  • ManualActivate

Autocomplete enhances an input field with a panel of suggested options

Fields:

  • auto_activate: Whether the first option should be automatically activated
  • for: The identifier of the interactive control to which this element is attached
  • selection_indicator: Whether to hide the selection indicator
  • requirement: Whether the user is required to make a selection
pub opaque type Autocomplete

Config holds the configuration for an Autocomplete

pub type Config {
  Config(
    auto_activate: Activation,
    for: String,
    selection_indicator: config.SelectionIndicator,
    requirement: state.Requirement,
  )
}

Constructors

Values

pub fn auto_activate(
  a: Autocomplete,
  activation: Activation,
) -> Autocomplete

auto_activate sets the auto_activate field of an Autocomplete

pub const default_activation: Activation
pub fn default_config() -> Config

default_config creates a new Config with default values

pub fn for(a: Autocomplete, for: String) -> Autocomplete

for sets the for field of an Autocomplete

pub fn from_config(c: Config) -> Autocomplete

from_config creates an Autocomplete from a Config record

pub fn new(for: String) -> Autocomplete

new creates a new Autocomplete

pub fn render(
  a: Autocomplete,
  children: List(option.Option),
) -> element.Element(msg)

render creates an M3E Autocomplete component from an Autocomplete

pub fn render_config(
  config: Config,
  children: List(option.Option),
) -> element.Element(msg)

render_config creates a Lustre Element directly from a Config

pub fn requirement(
  a: Autocomplete,
  requirement: state.Requirement,
) -> Autocomplete

requirement sets the requirement field of an Autocomplete

pub fn selection_indicator(
  a: Autocomplete,
  indicator: config.SelectionIndicator,
) -> Autocomplete

selection_indicator sets the selection_indicator field of an Autocomplete

Search Document