Class: Ruflet::UI::Controls::RufletComponents::AppBarControl

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

Constant Summary collapse

TYPE =
"appbar".freeze
WIRE =
"AppBar".freeze
KEYWORDS =
[:actions, :actions_padding, :adaptive, :automatically_imply_leading, :badge, :bgcolor, :center_title, :clip_behavior, :col, :color, :data, :disabled, :elevation, :elevation_on_scroll, :exclude_header_semantics, :expand, :expand_loose, :force_material_transparency, :key, :leading, :leading_width, :opacity, :rtl, :secondary, :shadow_color, :shape, :title, :title_spacing, :title_text_style, :toolbar_height, :toolbar_opacity, :toolbar_text_style, :tooltip, :visible].freeze

Constants inherited from Control

Control::HOST_EXPANDED_TYPES, Control::SCHEMA_METADATA_CACHE

Instance Attribute Summary

Attributes inherited from Control

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

Instance Method Summary collapse

Methods inherited from Control

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

Constructor Details

#initialize(id: nil, **props) ⇒ AppBarControl

Returns a new instance of AppBarControl.



13
14
15
16
17
18
19
20
# File 'lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb', line 13

def initialize(id: nil, **props)
  compact = {}
  props.each do |key, value|
    raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
    compact[key] = value unless value.nil?
  end
  super(type: TYPE, id: id, **compact)
end