Class: UI::SheetContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SheetContentComponent
- Includes:
- SheetContentBehavior
- Defined in:
- app/view_components/ui/sheet_content_component.rb
Overview
Sheet content component (ViewComponent) Main content panel with side variants and slide animations
Constant Summary
Constants included from SheetContentBehavior
UI::SheetContentBehavior::SIDES
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(side: "right", open: false, show_close: true, classes: "", **attributes) ⇒ SheetContentComponent
constructor
A new instance of SheetContentComponent.
Methods included from SheetContentBehavior
#merged_sheet_content_data_attributes, #sheet_content_base_classes, #sheet_content_classes, #sheet_content_close_button_classes, #sheet_content_data_attributes, #sheet_content_html_attributes, #sheet_content_side_classes
Constructor Details
#initialize(side: "right", open: false, show_close: true, classes: "", **attributes) ⇒ SheetContentComponent
Returns a new instance of SheetContentComponent.
18 19 20 21 22 23 24 |
# File 'app/view_components/ui/sheet_content_component.rb', line 18 def initialize(side: "right", open: false, show_close: true, classes: "", **attributes) @side = side @open = open @show_close = show_close @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/view_components/ui/sheet_content_component.rb', line 26 def call attrs = sheet_content_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)) do safe_join([ content, ].compact) end end |