Class: StimulusPlumbers::Components::Popover::Panel

Inherits:
Plumber::Base
  • Object
show all
Defined in:
lib/stimulus_plumbers/components/popover/panel.rb

Instance Attribute Summary

Attributes inherited from Plumber::Base

#template

Instance Method Summary collapse

Methods inherited from Plumber::Base

#initialize, #theme

Methods included from Plumber::Renderer

#set_slots, #slot_block_for, #slot_kwargs_for, #slot_renderable?

Methods included from Plumber::Options::Aria

#labelled_aria

Methods included from Plumber::Options::Html

#merge_html_options

Constructor Details

This class inherits a constructor from StimulusPlumbers::Plumber::Base

Instance Method Details

#build(panel_id:, **kwargs, &block) ⇒ Object



15
16
17
# File 'lib/stimulus_plumbers/components/popover/panel.rb', line 15

def build(panel_id:, **kwargs, &block)
  template.capture(panel_attrs(panel_id, **kwargs), &block)
end

#render(panel_id:, tag: :div, **kwargs, &block) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/stimulus_plumbers/components/popover/panel.rb', line 7

def render(panel_id:, tag: :div, **kwargs, &block)
  template.(
    tag,
    block_given? ? template.capture(panel_id, &block) : nil,
    **panel_attrs(panel_id, **kwargs)
  )
end