Module: UI::PopoverTriggerBehavior

Included in:
PopoverTrigger, PopoverTriggerComponent
Defined in:
app/helpers/ui/popover_trigger_behavior.rb,
app/behaviors/ui/popover_trigger_behavior.rb

Overview

PopoverTriggerBehavior

Shared behavior for PopoverTrigger component across ERB, ViewComponent, and Phlex implementations. This module provides consistent styling and HTML attribute generation.

Instance Method Summary collapse

Instance Method Details

#popover_trigger_classesObject

Returns combined CSS classes for the popover trigger



18
19
20
21
22
23
24
25
# File 'app/helpers/ui/popover_trigger_behavior.rb', line 18

def popover_trigger_classes
  classes_value = respond_to?(:classes, true) ? classes : @classes
  TailwindMerge::Merger.new.merge([
    popover_trigger_base_classes,
    classes_value

  ].compact.join(" "))
end

#popover_trigger_html_attributesObject

Returns HTML attributes for the popover trigger element



9
10
11
12
13
14
15
# File 'app/helpers/ui/popover_trigger_behavior.rb', line 9

def popover_trigger_html_attributes
  attributes_value = respond_to?(:attributes, true) ? attributes : @attributes
  {
    class: popover_trigger_classes,
    data: {ui__popover_target: "trigger"}
  }.merge(attributes_value)
end