Class: StimulusPlumbers::Components::ActionList
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::ActionList
- Defined in:
- lib/stimulus_plumbers/components/action_list.rb,
lib/stimulus_plumbers/components/action_list/item.rb,
lib/stimulus_plumbers/components/action_list/section.rb
Defined Under Namespace
Constant Summary
Constants included from Plumber::HtmlOptions
Plumber::HtmlOptions::STIMULUS_SPACEJOIN_KEYS
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
- #item(content = nil, **kwargs, &block) ⇒ Object
- #render(**kwargs, &block) ⇒ Object
- #section(title: nil, **kwargs, &block) ⇒ Object
Methods inherited from Plumber::Base
Methods included from Plumber::HtmlOptions
#merge_data_options, #merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Plumber::Base
Instance Method Details
#item(content = nil, **kwargs, &block) ⇒ Object
18 19 20 |
# File 'lib/stimulus_plumbers/components/action_list.rb', line 18 def item(content = nil, **kwargs, &block) ActionList::Item.new(template).render(content, **kwargs, &block) end |
#render(**kwargs, &block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/stimulus_plumbers/components/action_list.rb', line 6 def render(**kwargs, &block) = ( { classes: theme.resolve(:action_list).fetch(:classes, "") }, kwargs ) template.content_tag(:div, template.capture(&block), **) end |
#section(title: nil, **kwargs, &block) ⇒ Object
14 15 16 |
# File 'lib/stimulus_plumbers/components/action_list.rb', line 14 def section(title: nil, **kwargs, &block) ActionList::Section.new(template).render(title: title, **kwargs, &block) end |