Sha256: deca2f5f64656b28dfb43df3ebcad29e2d7c276e225542219e36fa685864a616

Contents?: true

Size: 1.32 KB

Versions: 72

Compression:

Stored size: 1.32 KB

Contents

<%
  add_gem_component_stylesheet("show-password")

  disable_form_submit_check ||= false
  label ||= nil
  value ||= nil
  id ||= nil
  name ||= nil
  autocomplete = "off" unless ['new-password', 'current-password'].include?(autocomplete)
  describedby ||= nil
  hint ||= nil
  error_message ||= nil
  error_items ||= nil
  data ||= nil

  if !label
    raise ArgumentError, "This component requires a label"
  end
%>
<% if label %>
  <%= tag.div class: "gem-c-show-password",
    data: {
      module: "show-password",
      disable_form_submit_check: disable_form_submit_check,
      show_text: t('components.show_password.show'),
      hide_text: t('components.show_password.hide'),
      show_full_text: t('components.show_password.show_password'),
      hide_full_text: t('components.show_password.hide_password'),
      announce_show: t('components.show_password.announce_show'),
      announce_hide: t('components.show_password.announce_hide')
    } do %>
      <%= render "govuk_publishing_components/components/input", {
        label: label,
        value: value,
        id: id,
        name: name,
        describedby: describedby,
        hint: hint,
        error_message: error_message,
        error_items: error_items,
        type: "password",
        autocomplete: autocomplete,
        data: data,
      } %>
  <% end %>
<% end %>

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
govuk_publishing_components-37.10.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.9.1 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.9.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.8.1 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.8.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.7.1 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.7.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.6.1 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.6.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.5.1 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.5.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.4.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.3.1 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.3.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.2.4 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.2.3 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.2.2 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.2.1 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.2.0 app/views/govuk_publishing_components/components/_show_password.html.erb
govuk_publishing_components-37.1.1 app/views/govuk_publishing_components/components/_show_password.html.erb