Class: FoxTail::DismissibleComponent
- Inherits:
-
BaseComponent
show all
- Includes:
- Concerns::HasStimulusController
- Defined in:
- app/components/fox_tail/dismissible_component.rb
Defined Under Namespace
Classes: StimulusController
Instance Attribute Summary
#html_attributes
Class Method Summary
collapse
Instance Method Summary
collapse
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
fox_tail_config
Class Method Details
.stimulus_controller_name ⇒ Object
31
32
33
|
# File 'app/components/fox_tail/dismissible_component.rb', line 31
def stimulus_controller_name
:dismissible
end
|
Instance Method Details
#before_render ⇒ Object
10
11
12
13
14
|
# File 'app/components/fox_tail/dismissible_component.rb', line 10
def before_render
super
html_attributes[:class] = classnames theme.apply(:root, self), html_class
end
|
#call ⇒ Object
16
17
18
|
# File 'app/components/fox_tail/dismissible_component.rb', line 16
def call
content_tag :div, content, html_attributes
end
|
#stimulus_controller_options ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'app/components/fox_tail/dismissible_component.rb', line 20
def stimulus_controller_options
{
remove: remove?,
auto_close: auto_close?,
delay: delay,
dismissing_classes: theme.apply("root/dismissing", self),
dismissed_classes: theme.apply("root/dismissed", self)
}
end
|