Sha256: c06645e66a46e0c02722fec6a0efe9c59cdb38d59c52baec06c4033aafdce78d

Contents?: true

Size: 610 Bytes

Versions: 9

Compression:

Stored size: 610 Bytes

Contents

# frozen_string_literal: true

class Avo::Edit::FieldWrapperComponent < ViewComponent::Base
  def initialize(field: nil, dash_if_blank: true, full_width: false, displayed_in_modal: false, form: nil, resource: {}, **args)
    @field = field
    @dash_if_blank = dash_if_blank
    @classes = args[:class].present? ? args[:class] : ''
    @args = args
    @displayed_in_modal = displayed_in_modal
    @form = form
    @resource = resource
    @model = resource.present? ? resource.model : nil
    @full_width = full_width

    if @index != 0 or @displayed_in_modal
      @classes += ' border-t'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
avo-0.5.0.beta9 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta8 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta7 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta6 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta5 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta4 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta3 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta2 app/components/avo/edit/field_wrapper_component.rb
avo-0.5.0.beta1 app/components/avo/edit/field_wrapper_component.rb