Class: FoxTail::DialogComponent
- Inherits:
-
SurfaceComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- ClickableComponent
- SurfaceComponent
- FoxTail::DialogComponent
- Defined in:
- app/components/fox_tail/dialog_component.rb
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
- #formatted_content ⇒ Object
- #hover? ⇒ Boolean
-
#initialize(html_attributes = {}) ⇒ DialogComponent
constructor
A new instance of DialogComponent.
- #tag_name ⇒ Object
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
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_content ⇒ Object
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? content_tag :div, content, class: theme.apply(:body, self) end |
#hover? ⇒ Boolean
26 27 28 |
# File 'app/components/fox_tail/dialog_component.rb', line 26 def hover? false end |
#tag_name ⇒ Object
30 31 32 |
# File 'app/components/fox_tail/dialog_component.rb', line 30 def tag_name :div end |