Expresso.Element.TextArea (expresso v0.1.0)

Copy Markdown View Source

An element that can have text

Summary

Types

t()

The struct of a text area

Functions

Make the assigns of the render function from the struct

Make the HTML of a text area

Types

t()

@type t() :: %Expresso.Element.TextArea{
  __spark_metadata__: term(),
  at: term(),
  class: term(),
  easing: term(),
  effect: term(),
  el: term(),
  goto: term(),
  morph: term(),
  on: term(),
  signature: term(),
  speed: term(),
  steps: term(),
  text: term()
}

The struct of a text area

Functions

get_assigns(text_area)

@spec get_assigns(t()) :: map()

Make the assigns of the render function from the struct

The key overlay holds the attributes of the overlay contract, from Expresso.Overlay.Render.attributes/1. The key goto holds the link of the goto option, or nil. The key text holds the text with the ids and the style rules of this copy in each inline SVG, from Expresso.SvgCopy.copy_each/1.

render(assigns)

@spec render(map()) :: Phoenix.HTML.safe()

Make the HTML of a text area

The text goes into one block element inside the root tag. The theme makes the root tag a flex container. Each element of the text is then a flex item, and the text breaks into more than one line. One block element keeps the text in one flex item, and each inline element of the text stays on one line.

With the goto option, the block element goes into a link. The text must then hold no link, because HTML does not permit a link inside a link.