Class: Anchor::DialogComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/anchor/dialog_component.rb

Constant Summary collapse

POSITION_DEFAULT =
:center
POSITION_OPTIONS =
[POSITION_DEFAULT, :right].freeze

Constants included from ViewHelper

ViewHelper::ANCHOR_HELPERS

Instance Method Summary collapse

Methods inherited from Component

generate_id

Methods included from ViewHelper

#anchor_form_with, #anchor_svg, #deep_blank?, #merge_options, #popover_trigger_attributes

Methods included from FetchOrFallbackHelper

#fetch_or_fallback

Constructor Details

#initialize(id:, title:, position: POSITION_DEFAULT, **kwargs) ⇒ DialogComponent

Returns a new instance of DialogComponent.



20
21
22
23
24
25
26
27
28
# File 'app/components/anchor/dialog_component.rb', line 20

def initialize(id:, title:, position: POSITION_DEFAULT, **kwargs)
  @id = id
  @title = title
  @position = fetch_or_fallback(
    POSITION_OPTIONS, position, POSITION_DEFAULT
  )

  super(id:, **kwargs)
end