Class: Ruflet::UI::Controls::RufletComponents::VerticalDividerControl

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

Constant Summary collapse

TYPE =
"verticaldivider".freeze
WIRE =
"VerticalDivider".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, badge: nil, col: nil, color: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, key: nil, leading_indent: nil, opacity: nil, radius: nil, rtl: nil, thickness: nil, tooltip: nil, trailing_indent: nil, visible: nil, width: nil) ⇒ VerticalDividerControl

Returns a new instance of VerticalDividerControl.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ruflet_ui/ruflet/ui/controls/materials/verticaldivider_control.rb', line 11

def initialize(id: nil, badge: nil, col: nil, color: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, key: nil, leading_indent: nil, opacity: nil, radius: nil, rtl: nil, thickness: nil, tooltip: nil, trailing_indent: nil, visible: nil, width: nil)
  {
    leading_indent: leading_indent,
    thickness: thickness,
    trailing_indent: trailing_indent,
    width: width
  }.each do |name, value|
    raise ArgumentError, "vertical_divider #{name} must be greater than or equal to 0" unless value.nil? || value >= 0
  end

  props = {}
  props[:badge] = badge unless badge.nil?
  props[:col] = col unless col.nil?
  props[:color] = color unless color.nil?
  props[:data] = data unless data.nil?
  props[:disabled] = disabled unless disabled.nil?
  props[:expand] = expand unless expand.nil?
  props[:expand_loose] = expand_loose unless expand_loose.nil?
  props[:key] = key unless key.nil?
  props[:leading_indent] = leading_indent unless leading_indent.nil?
  props[:opacity] = opacity unless opacity.nil?
  props[:radius] = radius unless radius.nil?
  props[:rtl] = rtl unless rtl.nil?
  props[:thickness] = thickness unless thickness.nil?
  props[:tooltip] = tooltip unless tooltip.nil?
  props[:trailing_indent] = trailing_indent unless trailing_indent.nil?
  props[:visible] = visible unless visible.nil?
  props[:width] = width unless width.nil?
  super(type: TYPE, id: id, **props)
end