Sha256: 16661e8b06131a3087814a3b46037819d478155dfb576917baa3e030775ee3e8

Contents?: true

Size: 643 Bytes

Versions: 48

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

class Avo::Fields::EditComponent < ViewComponent::Base
  include Avo::ResourcesHelper

  attr_reader :field
  attr_reader :view

  def initialize(field: nil, resource: nil, index: 0, form: nil, displayed_in_modal: false)
    @field = field
    @resource = resource
    @index = index
    @form = form
    @displayed_in_modal = displayed_in_modal
    @view = :edit
  end

  def classes(extra_classes = "")
    helpers.input_classes("#{@field.get_html(:classes, view: view, element: :input)} #{extra_classes}", has_error: @field.model_errors.include?(@field.id))
  end

  def render?
    !field.computed
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
avo-2.16.0 app/components/avo/fields/edit_component.rb
avo-2.15.3 app/components/avo/fields/edit_component.rb
avo-2.15.3.pre.1.data.attrs.to.sidebar.items app/components/avo/fields/edit_component.rb
avo-2.15.2 app/components/avo/fields/edit_component.rb
avo-2.15.2.pre.1 app/components/avo/fields/edit_component.rb
avo-2.15.1 app/components/avo/fields/edit_component.rb
avo-2.15.0 app/components/avo/fields/edit_component.rb
avo-2.14.3.pre.7.polytranslations1 app/components/avo/fields/edit_component.rb
avo-2.14.3.pre.6.nosprockets app/components/avo/fields/edit_component.rb
avo-2.14.3.pre.5.nosprockets app/components/avo/fields/edit_component.rb
avo-2.14.3.pre.4.tosqlfix app/components/avo/fields/edit_component.rb
avo-2.14.3.pre.3.jsbundling app/components/avo/fields/edit_component.rb
avo-2.14.3.pre.2.tailwindcss app/components/avo/fields/edit_component.rb
avo-2.14.3.pre.1.branding app/components/avo/fields/edit_component.rb
avo-2.14.2 app/components/avo/fields/edit_component.rb
avo-2.14.2.pre.1 app/components/avo/fields/edit_component.rb
avo-2.14.1 app/components/avo/fields/edit_component.rb
avo-2.14.1.pre.1 app/components/avo/fields/edit_component.rb
avo-2.14.0 app/components/avo/fields/edit_component.rb
avo-2.13.6.pre.2 app/components/avo/fields/edit_component.rb