Sha256: e553bb672667df76918ab66b21d0d2ab3c4e67d1171bea72e9525db0b0139e38

Contents?: true

Size: 580 Bytes

Versions: 2

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

module Yattho
  module Forms
    # :nodoc:
    class FormControl < BaseComponent
      delegate :builder, :form, to: :@input

      def initialize(input:)
        @input = input
        @input.add_label_classes("FormControl-label")
        @form_group_arguments = {
          class: class_names(
            "FormControl",
            "flex-1",
            "width-full",
            "FormControl--fullWidth" => @input.full_width?
          )
        }

        @form_group_arguments[:hidden] = "hidden" if @input.hidden?
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yattho_view_components-0.1.1 lib/yattho/forms/form_control.rb
yattho_view_components-0.0.1 lib/yattho/forms/form_control.rb