Class: UI::SliderThumb
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::SliderThumb
- Includes:
- SliderThumbBehavior
- Defined in:
- app/components/ui/slider_thumb.rb
Overview
SliderThumb - Phlex implementation
The thumb is the draggable handle that controls the slider value. Uses SliderThumbBehavior module for shared logic.
Instance Method Summary collapse
-
#initialize(disabled: false, classes: "", attributes: {}) ⇒ SliderThumb
constructor
A new instance of SliderThumb.
- #view_template ⇒ Object
Methods included from SliderThumbBehavior
Constructor Details
#initialize(disabled: false, classes: "", attributes: {}) ⇒ SliderThumb
Returns a new instance of SliderThumb.
30 31 32 33 34 |
# File 'app/components/ui/slider_thumb.rb', line 30 def initialize(disabled: false, classes: "", attributes: {}) @disabled = disabled @classes = classes @attributes = attributes end |
Instance Method Details
#view_template ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/components/ui/slider_thumb.rb', line 36 def view_template all_attributes = # Merge data attributes all_attributes[:data] = all_attributes[:data].merge(@attributes.fetch(:data, {})) # Merge with user attributes (except data which we already handled) all_attributes = all_attributes.merge(@attributes.except(:data)) div(**all_attributes) end |