Module: UI::DrawerTriggerBehavior

Included in:
DrawerTrigger, DrawerTriggerComponent
Defined in:
app/behaviors/ui/drawer_trigger_behavior.rb

Overview

Shared behavior for Drawer Trigger component Opens drawer on click, supports asChild pattern

Instance Method Summary collapse

Instance Method Details

#drawer_trigger_data_attributesObject

Data attributes for trigger



7
8
9
# File 'app/behaviors/ui/drawer_trigger_behavior.rb', line 7

def drawer_trigger_data_attributes
  {action: "click->ui--drawer#open"}
end

#drawer_trigger_html_attributesObject

Build complete trigger attributes (for asChild pattern)



12
13
14
15
16
17
# File 'app/behaviors/ui/drawer_trigger_behavior.rb', line 12

def drawer_trigger_html_attributes
  {
    data: drawer_trigger_data_attributes,
    **@attributes
  }
end