govuk_design_system_formbuilder 3.0.3 → 3.1.2

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: 7ff442cbd7ee104a7438e56fdb7b3730b3e2d7ee671d6ad324f338b5dcad5f68
4
- data.tar.gz: 94a9bfbef680abadc21a5f3109265051e77d74f9b0ee8ac3dc850912160cae1b
3
+ metadata.gz: a538f7ffa0545474cbf27c732593366f6db00bb2941301ea8b747fd82dcb1f53
4
+ data.tar.gz: 478a366c7d960553dd74095ac6ac63209883b75701dc2732e10c47106a52e169
5
5
  SHA512:
6
- metadata.gz: b0a1fa2e14207c3210a2c42a00e78b59548cf60c6e443a93d4908973ddee95d7c0e66c988b3475a36ccaf521c846cebed8332e94839d256e3c5070032b43aac9
7
- data.tar.gz: 415811c062dcb4965964e6cbbbb5412f57e4d14baba0d4b277b39294f632aad8642573b9f0f1298a6721c9ddb450b28230ff1778d8e68de3266b2ac585c49370
6
+ metadata.gz: 1eb3291b77100cdd0f55db025e20d623ced134e966498c66cc949ecc4ee70ca132de885959ffaefb67fcce0a19aac0d587c620ffaccdca6a886c73b28d585f7f
7
+ data.tar.gz: 98879a898f28df855ace670efe976749db0a3ab911f9090e096ffd73e803d9b6342e3a5d8a813c7927628e56af833d1ce3d430fe84ef4a53da79bbaf58010b67
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.1.0-brightgreen)](https://design-system.service.gov.uk)
9
+ [![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-4.3.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
 
@@ -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.0.3'.freeze
2
+ VERSION = '3.1.2'.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.0.3
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Yates
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-19 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-attributes-utils
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.9.0
19
+ version: '0.9'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.9.2
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: 0.9.0
29
+ version: '0.9'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.9.2
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: actionview
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -134,14 +140,14 @@ dependencies:
134
140
  requirements:
135
141
  - - "~>"
136
142
  - !ruby/object:Gem::Version
137
- version: 4.4.0
143
+ version: 4.6.0
138
144
  type: :development
139
145
  prerelease: false
140
146
  version_requirements: !ruby/object:Gem::Requirement
141
147
  requirements:
142
148
  - - "~>"
143
149
  - !ruby/object:Gem::Version
144
- version: 4.4.0
150
+ version: 4.6.0
145
151
  - !ruby/object:Gem::Dependency
146
152
  name: simplecov
147
153
  requirement: !ruby/object:Gem::Requirement
@@ -190,14 +196,14 @@ dependencies:
190
196
  requirements:
191
197
  - - "~>"
192
198
  - !ruby/object:Gem::Version
193
- version: 3.28.0
199
+ version: 3.30.0
194
200
  type: :development
195
201
  prerelease: false
196
202
  version_requirements: !ruby/object:Gem::Requirement
197
203
  requirements:
198
204
  - - "~>"
199
205
  - !ruby/object:Gem::Version
200
- version: 3.28.0
206
+ version: 3.30.0
201
207
  - !ruby/object:Gem::Dependency
202
208
  name: rubypants
203
209
  requirement: !ruby/object:Gem::Requirement
@@ -290,7 +296,6 @@ executables: []
290
296
  extensions: []
291
297
  extra_rdoc_files: []
292
298
  files:
293
- - LICENSE
294
299
  - README.md
295
300
  - lib/govuk_design_system_formbuilder.rb
296
301
  - lib/govuk_design_system_formbuilder/base.rb
@@ -357,7 +362,7 @@ metadata:
357
362
  homepage_uri: https://govuk-form-builder.netlify.app
358
363
  source_code_uri: https://github.com/DFE-Digital/govuk-formbuilder
359
364
  github_repo: https://github.com/DFE-Digital/govuk-formbuilder
360
- post_install_message:
365
+ post_install_message:
361
366
  rdoc_options: []
362
367
  require_paths:
363
368
  - lib
@@ -373,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
373
378
  version: '0'
374
379
  requirements: []
375
380
  rubygems_version: 3.1.6
376
- signing_key:
381
+ signing_key:
377
382
  specification_version: 4
378
383
  summary: GOV.UK-compliant Rails form builder
379
384
  test_files: []
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.