Class: UI::DrawerOverlayComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::DrawerOverlayComponent
- Includes:
- DrawerOverlayBehavior
- Defined in:
- app/view_components/ui/drawer_overlay_component.rb
Overview
Drawer overlay component (ViewComponent) Backdrop with fade animation
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(open: false, classes: "", attributes: {}) ⇒ DrawerOverlayComponent
constructor
A new instance of DrawerOverlayComponent.
Methods included from DrawerOverlayBehavior
#drawer_overlay_base_classes, #drawer_overlay_classes, #drawer_overlay_container_base_classes, #drawer_overlay_container_classes, #drawer_overlay_container_data_attributes, #drawer_overlay_container_html_attributes, #drawer_overlay_data_attributes, #drawer_overlay_html_attributes, #merged_drawer_overlay_container_data_attributes
Constructor Details
#initialize(open: false, classes: "", attributes: {}) ⇒ DrawerOverlayComponent
Returns a new instance of DrawerOverlayComponent.
14 15 16 17 18 |
# File 'app/view_components/ui/drawer_overlay_component.rb', line 14 def initialize(open: false, classes: "", attributes: {}) @open = open @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/view_components/ui/drawer_overlay_component.rb', line 20 def call container_attrs = container_attrs[:data] = container_attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **container_attrs.merge(@attributes.except(:data)) do content_tag :div, "", ** end end |