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
-
Config( interaction: state.Interaction, indicator_visibility: IndicatorVisibility, id: option.Option(String), selection_mode: config.SelectionMode, name: option.Option(String), requirement: state.Requirement, )
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
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 hide_selection_indicator(
s: Select,
indicator_visibility: IndicatorVisibility,
) -> Select
hide_selection_indicator sets the indicator_visibility field
pub fn multi(
s: Select,
selection_mode: config.SelectionMode,
) -> Select
multi sets the selection_mode field
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