Class: UiComponents::DaisyUi::Action::Modal::DialogComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/ui_components/daisy_ui/action/modal/dialog_component.rb

Constant Summary collapse

CSS_CLASSES_DEFAULT =
%w[modal].freeze
CSS_CLASSES =
(
  %w[modal-backdrop] +
  CSS_CLASSES_DEFAULT +
  Dialog::BoxComponent::CSS_CLASSES
).freeze

Constants inherited from BaseComponent

BaseComponent::ALIGNS, BaseComponent::AXES, BaseComponent::COLORS, BaseComponent::CSS_CLASSES_VARIANTS, BaseComponent::KINDS, BaseComponent::SIZES

Instance Method Summary collapse

Constructor Details

#initialize(backdrop: false, opener:, **args) ⇒ DialogComponent

Returns a new instance of DialogComponent.



28
29
30
31
32
33
34
35
36
37
# File 'app/components/ui_components/daisy_ui/action/modal/dialog_component.rb', line 28

def initialize(
    backdrop: false,
    opener:,
    **args
  )
  @backdrop = backdrop
  @opener = opener

  super(**args)
end

Instance Method Details

#set_optionsObject



39
40
41
42
43
44
# File 'app/components/ui_components/daisy_ui/action/modal/dialog_component.rb', line 39

def set_options
  @options.merge!(class: class_string)
  @options.merge!(style: @css_style) if @css_style.present?
  @options.merge!(id: @opener)
  @options.compact_blank!
end