govuk_design_system_formbuilder 5.3.0 → 5.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13f57345ba6371b79766d71c1f0a1c135812739c811b2185ff8f499286a0663b
|
4
|
+
data.tar.gz: ec2831b973682351584462c098c511f3d4d75b34383c6cad68bf00e73bdc32f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a7b7d97d22d6c7aba76929f9bafce64a52de058d109aa8b20d8d0d164576bf3832c51b1fe0a2380e76b5817947e3335016dde990f0085317a270a5ed29fc5d
|
7
|
+
data.tar.gz: 213b583c469a518f95927233ab17bdb8ab629bff51b53ce4e983d8a01c71cbd920781f0fcd6b8a53aedabd08d3558945a65203ba80c4a07c8ab4e7938b471fc1
|
@@ -8,7 +8,6 @@ module GOVUKDesignSystemFormBuilder
|
|
8
8
|
include Traits::Supplemental
|
9
9
|
include Traits::HTMLClasses
|
10
10
|
|
11
|
-
SEGMENTS = { day: '3i', month: '2i', year: '1i' }.freeze
|
12
11
|
MULTIPARAMETER_KEY = { day: 3, month: 2, year: 1 }.freeze
|
13
12
|
|
14
13
|
def initialize(builder, object_name, attribute_name, legend:, caption:, hint:, omit_day:, maxlength_enabled:, form_group:, date_of_birth: false, **kwargs, &block)
|
@@ -34,6 +33,10 @@ module GOVUKDesignSystemFormBuilder
|
|
34
33
|
|
35
34
|
private
|
36
35
|
|
36
|
+
def segments
|
37
|
+
config.default_date_segments
|
38
|
+
end
|
39
|
+
|
37
40
|
def fieldset_options
|
38
41
|
{ legend: @legend, caption: @caption, described_by: [error_id, hint_id, supplemental_id] }
|
39
42
|
end
|
@@ -136,7 +139,7 @@ module GOVUKDesignSystemFormBuilder
|
|
136
139
|
if has_errors? && link_errors
|
137
140
|
field_id(link_errors:)
|
138
141
|
else
|
139
|
-
[@object_name, @attribute_name,
|
142
|
+
[@object_name, @attribute_name, segments.fetch(segment)].join("_")
|
140
143
|
end
|
141
144
|
end
|
142
145
|
|
@@ -145,7 +148,7 @@ module GOVUKDesignSystemFormBuilder
|
|
145
148
|
"%<object_name>s[%<input_name>s(%<segment>s)]",
|
146
149
|
object_name: @object_name,
|
147
150
|
input_name: @attribute_name,
|
148
|
-
segment:
|
151
|
+
segment: segments.fetch(segment)
|
149
152
|
)
|
150
153
|
end
|
151
154
|
|
@@ -85,6 +85,7 @@ module GOVUKDesignSystemFormBuilder
|
|
85
85
|
data: { module: %(#{brand}-button) },
|
86
86
|
aria: { label: "Show password", controls: field_id(link_errors: true) },
|
87
87
|
type: 'button',
|
88
|
+
hidden: true,
|
88
89
|
class: %w(button button--secondary password-input__toggle js-password-input-toggle).prefix(brand)
|
89
90
|
}
|
90
91
|
end
|
@@ -27,16 +27,17 @@ module GOVUKDesignSystemFormBuilder
|
|
27
27
|
# * +:default_submit_button_text+ sets the value assigned to +govuk_submit+,
|
28
28
|
# defaults to 'Continue'.
|
29
29
|
#
|
30
|
+
# * +:default_date_segments+ allows the date segments used by Rails'
|
31
|
+
# multiparameter attributes to be configured. This is useful if you want to
|
32
|
+
# override the standard behaviour where Rails tries to cast the values
|
33
|
+
# into a +Date+. Defaults to +{ day: '3i', month: '2i', year: '1i' }+
|
34
|
+
#
|
30
35
|
# * +:default_radio_divider_text+ sets the text automatically added to the
|
31
36
|
# radio button divider, defaults to 'or'
|
32
37
|
#
|
33
38
|
# * +:default_check_box_divider_text+ sets the text automatically added to the
|
34
39
|
# checkbox divider, defaults to 'or'
|
35
40
|
#
|
36
|
-
# * +:default_submit_button_text+ sets the text used to divide the last radio
|
37
|
-
# button in radio button fieldsets. As per the GOV.UK Design System spec,
|
38
|
-
# it defaults to 'or'.
|
39
|
-
#
|
40
41
|
# * +:default_collection_check_boxes_include_hidden+ controls whether or not
|
41
42
|
# a hidden field is added when rendering a collection of check boxes
|
42
43
|
#
|
@@ -92,6 +93,7 @@ module GOVUKDesignSystemFormBuilder
|
|
92
93
|
default_legend_tag: nil,
|
93
94
|
default_caption_size: 'm',
|
94
95
|
default_submit_button_text: 'Continue',
|
96
|
+
default_date_segments: { day: '3i', month: '2i', year: '1i' },
|
95
97
|
default_radio_divider_text: 'or',
|
96
98
|
default_check_box_divider_text: 'or',
|
97
99
|
default_error_summary_title: 'There is a problem',
|
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: 5.3.
|
4
|
+
version: 5.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-16 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.
|
137
|
+
version: 4.16.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.
|
144
|
+
version: 4.16.0
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: simplecov
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|