Sha256: e775c287548f977435c12e7635eca064de78c333b406d69e3a45f6e7d2e9619a
Contents?: true
Size: 1.14 KB
Versions: 32
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true class Avo::Fields::EditComponent < ViewComponent::Base include Avo::ResourcesHelper attr_reader :compact attr_reader :field attr_reader :form attr_reader :index attr_reader :kwargs attr_reader :multiple attr_reader :resource attr_reader :stacked attr_reader :view def initialize(field: nil, resource: nil, index: 0, form: nil, compact: false, stacked: nil, multiple: false, **kwargs) @compact = compact @field = field @form = form @index = index @kwargs = kwargs @multiple = multiple @resource = resource @stacked = stacked @view = Avo::ViewInquirer.new("edit") end def classes(extra_classes = "") helpers.input_classes("#{@field.get_html(:classes, view: view, element: :input)} #{extra_classes}", has_error: @field.record_errors.include?(@field.id)) end def render? !field.computed end def field_wrapper_args { compact: compact, field: field, form: form, index: index, resource: resource, stacked: stacked, view: view } end def disabled? field.is_readonly? || field.is_disabled? end end
Version data entries
32 entries across 32 versions & 1 rubygems