Sha256: 390447cc041a53a97745d793e3233c13bd4458e51387e66317ff64a8ade5c7eb

Contents?: true

Size: 857 Bytes

Versions: 1

Compression:

Stored size: 857 Bytes

Contents

<%
  options ||= []
  id ||= false
  label ||= false
  full_width ||= false
  name ||= id
  heading_size = false unless ['s', 'm', 'l', 'xl'].include?(heading_size)

  label_classes = %w(govuk-label)
  label_classes << "govuk-label--#{heading_size}" if heading_size

  select_helper = GovukPublishingComponents::Presenters::SelectHelper.new(options)
  data_module = "data-module=track-select-change" unless select_helper.data_tracking?.eql?(false)
%>
<% if options.any? && id && label %>
  <div class="govuk-form-group gem-c-select">
    <%= label_tag(id, label, class: label_classes) %>
    <select class="govuk-select <%= 'gem-c-select__select--full-width' if full_width %>" id="<%= id %>" name="<%= name %>" <%= data_module %> >
      <%= options_for_select(select_helper.option_markup, select_helper.selected_option) %>
    </select>
  </div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govuk_publishing_components-21.2.0 app/views/govuk_publishing_components/components/_select.html.erb