m3e/radio_group

radio_group provides Lustre support for the M3E Radio Group component

Types

Config holds the configuration for a RadioGroup

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

Constructors

RadioGroup provides Lustre support for the M3E Radio Group component

Fields:

  • interaction: Whether the element is enabled or disabled.
  • id: The id of the element
  • name: The name that identifies the element when submitting the associated form
  • requirement: Whether the element is required
pub opaque type RadioGroup

Values

pub fn default_config() -> Config

default_config creates a new Config with default values

pub fn disabled(
  group: RadioGroup,
  interaction: state.Interaction,
) -> RadioGroup

disabled sets the interaction field

pub fn from_config(c: Config) -> RadioGroup

from_config creates a RadioGroup from a Config record

pub fn id(
  group: RadioGroup,
  id: option.Option(String),
) -> RadioGroup

id sets the id field

pub fn name(
  group: RadioGroup,
  name: option.Option(String),
) -> RadioGroup

name sets the name field

pub fn new() -> RadioGroup

new creates a new RadioGroup with default values

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

render creates a Lustre Element(msg) from a RadioGroup

Parameters:

  • group: a RadioGroup
  • 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(
  group: RadioGroup,
  requirement: state.Requirement,
) -> RadioGroup

required sets the requirement field

Search Document