Class: FoxTail::DrawerComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- FoxTail::DrawerComponent
- Includes:
- Concerns::HasStimulusController
- Defined in:
- app/components/fox_tail/drawer_component.rb
Defined Under Namespace
Classes: StimulusController
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
Methods inherited from BaseComponent
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
This class inherits a constructor from FoxTail::BaseComponent
Instance Method Details
#before_render ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/components/fox_tail/drawer_component.rb', line 47 def before_render super html_attributes[:class] = classnames theme.apply(:root, self), open? ? visible_classes : hidden_classes, html_class html_attributes[:tab_index] ||= -1 html_attributes[:aria] ||= {} html_attributes[:aria][:hidden] = open? end |
#call ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'app/components/fox_tail/drawer_component.rb', line 59 def call content_tag tag_name, html_attributes do concat if concat notch if notch? yield if block_given? concat content end end |
#stimulus_controller_options ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'app/components/fox_tail/drawer_component.rb', line 68 def { backdrop: backdrop?, body_scrolling: body_scrolling?, open: open?, visible_classes: visible_classes, hidden_classes: hidden_classes, backdrop_classes: backdrop_classes, body_classes: body_classes } end |