Class: Plushie::Widget::TextEditor
- Inherits:
-
Object
- Object
- Plushie::Widget::TextEditor
- Defined in:
- lib/plushie/widget/text_editor.rb
Overview
Text editor -- multi-line editable text area.
Props:
- content (string) -- initial text content.
- placeholder (string) -- placeholder text.
- width (length) -- editor width.
- height (length) -- editor height.
- min_height (number) -- minimum height in pixels.
- max_height (number) -- maximum height in pixels.
- font (string|hash) -- font specification.
- size (number) -- font size in pixels.
- line_height (number|hash) -- line height.
- padding (number) -- uniform padding in pixels.
- wrapping (symbol) -- text wrapping mode.
- ime_purpose (string) -- IME input purpose: "normal", "secure", "terminal".
- highlight_syntax (string) -- language for syntax highlighting.
- highlight_theme (string) -- highlighter theme.
- style (symbol|hash) -- named style or style map.
- key_bindings (array of hashes) -- declarative key binding rules.
- placeholder_color (string) -- placeholder text color.
- selection_color (string) -- selection highlight color.
- a11y (hash) -- accessibility overrides.
Constant Summary collapse
- PROPS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Supported property keys for this widget.
%i[content placeholder width height min_height max_height font size line_height padding wrapping ime_purpose highlight_syntax highlight_theme style key_bindings placeholder_color selection_color a11y].freeze
Instance Attribute Summary collapse
-
#a11y ⇒ Object
readonly
Returns the value of attribute a11y.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#font ⇒ Object
readonly
Returns the value of attribute font.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#highlight_syntax ⇒ Object
readonly
Returns the value of attribute highlight_syntax.
-
#highlight_theme ⇒ Object
readonly
Returns the value of attribute highlight_theme.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ime_purpose ⇒ Object
readonly
Returns the value of attribute ime_purpose.
-
#key_bindings ⇒ Object
readonly
Returns the value of attribute key_bindings.
-
#line_height ⇒ Object
readonly
Returns the value of attribute line_height.
-
#max_height ⇒ Object
readonly
Returns the value of attribute max_height.
-
#min_height ⇒ Object
readonly
Returns the value of attribute min_height.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#placeholder ⇒ Object
readonly
Returns the value of attribute placeholder.
-
#placeholder_color ⇒ Object
readonly
Returns the value of attribute placeholder_color.
-
#selection_color ⇒ Object
readonly
Returns the value of attribute selection_color.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
-
#wrapping ⇒ Object
readonly
Returns the value of attribute wrapping.
Instance Method Summary collapse
- #build ⇒ Plushie::Node
-
#initialize(id, **opts) ⇒ TextEditor
constructor
A new instance of TextEditor.
Constructor Details
#initialize(id, **opts) ⇒ TextEditor
Returns a new instance of TextEditor.
46 47 48 49 |
# File 'lib/plushie/widget/text_editor.rb', line 46 def initialize(id, **opts) @id = id.to_s PROPS.each { |k| instance_variable_set(:"@#{k}", opts[k]) if opts.key?(k) } end |
Instance Attribute Details
#a11y ⇒ Object (readonly)
Returns the value of attribute a11y.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def a11y @a11y end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def content @content end |
#font ⇒ Object (readonly)
Returns the value of attribute font.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def font @font end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def height @height end |
#highlight_syntax ⇒ Object (readonly)
Returns the value of attribute highlight_syntax.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def highlight_syntax @highlight_syntax end |
#highlight_theme ⇒ Object (readonly)
Returns the value of attribute highlight_theme.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def highlight_theme @highlight_theme end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def id @id end |
#ime_purpose ⇒ Object (readonly)
Returns the value of attribute ime_purpose.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def ime_purpose @ime_purpose end |
#key_bindings ⇒ Object (readonly)
Returns the value of attribute key_bindings.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def key_bindings @key_bindings end |
#line_height ⇒ Object (readonly)
Returns the value of attribute line_height.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def line_height @line_height end |
#max_height ⇒ Object (readonly)
Returns the value of attribute max_height.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def max_height @max_height end |
#min_height ⇒ Object (readonly)
Returns the value of attribute min_height.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def min_height @min_height end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def padding @padding end |
#placeholder ⇒ Object (readonly)
Returns the value of attribute placeholder.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def placeholder @placeholder end |
#placeholder_color ⇒ Object (readonly)
Returns the value of attribute placeholder_color.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def placeholder_color @placeholder_color end |
#selection_color ⇒ Object (readonly)
Returns the value of attribute selection_color.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def selection_color @selection_color end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def size @size end |
#style ⇒ Object (readonly)
Returns the value of attribute style.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def style @style end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def width @width end |
#wrapping ⇒ Object (readonly)
Returns the value of attribute wrapping.
1 2 3 |
# File 'lib/plushie/widget/text_editor.rb', line 1 def wrapping @wrapping end |