m3e/rich_tooltip

rich_tooltip provides Lustre support for the M3E Rich Tooltip component https://matraic.github.io/m3e/#/components/tooltip.html

Types

Config is the configuration of a RichTooltip

Fields:

  • interaction: Whether the element is enabled or disabled.
  • for: The identifier of the interactive control to which this element is attached
  • hide_delay: The amount of time, in milliseconds, before hiding the tooltip
  • position: The position of the tooltip
  • show_delay: The amount of time, in milliseconds, before showing the tooltip
pub type Config {
  Config(
    interaction: state.Interaction,
    for: String,
    hide_delay: Int,
    position: Position,
    show_delay: Int,
  )
}

Constructors

Position is the possible positions for a rich tooltip

pub type Position {
  Above
  AboveAfter
  AboveBefore
  After
  Before
  Below
  BelowBefore
  BelowAfter
}

Constructors

  • Above
  • AboveAfter
  • AboveBefore
  • After
  • Before
  • Below
  • BelowBefore
  • BelowAfter

RichTooltip is an element, nested within a clickable element, used to dismiss a parenting rich tooltip

Fields:

  • interaction: Whether the element is enabled or disabled.
  • for: The identifier of the interactive control to which this element is attached
  • hide_delay: The amount of time, in milliseconds, before hiding the tooltip
  • position: The position of the tooltip
  • show_delay: The amount of time, in milliseconds, before showing the tooltip
pub opaque type RichTooltip

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

pub type Slot {
  Actions
  Subhead
}

Constructors

  • Actions
  • Subhead

Values

pub fn default_config() -> Config

default_config creates a Config with default values

pub const default_position: Position
pub fn disabled(
  r: RichTooltip,
  interaction: state.Interaction,
) -> RichTooltip

disabled sets the interaction field

pub fn for(r: RichTooltip, for: String) -> RichTooltip

for sets the for field

pub fn from_config(config: Config) -> RichTooltip

from_config creates a RichTooltip from a Config

pub fn hide_delay(r: RichTooltip, hide_delay: Int) -> RichTooltip

hide_delay sets the hide_delay field

pub fn new() -> RichTooltip

new creates a RichTooltip with default values

pub fn position(
  r: RichTooltip,
  position: Position,
) -> RichTooltip

position sets the position field

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

render creates a Lustre Element from a RichTooltip

pub fn render_config(
  c: 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 show_delay(r: RichTooltip, show_delay: Int) -> RichTooltip

show_delay sets the show_delay field

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

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

Search Document