Class: UI::ResizableHandleComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ResizableHandleComponent
- Includes:
- ResizableHandleBehavior
- Defined in:
- app/view_components/ui/resizable_handle_component.rb
Overview
ResizableHandle component (ViewComponent) Draggable handle between resizable panels
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(with_handle: false, classes: "", attributes: {}) ⇒ ResizableHandleComponent
constructor
A new instance of ResizableHandleComponent.
Methods included from ResizableHandleBehavior
#grip_container_classes, #handle_actions, #handle_base_classes, #handle_data_attributes, #handle_html_attributes, #merged_handle_data_attributes
Constructor Details
#initialize(with_handle: false, classes: "", attributes: {}) ⇒ ResizableHandleComponent
Returns a new instance of ResizableHandleComponent.
17 18 19 20 21 |
# File 'app/view_components/ui/resizable_handle_component.rb', line 17 def initialize(with_handle: false, classes: "", attributes: {}) @with_handle = with_handle @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/view_components/ui/resizable_handle_component.rb', line 23 def call attrs = handle_html_attributes attrs[:data] = attrs[:data].merge(@attributes.fetch(:data, {})) content_tag :div, **attrs.merge(@attributes.except(:data)) do if @with_handle content_tag :div, class: grip_container_classes do helpers.lucide_icon("grip-vertical", class: "h-2.5 w-2.5") end end end end |