Class: Ruflet::UI::Controls::RufletComponents::DividerControl
- Defined in:
- lib/ruflet_ui/ruflet/ui/controls/materials/divider_control.rb
Constant Summary collapse
- TYPE =
"divider".freeze
- WIRE =
"Divider".freeze
Constants inherited from Control
Instance Attribute Summary
Attributes inherited from Control
#children, #id, #props, #runtime_page, #type, #wire_id
Instance Method Summary collapse
-
#initialize(id: nil, badge: nil, col: nil, color: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, leading_indent: nil, opacity: nil, radius: nil, rtl: nil, thickness: nil, tooltip: nil, trailing_indent: nil, visible: nil) ⇒ DividerControl
constructor
A new instance of DividerControl.
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, height: nil, key: nil, leading_indent: nil, opacity: nil, radius: nil, rtl: nil, thickness: nil, tooltip: nil, trailing_indent: nil, visible: nil) ⇒ DividerControl
Returns a new instance of DividerControl.
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/divider_control.rb', line 11 def initialize(id: nil, badge: nil, col: nil, color: nil, data: nil, disabled: nil, expand: nil, expand_loose: nil, height: nil, key: nil, leading_indent: nil, opacity: nil, radius: nil, rtl: nil, thickness: nil, tooltip: nil, trailing_indent: nil, visible: nil) { height: height, leading_indent: leading_indent, thickness: thickness, trailing_indent: trailing_indent }.each do |name, value| raise ArgumentError, "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] = unless .nil? props[:expand_loose] = unless .nil? props[:height] = height unless height.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? super(type: TYPE, id: id, **props) end |