m3e/tooltip
tooltip provides Lustre support for the M3E Tooltip component https://matraic.github.io/m3e/#/components/tooltip.html
Types
Config holds the configuration for a Tooltip
pub type Config {
Config(
position: Position,
hide_delay: Int,
show_delay: Int,
disabled: state.Interaction,
gestures: TouchGestures,
)
}
Constructors
-
Config( position: Position, hide_delay: Int, show_delay: Int, disabled: state.Interaction, gestures: TouchGestures, )
HideDelay is the amount of time, in milliseconds, before hiding the tooltip.
pub type HideDelay =
Int
Position is tip position relative to its paired element
pub type Position {
Above
After
Before
Below
}
Constructors
-
Above -
After -
Before -
Below
ShowDelay is the amount of time, in milliseconds, before showing the tooltip
pub type ShowDelay =
Int
Tooltip adds additional context to a button or other UI element
Fields:
- tip: text of the tool tip
- for_id: the ID of the element to which the tip is associated
- position: tip position relative to its paired element
- hide_delay: amount of time, in milliseconds, before hiding the tooltip
- show_delay: amount of time, in milliseconds, before showing the tooltip
- disabled: the tooltip is disabled (or not)
- gestures: behaviour on touch devices
pub opaque type Tooltip
Behaviour on touch devices
pub type TouchGestures {
Auto
Off
On
}
Constructors
-
Auto -
Off -
On
Values
pub fn default_config() -> Config
default_config creates a new Config with default values
pub const default_position: Position
pub const default_touch_gestures: TouchGestures
pub fn disabled(t: Tooltip, d: state.Interaction) -> Tooltip
disabled sets the disabled field of a tooltip
pub fn from_config(
config: Config,
tip: String,
for_id: String,
) -> Tooltip
from_config creates a Tooltip from a Config
pub fn gestures(t: Tooltip, g: TouchGestures) -> Tooltip
gestures sets the gestures field of a Tooltip
pub fn new(tip: String, for_id: String) -> Tooltip
new returns a Tooltip
Parameters:
- tip: text of the tool tip
- for_id: the ID of the element to which the tip is associated
- position: tip position relative to its paired element
- hide_delay: amount of time, in milliseconds, before hiding the tooltip
- show_delay: amount of time, in milliseconds, before showing the tooltip
- disabled: the tooltip is disabled (or not)
- gestures: behaviour on touch devices
pub fn render(
t: Tooltip,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render creates a Lustre Element from a Tooltip
Parameters:
- t: a Tooltip
- attributes: a list of additional Attributes
pub fn render_config(
config: Config,
tip: String,
for_id: String,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element directly from a Config