Class: Ruflet::UI::Controls::RufletComponents::TextControl

Inherits:
Control
  • Object
show all
Defined in:
lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb

Constant Summary collapse

TYPE =
"text".freeze
WIRE =
"Text".freeze

Constants inherited from Control

Control::HOST_EXPANDED_TYPES

Instance Attribute Summary

Attributes inherited from Control

#children, #id, #props, #runtime_page, #type, #wire_id

Instance Method Summary collapse

Methods inherited from Control

#emit, generate_id, #has_handler?, #on, #to_patch

Constructor Details

#initialize(id: nil, alignment: nil, data: nil, ellipsis: nil, key: nil, max_lines: nil, max_width: nil, rotate: nil, spans: nil, style: nil, text_align: nil, value: nil, x: nil, y: nil) ⇒ TextControl

Returns a new instance of TextControl.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb', line 11

def initialize(id: nil, alignment: nil, data: nil, ellipsis: nil, key: nil, max_lines: nil, max_width: nil, rotate: nil, spans: nil, style: nil, text_align: nil, value: nil, x: nil, y: nil)
  props = {}
  props[:alignment] = alignment unless alignment.nil?
  props[:data] = data unless data.nil?
  props[:ellipsis] = ellipsis unless ellipsis.nil?
  props[:key] = key unless key.nil?
  props[:max_lines] = max_lines unless max_lines.nil?
  props[:max_width] = max_width unless max_width.nil?
  props[:rotate] = rotate unless rotate.nil?
  props[:spans] = spans unless spans.nil?
  props[:style] = style unless style.nil?
  props[:text_align] = text_align unless text_align.nil?
  props[:value] = value unless value.nil?
  props[:x] = x unless x.nil?
  props[:y] = y unless y.nil?
  super(type: TYPE, id: id, **props)
end