Class: UI::ResizablePanelComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ResizablePanelComponent
- Includes:
- ResizablePanelBehavior
- Defined in:
- app/view_components/ui/resizable_panel_component.rb
Overview
ResizablePanel component (ViewComponent) Individual resizable panel within a panel group
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(default_size: nil, min_size: nil, max_size: nil, classes: "", attributes: {}) ⇒ ResizablePanelComponent
constructor
A new instance of ResizablePanelComponent.
Methods included from ResizablePanelBehavior
#merged_panel_data_attributes, #panel_base_classes, #panel_data_attributes, #panel_html_attributes
Constructor Details
#initialize(default_size: nil, min_size: nil, max_size: nil, classes: "", attributes: {}) ⇒ ResizablePanelComponent
Returns a new instance of ResizablePanelComponent.
23 24 25 26 27 28 29 |
# File 'app/view_components/ui/resizable_panel_component.rb', line 23 def initialize(default_size: nil, min_size: nil, max_size: nil, classes: "", attributes: {}) @default_size = default_size @min_size = min_size @max_size = max_size @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/view_components/ui/resizable_panel_component.rb', line 31 def call attrs = panel_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)) do content end end |