Class: LightningUiKit::ModalComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/lightning_ui_kit/modal_component.rb

Instance Method Summary collapse

Methods inherited from BaseComponent

#merge_classes

Methods included from HeroiconHelper

#heroicon

Constructor Details

#initialize(id:, title:, description: nil, open: false, **options) ⇒ ModalComponent

Returns a new instance of ModalComponent.



5
6
7
8
9
10
11
# File 'app/components/lightning_ui_kit/modal_component.rb', line 5

def initialize(id:, title:, description: nil, open: false, **options)
  @id = id
  @title = title
  @description = description
  @open = open
  @options = options
end

Instance Method Details

#dataObject



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

def data
  {
    controller: "lui-modal",
    lui_modal_target: "dialog"
  }.merge(@options[:data] || {})
end