Class: StimulusPlumbers::Components::Popover::Trigger
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Popover::Trigger
- Defined in:
- lib/stimulus_plumbers/components/popover/trigger.rb
Constant Summary collapse
- STIMULUS_ACTION =
[ "click->#{STIMULUS_CONTROLLER}#toggle", "keydown.esc->#{STIMULUS_CONTROLLER}#close" ].join(" ").freeze
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(panel_id:, haspopup: "dialog", **kwargs, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/stimulus_plumbers/components/popover/trigger.rb', line 12 def render(panel_id:, haspopup: "dialog", **kwargs, &block) = ( theme.resolve(:popover_trigger), { type: "button", aria: { haspopup: haspopup, expanded: "false", controls: panel_id }, data: { popover_target: "trigger", action: STIMULUS_ACTION } }, kwargs ) template.content_tag(:button, block_given? ? template.capture(&block) : nil, **) end |