Class: StimulusPlumbers::Components::Popover::Renderer
- Inherits:
-
StimulusPlumbers::Components::Plumber::Base
- Object
- StimulusPlumbers::Components::Plumber::Base
- StimulusPlumbers::Components::Popover::Renderer
- Defined in:
- lib/stimulus_plumbers/components/popover/renderer.rb
Instance Attribute Summary
Attributes inherited from StimulusPlumbers::Components::Plumber::Base
Instance Method Summary collapse
Methods inherited from StimulusPlumbers::Components::Plumber::Base
Methods included from StimulusPlumbers::Components::Plumber::HtmlOptions
#merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Components::Plumber::Base
Instance Method Details
#popover(interactive: true, **kwargs, &block) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/stimulus_plumbers/components/popover/renderer.rb', line 25 def popover(interactive: true, **kwargs, &block) = ( { classes: theme.resolve(:popover).fetch(:classes, "") }, kwargs ) builder = Builder.new(template) template.capture(builder, &block) template.content_tag(:div, **) do wrapped_content = if interactive template.content_tag(:template, builder.content_html) else builder.content_html end template.safe_join([builder.activator_html, wrapped_content]) end end |