govuk_design_system_formbuilder 3.0.3b1 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8688a1ed5a9271f5618ba56617a4eab9aa1c341514b6d956558adc314282a2a
4
- data.tar.gz: 29e1c726ef83a28da2bda26a917590ee672e4fb85cb1c3a9a89000636c2fef09
3
+ metadata.gz: 7ff442cbd7ee104a7438e56fdb7b3730b3e2d7ee671d6ad324f338b5dcad5f68
4
+ data.tar.gz: 94a9bfbef680abadc21a5f3109265051e77d74f9b0ee8ac3dc850912160cae1b
5
5
  SHA512:
6
- metadata.gz: fa735d3a296e2dd9f3b12cdb689fd659a9696f8cd33f866502cb48ddc63bba05013d4e87e6c688dacf25cc2de63b554fa6da6acf65bf9887c7e660265d21cc9c
7
- data.tar.gz: 8273c13b2e36dba076b2120ee5ddd66c25c62153f9aabcc7e041d5eca9e93c4eadde7cfffedf88ebbabb8a7a509551ef0d7f5a3425c002d8afb02e245fb222d2
6
+ metadata.gz: b0a1fa2e14207c3210a2c42a00e78b59548cf60c6e443a93d4908973ddee95d7c0e66c988b3475a36ccaf521c846cebed8332e94839d256e3c5070032b43aac9
7
+ data.tar.gz: 415811c062dcb4965964e6cbbbb5412f57e4d14baba0d4b277b39294f632aad8642573b9f0f1298a6721c9ddb450b28230ff1778d8e68de3266b2ac585c49370
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![Gem](https://img.shields.io/gem/dt/govuk_design_system_formbuilder?logo=rubygems)](https://rubygems.org/gems/govuk_design_system_formbuilder)
7
7
  [![Test Coverage](https://api.codeclimate.com/v1/badges/110136fb22341d3ba646/test_coverage)](https://codeclimate.com/github/DFE-Digital/govuk-formbuilder/test_coverage)
8
8
  [![GitHub license](https://img.shields.io/github/license/DFE-Digital/govuk_design_system_formbuilder)](https://github.com/DFE-Digital/govuk-formbuilder/blob/main/LICENSE)
9
- [![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-4.0.1-brightgreen)](https://design-system.service.gov.uk)
9
+ [![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-4.1.0-brightgreen)](https://design-system.service.gov.uk)
10
10
  [![Rails](https://img.shields.io/badge/Rails-6.1.5%20%E2%95%B1%207.0.3-E16D6D)](https://weblog.rubyonrails.org/releases/)
11
11
  [![Ruby](https://img.shields.io/badge/Ruby-2.7.6%20%20%E2%95%B1%203.0.4%20%20%E2%95%B1%203.1.2-E16D6D)](https://www.ruby-lang.org/en/downloads/)
12
12
 
@@ -913,7 +913,6 @@ module GOVUKDesignSystemFormBuilder
913
913
  # @option caption kwargs [Hash] additional arguments are applied as attributes on the caption +span+ element
914
914
  # @param omit_day [Boolean] do not render a day input, only capture month and year
915
915
  # @param maxlength_enabled [Boolean] adds maxlength attribute to day, month and year inputs (2, 2, and 4, respectively)
916
- # @param wildcards [Boolean] add an 'X' to the day and month patterns so users can add approximate dates
917
916
  # @param form_group [Hash] configures the form group
918
917
  # @option form_group classes [Array,String] sets the form group's classes
919
918
  # @option form_group kwargs [Hash] additional attributes added to the form group
@@ -937,8 +936,8 @@ module GOVUKDesignSystemFormBuilder
937
936
  # @example A date input with legend supplied as a proc
938
937
  # = f.govuk_date_field :finishes_on,
939
938
  # legend: -> { tag.h3('Which category do you belong to?') }
940
- def govuk_date_field(attribute_name, hint: {}, legend: {}, caption: {}, date_of_birth: false, omit_day: false, maxlength_enabled: false, form_group: {}, wildcards: false, **kwargs, &block)
941
- Elements::Date.new(self, object_name, attribute_name, hint: hint, legend: legend, caption: caption, date_of_birth: date_of_birth, omit_day: omit_day, maxlength_enabled: maxlength_enabled, form_group: form_group, wildcards: wildcards, **kwargs, &block).html
939
+ def govuk_date_field(attribute_name, hint: {}, legend: {}, caption: {}, date_of_birth: false, omit_day: false, maxlength_enabled: false, form_group: {}, **kwargs, &block)
940
+ Elements::Date.new(self, object_name, attribute_name, hint: hint, legend: legend, caption: caption, date_of_birth: date_of_birth, omit_day: omit_day, maxlength_enabled: maxlength_enabled, form_group: form_group, **kwargs, &block).html
942
941
  end
943
942
 
944
943
  # Generates a summary of errors in the form, each linking to the corresponding
@@ -11,7 +11,7 @@ module GOVUKDesignSystemFormBuilder
11
11
  SEGMENTS = { day: '3i', month: '2i', year: '1i' }.freeze
12
12
  MULTIPARAMETER_KEY = { day: 3, month: 2, year: 1 }.freeze
13
13
 
14
- def initialize(builder, object_name, attribute_name, legend:, caption:, hint:, omit_day:, maxlength_enabled:, form_group:, wildcards:, date_of_birth: false, **kwargs, &block)
14
+ def initialize(builder, object_name, attribute_name, legend:, caption:, hint:, omit_day:, maxlength_enabled:, form_group:, date_of_birth: false, **kwargs, &block)
15
15
  super(builder, object_name, attribute_name, &block)
16
16
 
17
17
  @legend = legend
@@ -21,7 +21,6 @@ module GOVUKDesignSystemFormBuilder
21
21
  @omit_day = omit_day
22
22
  @maxlength_enabled = maxlength_enabled
23
23
  @form_group = form_group
24
- @wildcards = wildcards
25
24
  @html_attributes = kwargs
26
25
  end
27
26
 
@@ -107,7 +106,6 @@ module GOVUKDesignSystemFormBuilder
107
106
  class: classes(width),
108
107
  name: name(segment),
109
108
  type: 'text',
110
- pattern: pattern(segment),
111
109
  inputmode: 'numeric',
112
110
  value: value,
113
111
  autocomplete: date_of_birth_autocomplete_value(segment),
@@ -115,12 +113,6 @@ module GOVUKDesignSystemFormBuilder
115
113
  )
116
114
  end
117
115
 
118
- def pattern(segment)
119
- return '[0-9X]*' if @wildcards && segment.in?(%i(day month))
120
-
121
- '[0-9]*'
122
- end
123
-
124
116
  def classes(width)
125
117
  build_classes(
126
118
  %(input),
@@ -78,7 +78,7 @@ module GOVUKDesignSystemFormBuilder
78
78
  def limit_description
79
79
  return unless limit?
80
80
 
81
- tag.span(id: limit_id, class: limit_description_classes, aria: { live: 'polite' }) do
81
+ tag.span(id: limit_id, class: limit_description_classes) do
82
82
  "You can enter up to #{limit_quantity} #{limit_type}"
83
83
  end
84
84
  end
@@ -1,3 +1,3 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
- VERSION = '3.0.3b1'.freeze
2
+ VERSION = '3.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_design_system_formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3b1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Yates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-19 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-attributes-utils
@@ -134,14 +134,14 @@ dependencies:
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: 4.3.0
137
+ version: 4.4.0
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 4.3.0
144
+ version: 4.4.0
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: simplecov
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -368,9 +368,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
368
368
  version: '0'
369
369
  required_rubygems_version: !ruby/object:Gem::Requirement
370
370
  requirements:
371
- - - ">"
371
+ - - ">="
372
372
  - !ruby/object:Gem::Version
373
- version: 1.3.1
373
+ version: '0'
374
374
  requirements: []
375
375
  rubygems_version: 3.1.6
376
376
  signing_key: