govuk_design_system_formbuilder 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/govuk_design_system_formbuilder/elements/date.rb +8 -1
- data/lib/govuk_design_system_formbuilder/elements/radios/collection.rb +6 -5
- data/lib/govuk_design_system_formbuilder/version.rb +1 -1
- data/lib/govuk_design_system_formbuilder.rb +6 -0
- metadata +4 -5
- data/LICENSE +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 849a616e7c297a30b940baee74c033d8ee809d80397d1a09bca32993058a7127
|
4
|
+
data.tar.gz: b154ec1a5517573f061eb294bbd0b7bb2e1ccaacee2868dc2efe8bea4a26d55d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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 =
|
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,
|
@@ -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.
|
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-
|
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.
|
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.
|
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.
|