Class: PhlexKit::PopoverTrigger

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/popover/popover_trigger.rb

Overview

Wrapper the panel anchors to. Carries no actions: the controller wires the button inside it to the panel via popoverTargetElement, so the browser owns toggling (mouse + keyboard). See popover.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ PopoverTrigger

Returns a new instance of PopoverTrigger.



6
# File 'app/components/phlex_kit/popover/popover_trigger.rb', line 6

def initialize(**attrs) = (@attrs = attrs)

Instance Method Details

#view_templateObject



7
8
9
# File 'app/components/phlex_kit/popover/popover_trigger.rb', line 7

def view_template(&)
  div(**mix({ class: "pk-popover-trigger", data: { phlex_kit__popover_target: "trigger" } }, @attrs), &)
end