Class: TurboOverlay::PopoverConfig

Inherits:
OverlayTypeConfig show all
Defined in:
lib/turbo_overlay/configuration.rb

Overview

Popover config extends OverlayTypeConfig with anchored-positioning defaults. Popovers attach to their trigger element rather than centering (modal) or pinning to an edge (drawer).

  • position: side of the trigger to attach to (:top, :bottom, :left, :right). Default :bottom.
  • align: cross-axis alignment relative to the trigger (:start, :center, :end). Default :start.
  • offset: pixels between trigger edge and dialog edge. Default 4.
  • auto_flip: flip to the opposite side when the preferred placement would overflow the viewport. Default true.

Instance Attribute Summary collapse

Attributes inherited from OverlayTypeConfig

#variant

Instance Method Summary collapse

Constructor Details

#initialize(position:, align:, offset:, auto_flip:, **kwargs) ⇒ PopoverConfig

Returns a new instance of PopoverConfig.



89
90
91
92
93
94
95
# File 'lib/turbo_overlay/configuration.rb', line 89

def initialize(position:, align:, offset:, auto_flip:, **kwargs)
  super(**kwargs)
  @position  = position
  @align     = align
  @offset    = offset
  @auto_flip = auto_flip
end

Instance Attribute Details

#alignObject

Returns the value of attribute align.



87
88
89
# File 'lib/turbo_overlay/configuration.rb', line 87

def align
  @align
end

#auto_flipObject

Returns the value of attribute auto_flip.



87
88
89
# File 'lib/turbo_overlay/configuration.rb', line 87

def auto_flip
  @auto_flip
end

#offsetObject

Returns the value of attribute offset.



87
88
89
# File 'lib/turbo_overlay/configuration.rb', line 87

def offset
  @offset
end

#positionObject

Returns the value of attribute position.



87
88
89
# File 'lib/turbo_overlay/configuration.rb', line 87

def position
  @position
end