Class: UI::Drawer

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

Instance Method Summary collapse

Methods included from DrawerBehavior

#drawer_base_classes, #drawer_classes, #drawer_data_attributes, #drawer_html_attributes, #merged_drawer_data_attributes

Constructor Details

#initialize(open: false, direction: "bottom", dismissible: true, modal: true, snap_points: nil, active_snap_point: nil, fade_from_index: nil, snap_to_sequential_point: false, handle_only: false, reposition_inputs: true, classes: nil, **attributes) ⇒ Drawer

Returns a new instance of Drawer.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/components/ui/drawer.rb', line 6

def initialize(
  open: false,
  direction: "bottom",
  dismissible: true,
  modal: true,
  snap_points: nil,
  active_snap_point: nil,
  fade_from_index: nil,
  snap_to_sequential_point: false,
  handle_only: false,
  reposition_inputs: true,
  classes: nil,
  **attributes
)
  @open = open
  @direction = direction
  @dismissible = dismissible
  @modal = modal
  @snap_points = snap_points
  @active_snap_point = active_snap_point
  @fade_from_index = fade_from_index
  @snap_to_sequential_point = snap_to_sequential_point
  @handle_only = handle_only
  @reposition_inputs = reposition_inputs
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



34
35
36
37
38
# File 'app/components/ui/drawer.rb', line 34

def view_template(&block)
  div(**drawer_html_attributes) do
    yield if block_given?
  end
end