Class: StimulusPlumbers::Components::Checklist::Item
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Checklist::Item
- Defined in:
- lib/stimulus_plumbers/components/checklist/item.rb,
lib/stimulus_plumbers/components/checklist/item/slots.rb
Defined Under Namespace
Classes: Slots
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::Renderer
#set_slots, #slot_block_for, #slot_kwargs_for, #slot_renderable?
Methods included from Plumber::Options::Aria
Methods included from Plumber::Options::Html
Constructor Details
This class inherits a constructor from StimulusPlumbers::Plumber::Base
Instance Method Details
#render(content = nil, checked: nil, readonly: false, **html_options, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/stimulus_plumbers/components/checklist/item.rb', line 7 def render(content = nil, checked: nil, readonly: false, **, &block) raise ArgumentError, "checked: is required" if checked.nil? slots = build_slots(content, &block) template.content_tag(:label, **(theme.resolve(:checklist_item), )) do template.safe_join([render_input(checked, readonly), render_content_slot(slots)].compact) end end |