Class: UI::DrawerContent

Inherits:
Phlex::HTML
  • Object
show all
Includes:
DrawerContentBehavior
Defined in:
app/components/ui/drawer_content.rb

Instance Method Summary collapse

Methods included from DrawerContentBehavior

#drawer_content_base_classes, #drawer_content_classes, #drawer_content_data_attributes, #drawer_content_html_attributes, #merged_drawer_content_data_attributes

Constructor Details

#initialize(open: false, direction: "bottom", classes: nil, **attributes) ⇒ DrawerContent

Returns a new instance of DrawerContent.



6
7
8
9
10
11
# File 'app/components/ui/drawer_content.rb', line 6

def initialize(open: false, direction: "bottom", classes: nil, **attributes)
  @open = open
  @direction = direction
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



13
14
15
16
17
18
# File 'app/components/ui/drawer_content.rb', line 13

def view_template(&block)
  # Add group class for handle visibility based on direction
  div(class: "group/drawer-content", **drawer_content_html_attributes) do
    yield if block_given?
  end
end