Class: UI::ContextMenuRadioItem
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::ContextMenuRadioItem
- Includes:
- ContextMenuRadioItemBehavior
- Defined in:
- app/components/ui/context_menu_radio_item.rb
Overview
RadioItem - Phlex implementation
A menu item with radio button functionality. Uses ContextMenuRadioItemBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(checked: false, classes: "", **attributes) ⇒ ContextMenuRadioItem
constructor
A new instance of ContextMenuRadioItem.
- #view_template(&block) ⇒ Object
Methods included from ContextMenuRadioItemBehavior
#context_menu_radio_item_classes, #context_menu_radio_item_data_attributes, #context_menu_radio_item_html_attributes
Constructor Details
#initialize(checked: false, classes: "", **attributes) ⇒ ContextMenuRadioItem
Returns a new instance of ContextMenuRadioItem.
16 17 18 19 20 |
# File 'app/components/ui/context_menu_radio_item.rb', line 16 def initialize(checked: false, classes: "", **attributes) @checked = checked @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'app/components/ui/context_menu_radio_item.rb', line 22 def view_template(&block) div(**.deep_merge(@attributes)) do span(class: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center") do if @checked render_circle_icon end end yield if block_given? end end |