Sha256: 5fec91f6345cf8996f638f0daf05103e75b6ab44c9874cbd947e6e4cc162e02b

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

<%= render(FormControl.new(input: @input, tag: :"primer-text-field")) do %>
  <%= content_tag(:div, **@field_wrap_arguments) do %>
    <%# leading spinner implies a leading visual %>
    <% if @input.leading_visual || @input.leading_spinner? %>
      <span class="FormControl-input-leadingVisualWrap">
        <%= render(Primer::Beta::Octicon.new(**@input.leading_visual, data: { target: "primer-text-field.leadingVisual" })) %>
        <% if @input.leading_spinner? %>
          <%= render(Primer::Beta::Spinner.new(size: :small, hidden: true, data: { target: "primer-text-field.leadingSpinner" })) %>
        <% end %>
      </span>
    <% end %>
    <%= render Primer::ConditionalWrapper.new(condition: @input.auto_check_src, tag: "auto-check", csrf: auto_check_authenticity_token, src: @input.auto_check_src) do %>
      <%= builder.text_field(@input.name, **@input.input_arguments) %>
    <% end %>
    <% if @input.show_clear_button? %>
      <button type="button" id="<%= @input.clear_button_id %>" class="FormControl-input-trailingAction" aria-label="Clear" data-action="click:primer-text-field#clearContents">
        <%= render(Primer::Beta::Octicon.new(icon: :"x-circle-fill")) %>
      </button>
    <% end %>
    <% if @input.trailing_visual %>
      <div class="FormControl-input-trailingVisualWrap">
        <%= render(trailing_visual_component) %>
      </div>
    <% end %>
  <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
primer_view_components-0.36.5 app/lib/primer/forms/text_field.html.erb
openproject-primer_view_components-0.52.2 app/lib/primer/forms/text_field.html.erb
primer_view_components-0.36.4 app/lib/primer/forms/text_field.html.erb