Class: UI::SheetOverlayComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SheetOverlayComponent
- Includes:
- SheetOverlayBehavior
- Defined in:
- app/view_components/ui/sheet_overlay_component.rb
Overview
Sheet overlay component (ViewComponent) Container and backdrop for sheet
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(open: false, classes: "", **attributes) ⇒ SheetOverlayComponent
constructor
A new instance of SheetOverlayComponent.
Methods included from SheetOverlayBehavior
#merged_sheet_overlay_container_data_attributes, #sheet_overlay_base_classes, #sheet_overlay_classes, #sheet_overlay_container_base_classes, #sheet_overlay_container_classes, #sheet_overlay_container_data_attributes, #sheet_overlay_container_html_attributes, #sheet_overlay_data_attributes, #sheet_overlay_html_attributes
Constructor Details
#initialize(open: false, classes: "", **attributes) ⇒ SheetOverlayComponent
Returns a new instance of SheetOverlayComponent.
18 19 20 21 22 |
# File 'app/view_components/ui/sheet_overlay_component.rb', line 18 def initialize(open: false, classes: "", **attributes) @open = open @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/view_components/ui/sheet_overlay_component.rb', line 24 def call container_attrs = container_attrs[:data] = container_attrs[:data].merge(@attributes.fetch(:data, {})) = content_tag :div, **container_attrs.merge(@attributes.except(:data)) do safe_join([ content_tag(:div, "", **), content ]) end end |