Class: StimulusPlumbers::Components::Popover
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Popover
- Defined in:
- lib/stimulus_plumbers/components/popover.rb,
lib/stimulus_plumbers/components/popover/builder.rb
Defined Under Namespace
Classes: Builder
Constant Summary
Constants included from Plumber::HtmlOptions
Plumber::HtmlOptions::STIMULUS_SPACEJOIN_KEYS
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
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
#render(interactive: true, **kwargs, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/stimulus_plumbers/components/popover.rb', line 6 def render(interactive: true, **kwargs, &block) = ( { classes: theme.resolve(:popover).fetch(:classes, "") }, kwargs ) builder = Popover::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 |