m3e/selection_list

selection_list provides Lustre support for the M3E Selection List component

Types

Config is the configuration of a SelectionList

Fields:

  • interaction: Whether the element is enabled or disabled
  • indicator_visibility: Whether to hide the selection indicator
  • selection_mode: Whether multiple items can be selected
  • variant: The appearance variant of the list
pub type Config {
  Config(
    interaction: types.Interaction,
    indicator_visibility: IndicatorVisibility,
    selection_mode: types.SelectionMode,
    variant: list_variant.Variant,
  )
}

Constructors

IndicatorVisibility specifies if the selection indicator is visible or hidden

pub type IndicatorVisibility {
  Visible
  Hidden
}

Constructors

  • Visible
  • Hidden

SelectionList provides a container for managing selectable list items with single or multi-select capabilities

Fields:

  • interaction: Whether the element is enabled or disabled
  • indicator_visibility: Whether to hide the selection indicator
  • selection_mode: Whether multiple items can be selected
  • variant: The appearance variant of the list
pub opaque type SelectionList

Values

pub fn default_config() -> Config

default_config creates a Config with default values

pub const default_indicator_visibility: IndicatorVisibility
pub fn disabled(
  sl: SelectionList,
  interaction: types.Interaction,
) -> SelectionList

disabled sets the interaction field

pub fn from_config(config: Config) -> SelectionList

from_config creates a SelectionList from a Config

Parameters:

  • config: a Config
pub fn hide_selection_indicator(
  sl: SelectionList,
  indicator_visibility: IndicatorVisibility,
) -> SelectionList

hide_selection_indicator sets the indicator_visibility field

pub fn multi(
  sl: SelectionList,
  selection_mode: types.SelectionMode,
) -> SelectionList

multi sets the selection_mode field

pub fn new() -> SelectionList

new creates a SelectionList with default values

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

render creates a Lustre Element from a SelectionList

Parameters:

  • sl: a SelectionList
  • 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 variant(
  sl: SelectionList,
  variant: list_variant.Variant,
) -> SelectionList

variant sets the variant field

Search Document