Sha256: f290a9523216b8d461eff54dce58a529d9afb3b716ca52010e03a65eb60ea30b

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require_relative '../../components/govuk/field/input/character_count'

module CCS
  module FrontendHelpers
    module GovUKFrontend
      # = GOV.UK Character count
      #
      # This helper is used for generating the character count component from the
      # {https://design-system.service.gov.uk/components/character-count GDS - Components - Character count}

      module CharacterCount
        # Generates the HTML for the GOV.UK Character count component
        #
        # @param (see CCS::Components::GovUK::Input::CharacterCount#initialize)
        #
        # @option (see CCS::Components::GovUK::Input::CharacterCount#initialize)
        #
        # @return (see CCS::Components::GovUK::Input::CharacterCount#render)

        def govuk_character_count(attribute, character_count_options = {}, **options)
          Components::GovUK::Field::Input::CharacterCount.new(context: self, attribute: attribute, character_count_options: character_count_options, **options).render
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ccs-frontend_helpers-2.1.0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-2.0.0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-1.2.0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-1.1.2 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-1.1.1 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-1.1.0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-1.1.0.beta0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-1.0.0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.5.0.beta1 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.5.0.beta0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.3.0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb
ccs-frontend_helpers-0.2.0 lib/ccs/frontend_helpers/govuk_frontend/character_count.rb