Class: UI::ResizablePanelGroupComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ResizablePanelGroupComponent
- Includes:
- ResizablePanelGroupBehavior
- Defined in:
- app/view_components/ui/resizable_panel_group_component.rb
Overview
ResizablePanelGroup container component (ViewComponent) Wraps resizable panels with Stimulus controller
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(direction: "horizontal", keyboard_resize_by: 10, classes: "", attributes: {}) ⇒ ResizablePanelGroupComponent
constructor
A new instance of ResizablePanelGroupComponent.
Methods included from ResizablePanelGroupBehavior
#merged_panel_group_data_attributes, #panel_group_base_classes, #panel_group_data_attributes, #panel_group_html_attributes
Constructor Details
#initialize(direction: "horizontal", keyboard_resize_by: 10, classes: "", attributes: {}) ⇒ ResizablePanelGroupComponent
Returns a new instance of ResizablePanelGroupComponent.
30 31 32 33 34 35 |
# File 'app/view_components/ui/resizable_panel_group_component.rb', line 30 def initialize(direction: "horizontal", keyboard_resize_by: 10, classes: "", attributes: {}) @direction = direction @keyboard_resize_by = keyboard_resize_by @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/view_components/ui/resizable_panel_group_component.rb', line 37 def call attrs = panel_group_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)) do content end end |