Class: UI::DrawerContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::DrawerContentComponent
- Includes:
- DrawerContentBehavior
- Defined in:
- app/view_components/ui/drawer_content_component.rb
Overview
Drawer content component (ViewComponent) Main draggable panel with direction support
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(open: false, direction: "bottom", classes: "", attributes: {}) ⇒ DrawerContentComponent
constructor
A new instance of DrawerContentComponent.
Methods included from DrawerContentBehavior
#drawer_content_base_classes, #drawer_content_classes, #drawer_content_data_attributes, #drawer_content_html_attributes, #merged_drawer_content_data_attributes
Constructor Details
#initialize(open: false, direction: "bottom", classes: "", attributes: {}) ⇒ DrawerContentComponent
Returns a new instance of DrawerContentComponent.
17 18 19 20 21 22 |
# File 'app/view_components/ui/drawer_content_component.rb', line 17 def initialize(open: false, direction: "bottom", classes: "", attributes: {}) @open = open @direction = direction @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'app/view_components/ui/drawer_content_component.rb', line 24 def call attrs = drawer_content_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, class: "group/drawer-content", **attrs.merge(@attributes.except(:data)) do content end end |