Class: FoxTail::DialogComponent

Inherits:
SurfaceComponent show all
Defined in:
app/components/fox_tail/dialog_component.rb

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from SurfaceComponent

#before_render, #call, #root_tag_name

Methods inherited from ClickableComponent

#before_render, #call, #link?, #root_tag_name, stimulus_controller_name, #stimulus_controller_options, #use_stimulus?

Methods inherited from BaseComponent

classname_merger, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

#initialize(html_attributes = {}) ⇒ DialogComponent

Returns a new instance of DialogComponent.



21
22
23
24
# File 'app/components/fox_tail/dialog_component.rb', line 21

def initialize(html_attributes = {})
  html_attributes[:border] = false unless html_attributes.key? :border
  super
end

Instance Method Details

#formatted_contentObject



34
35
36
37
38
39
# File 'app/components/fox_tail/dialog_component.rb', line 34

def formatted_content
  return nil unless content? && content.present?
  return content unless wrap_content?

   :div, content, class: theme.apply(:body, self)
end

#hover?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'app/components/fox_tail/dialog_component.rb', line 26

def hover?
  false
end

#tag_nameObject



30
31
32
# File 'app/components/fox_tail/dialog_component.rb', line 30

def tag_name
  :div
end