Class: UI::ScrollAreaCorner
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::ScrollAreaCorner
- Includes:
- ScrollAreaCornerBehavior, SharedAsChildBehavior
- Defined in:
- app/components/ui/scroll_area_corner.rb
Overview
Corner - Phlex implementation
Intersection element between vertical and horizontal scrollbars.
Instance Method Summary collapse
-
#initialize(as_child: false, classes: "", **attributes) ⇒ ScrollAreaCorner
constructor
A new instance of ScrollAreaCorner.
- #view_template(&block) ⇒ Object
Methods included from SharedAsChildBehavior
Methods included from ScrollAreaCornerBehavior
#scroll_area_corner_classes, #scroll_area_corner_html_attributes
Constructor Details
#initialize(as_child: false, classes: "", **attributes) ⇒ ScrollAreaCorner
Returns a new instance of ScrollAreaCorner.
16 17 18 19 20 |
# File 'app/components/ui/scroll_area_corner.rb', line 16 def initialize(as_child: false, classes: "", **attributes) @as_child = as_child @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/components/ui/scroll_area_corner.rb', line 22 def view_template(&block) corner_attrs = scroll_area_corner_html_attributes.deep_merge(@attributes) if @as_child && block_given? # asChild mode: yield attributes to block yield(corner_attrs) else # Default mode: render as empty div div(**corner_attrs) end end |