Class: UI::DropdownMenuSubTriggerComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
DropdownMenuSubTriggerBehavior
Defined in:
app/view_components/ui/dropdown_menu_sub_trigger_component.rb

Overview

SubTriggerComponent - ViewComponent implementation

Instance Method Summary collapse

Methods included from DropdownMenuSubTriggerBehavior

#dropdown_menu_sub_trigger_classes, #dropdown_menu_sub_trigger_data_attributes, #dropdown_menu_sub_trigger_html_attributes

Constructor Details

#initialize(inset: false, classes: "", **attributes) ⇒ DropdownMenuSubTriggerComponent

Returns a new instance of DropdownMenuSubTriggerComponent.



7
8
9
10
11
# File 'app/view_components/ui/dropdown_menu_sub_trigger_component.rb', line 7

def initialize(inset: false, classes: "", **attributes)
  @inset = inset
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
# File 'app/view_components/ui/dropdown_menu_sub_trigger_component.rb', line 13

def call
   :div, **dropdown_menu_sub_trigger_html_attributes.merge(@attributes.except(:data)) do
    safe_join([
      content,
      chevron_icon_html
    ])
  end
end