Class: FoxTail::Dropdown::ToggleItemComponent

Inherits:
InputItemComponent
  • Object
show all
Defined in:
app/components/fox_tail/dropdown/toggle_item_component.rb

Instance Method Summary collapse

Instance Method Details

#callObject



10
11
12
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 10

def call
   :div, input_content, html_attributes
end

#idObject



6
7
8
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 6

def id
  options[:id] ||= multiple? ? tag_id_for_value(checked_value) : tag_id
end

#input_classesObject



14
15
16
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 14

def input_classes
  classnames super, theme.apply(:checkbox, self)
end

#input_contentObject



18
19
20
21
22
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 18

def input_content
  render FoxTail::ToggleComponent.new(options.merge(class: input_classes)) do |toggle|
    toggle.with_label(content) if content?
  end
end