govuk_design_system_formbuilder 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef71979d3dc464b8b7bb35004494a1f9bae9af7ac392bc9267acab8c38373964
4
- data.tar.gz: fec2b0c0cc99f2ebcfb20c38c03db5f13a8b70e3f6d26e5c21b7b86735598541
3
+ metadata.gz: 849a616e7c297a30b940baee74c033d8ee809d80397d1a09bca32993058a7127
4
+ data.tar.gz: b154ec1a5517573f061eb294bbd0b7bb2e1ccaacee2868dc2efe8bea4a26d55d
5
5
  SHA512:
6
- metadata.gz: d7e0b380e26ee9b408adc81ff58cf655d3c8e4d133dcf30414da2f0c17dc69b26bdfcd452aee69a2f9f9efb9295c44bb2f77e903e6e830c9adae6781e054b656
7
- data.tar.gz: f3ada2fd3c9489b74c608b1f647a92e1e6438e84cb6c14dd4086c69ae62e227e230ee8033c6e732da11bab9be46bcc8a9b0e96b86a01e2b76a9c967f0be4e154
6
+ metadata.gz: a54832be5fe555c971756f3d80c4439b2a18c7a55642d4f11433c4a9174eb8bed2aaa313be6721a6174b996bfbd60333c6e677481e8b443c9ac0c5436618749b
7
+ data.tar.gz: 1a49c45ed2ec43cc1eca56eb52adc0bae7a4543813516de3005b12fa79974bc4863b8f9218bc64f83a190f9b46dad2738c2986bc5b6e2311f2314a49a4628933
@@ -53,7 +53,14 @@ module GOVUKDesignSystemFormBuilder
53
53
  end
54
54
 
55
55
  def day
56
- return if omit_day?
56
+ if omit_day?
57
+ return tag.input(
58
+ id: id(:day, false),
59
+ name: name(:day),
60
+ type: 'hidden',
61
+ value: value(:day) || 1,
62
+ )
63
+ end
57
64
 
58
65
  date_part(:day, width: 2, link_errors: true)
59
66
  end
@@ -21,11 +21,7 @@ module GOVUKDesignSystemFormBuilder
21
21
  @classes = classes
22
22
  @form_group = form_group
23
23
  @include_hidden = include_hidden
24
- @bold_labels = if bold_labels.nil?
25
- hint_method.present?
26
- else
27
- bold_labels
28
- end
24
+ @bold_labels = (bold_labels.nil? && auto_bold_labels?) || bold_labels
29
25
  end
30
26
 
31
27
  def html
@@ -38,6 +34,11 @@ module GOVUKDesignSystemFormBuilder
38
34
 
39
35
  private
40
36
 
37
+ def auto_bold_labels?
38
+ (config.default_collection_radio_buttons_auto_bold_labels &&
39
+ @hint_method.present?)
40
+ end
41
+
41
42
  def fieldset_options
42
43
  {
43
44
  legend: @legend,
@@ -1,3 +1,3 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.1.1'.freeze
3
3
  end
@@ -43,6 +43,11 @@ module GOVUKDesignSystemFormBuilder
43
43
  # * +:default_collection_radio_buttons_include_hidden+ controls whether or not
44
44
  # a hidden field is added when rendering a collection of radio buttons
45
45
  #
46
+ # * +:default_collection_radio_buttons_auto_bold_labels+ will automatically
47
+ # make labels on {#govuk_collection_radio_buttons} bold when a +:hint_method+
48
+ # is present. The default can be overridden using the +bold_labels:+ argument.
49
+ # The default value is 'true'.
50
+ #
46
51
  # * +:default_error_summary_title+ sets the text used in error summary
47
52
  # blocks. As per the GOV.UK Design System spec, it defaults to
48
53
  # 'There is a problem'.
@@ -91,6 +96,7 @@ module GOVUKDesignSystemFormBuilder
91
96
  default_error_summary_turbo_prefix: 'turbo',
92
97
  default_collection_check_boxes_include_hidden: true,
93
98
  default_collection_radio_buttons_include_hidden: true,
99
+ default_collection_radio_buttons_auto_bold_labels: true,
94
100
  default_submit_validate: false,
95
101
 
96
102
  localisation_schema_fallback: %i(helpers __context__),
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.1.0
4
+ version: 3.1.1
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-06-27 00:00:00.000000000 Z
11
+ date: 2022-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-attributes-utils
@@ -140,14 +140,14 @@ dependencies:
140
140
  requirements:
141
141
  - - "~>"
142
142
  - !ruby/object:Gem::Version
143
- version: 4.4.0
143
+ version: 4.5.0
144
144
  type: :development
145
145
  prerelease: false
146
146
  version_requirements: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: 4.4.0
150
+ version: 4.5.0
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: simplecov
153
153
  requirement: !ruby/object:Gem::Requirement
@@ -296,7 +296,6 @@ executables: []
296
296
  extensions: []
297
297
  extra_rdoc_files: []
298
298
  files:
299
- - LICENSE
300
299
  - README.md
301
300
  - lib/govuk_design_system_formbuilder.rb
302
301
  - lib/govuk_design_system_formbuilder/base.rb
data/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License
2
-
3
- Copyright (C) 2019 Crown Copyright (Government Digital Service)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
- of the Software, and to permit persons to whom the Software is furnished to do
10
- so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.