Sha256: c6c20f3f24f211cd90c77f93cfd90f08f4c10d080b5761de459acfbea79a02c4
Contents?: true
Size: 993 Bytes
Versions: 7
Compression:
Stored size: 993 Bytes
Contents
# frozen_string_literal: true module Primer module Forms # :nodoc: class TextField < BaseComponent delegate :builder, :form, to: :@input def initialize(input:) @input = input @field_wrap_arguments = { class: class_names( "FormControl-input-wrap", Primer::Forms::Dsl::Input::SIZE_MAPPINGS[@input.size], "FormControl-input-wrap--trailingAction": @input.show_clear_button?, "FormControl-input-wrap--leadingVisual": @input.leading_visual? ), hidden: @input.hidden? } end def auto_check_authenticity_token return @auto_check_authenticity_token if defined?(@auto_check_authenticity_token) @auto_check_authenticity_token = if @input.auto_check_src @view_context.form_authenticity_token( form_options: { method: :post, action: @input.auto_check_src } ) end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems