Class: Avo::Fields::Common::HeadingComponent

Inherits:
BaseComponent
  • Object
show all
Includes:
Concerns::HasResourceStimulusControllers
Defined in:
app/components/avo/fields/common/heading_component.rb

Instance Method Summary collapse

Methods included from Concerns::HasResourceStimulusControllers

#add_stimulus_attributes_for, #get_stimulus_controllers, #stimulus_data_attributes

Instance Method Details

#after_initializeObject



8
9
10
11
12
13
# File 'app/components/avo/fields/common/heading_component.rb', line 8

def after_initialize
  @view = @field.resource.view
  @classes = "flex items-start py-1 leading-tight bg-gray-100 text-gray-500 text-xs #{@field.get_html(:classes, view: @view, element: :wrapper)}"
  @data = stimulus_data_attributes
  add_stimulus_attributes_for(@field.resource, @data)
end