Class: Ruflet::UI::Controls::RufletComponents::ChipControl

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

Constant Summary collapse

TYPE =
"chip".freeze
WIRE =
"Chip".freeze
KEYWORDS =
[:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :autofocus, :badge, :bgcolor, :border_side, :bottom, :check_color, :clip_behavior, :col, :color, :data, :delete_drawer_animation_style, :delete_icon, :delete_icon_color, :delete_icon_size_constraints, :delete_icon_tooltip, :disabled, :disabled_color, :elevation, :elevation_on_click, :enable_animation_style, :expand, :expand_loose, :height, :key, :label, :label_padding, :label_text_style, :leading, :leading_drawer_animation_style, :leading_size_constraints, :left, :margin, :offset, :opacity, :padding, :right, :rotate, :rtl, :scale, :select_animation_style, :selected, :selected_color, :selected_shadow_color, :shadow_color, :shape, :show_checkmark, :size_change_interval, :tooltip, :top, :visible, :visual_density, :width, :on_animation_end, :on_blur, :on_click, :on_delete, :on_focus, :on_select, :on_size_change].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) ⇒ ChipControl

Returns a new instance of ChipControl.



13
14
15
16
17
18
19
20
# File 'lib/ruflet_ui/ruflet/ui/controls/materials/chip_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