govuk_design_system_formbuilder 2.7.1 → 2.7.2
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/base.rb +1 -1
- data/lib/govuk_design_system_formbuilder/containers/check_boxes.rb +1 -1
- data/lib/govuk_design_system_formbuilder/containers/check_boxes_fieldset.rb +2 -1
- data/lib/govuk_design_system_formbuilder/containers/fieldset.rb +1 -1
- data/lib/govuk_design_system_formbuilder/containers/form_group.rb +1 -1
- data/lib/govuk_design_system_formbuilder/containers/radio_buttons_fieldset.rb +3 -2
- data/lib/govuk_design_system_formbuilder/containers/radios.rb +1 -1
- data/lib/govuk_design_system_formbuilder/elements/check_boxes/fieldset_check_box.rb +2 -2
- data/lib/govuk_design_system_formbuilder/elements/collection_select.rb +1 -1
- data/lib/govuk_design_system_formbuilder/elements/file.rb +1 -1
- data/lib/govuk_design_system_formbuilder/elements/radios/fieldset_radio_button.rb +2 -2
- data/lib/govuk_design_system_formbuilder/elements/select.rb +1 -1
- data/lib/govuk_design_system_formbuilder/elements/text_area.rb +1 -1
- data/lib/govuk_design_system_formbuilder/traits/fieldset_item.rb +4 -4
- data/lib/govuk_design_system_formbuilder/traits/input.rb +1 -1
- data/lib/govuk_design_system_formbuilder/traits/select.rb +1 -1
- data/lib/govuk_design_system_formbuilder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06a3aa374a6a6fa23d1fb52cdb7585fe50e067580328683b5dcbbcd8c6444aab
|
4
|
+
data.tar.gz: 15c814a5314cbf8aa97fd9e8d47c640062286d6a2239be89265015f6eafab172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4319d5fbd9168b1869aa94a1206f57c50f4e2d1a238a06da0bbcae0a55b82a020895ca1cfc59de86fdb9ee0248cbd283a3f5b22142946b9951a96906e870c9e
|
7
|
+
data.tar.gz: eec0ec045b248bd16cf671b4d289ea91429338693c541c74c30d92d481b2f2a833c490b064ed58bce7e95a49af03725faa6cb58b0222f0a5411153d1673d4a89
|
@@ -5,6 +5,8 @@ module GOVUKDesignSystemFormBuilder
|
|
5
5
|
include Traits::Hint
|
6
6
|
|
7
7
|
def initialize(builder, object_name, attribute_name, hint:, legend:, caption:, small:, classes:, form_group:, multiple:, &block)
|
8
|
+
fail LocalJumpError, 'no block given' unless block_given?
|
9
|
+
|
8
10
|
super(builder, object_name, attribute_name, &block)
|
9
11
|
|
10
12
|
@legend = legend
|
@@ -14,7 +16,6 @@ module GOVUKDesignSystemFormBuilder
|
|
14
16
|
@classes = classes
|
15
17
|
@form_group = form_group
|
16
18
|
@multiple = multiple
|
17
|
-
@block_content = capture { block.call }
|
18
19
|
end
|
19
20
|
|
20
21
|
def html
|
@@ -5,7 +5,9 @@ module GOVUKDesignSystemFormBuilder
|
|
5
5
|
include Traits::Error
|
6
6
|
|
7
7
|
def initialize(builder, object_name, attribute_name, hint:, legend:, caption:, inline:, small:, classes:, form_group:, &block)
|
8
|
-
|
8
|
+
fail LocalJumpError, 'no block given' unless block_given?
|
9
|
+
|
10
|
+
super(builder, object_name, attribute_name, &block)
|
9
11
|
|
10
12
|
@inline = inline
|
11
13
|
@small = small
|
@@ -14,7 +16,6 @@ module GOVUKDesignSystemFormBuilder
|
|
14
16
|
@hint = hint
|
15
17
|
@classes = classes
|
16
18
|
@form_group = form_group
|
17
|
-
@block_content = capture { block.call }
|
18
19
|
end
|
19
20
|
|
20
21
|
def html
|
@@ -8,7 +8,7 @@ module GOVUKDesignSystemFormBuilder
|
|
8
8
|
include Traits::FieldsetItem
|
9
9
|
|
10
10
|
def initialize(builder, object_name, attribute_name, value, unchecked_value, label:, hint:, link_errors:, multiple:, exclusive:, **kwargs, &block)
|
11
|
-
super(builder, object_name, attribute_name)
|
11
|
+
super(builder, object_name, attribute_name, &block)
|
12
12
|
|
13
13
|
@value = value
|
14
14
|
@unchecked_value = unchecked_value
|
@@ -19,7 +19,7 @@ module GOVUKDesignSystemFormBuilder
|
|
19
19
|
@html_attributes = kwargs
|
20
20
|
@exclusive = exclusive
|
21
21
|
|
22
|
-
conditional_content(
|
22
|
+
conditional_content(@block_content)
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -40,7 +40,7 @@ module GOVUKDesignSystemFormBuilder
|
|
40
40
|
{
|
41
41
|
id: field_id(link_errors: true),
|
42
42
|
class: classes,
|
43
|
-
aria: { describedby:
|
43
|
+
aria: { describedby: combine_references(hint_id, error_id, supplemental_id) }
|
44
44
|
}
|
45
45
|
end
|
46
46
|
|
@@ -35,7 +35,7 @@ module GOVUKDesignSystemFormBuilder
|
|
35
35
|
{
|
36
36
|
id: field_id(link_errors: true),
|
37
37
|
class: classes,
|
38
|
-
aria: { describedby:
|
38
|
+
aria: { describedby: combine_references(hint_id, error_id, supplemental_id) }
|
39
39
|
}
|
40
40
|
end
|
41
41
|
|
@@ -8,7 +8,7 @@ module GOVUKDesignSystemFormBuilder
|
|
8
8
|
include Traits::FieldsetItem
|
9
9
|
|
10
10
|
def initialize(builder, object_name, attribute_name, value, label:, hint:, link_errors:, **kwargs, &block)
|
11
|
-
super(builder, object_name, attribute_name)
|
11
|
+
super(builder, object_name, attribute_name, &block)
|
12
12
|
|
13
13
|
@value = value
|
14
14
|
@label = label
|
@@ -16,7 +16,7 @@ module GOVUKDesignSystemFormBuilder
|
|
16
16
|
@link_errors = has_errors? && link_errors
|
17
17
|
@html_attributes = kwargs
|
18
18
|
|
19
|
-
conditional_content(
|
19
|
+
conditional_content(@block_content)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -53,7 +53,7 @@ module GOVUKDesignSystemFormBuilder
|
|
53
53
|
id: field_id(link_errors: true),
|
54
54
|
class: classes,
|
55
55
|
rows: @rows,
|
56
|
-
aria: { describedby:
|
56
|
+
aria: { describedby: combine_references(hint_id, error_id, supplemental_id, limit_description_id) },
|
57
57
|
}
|
58
58
|
end
|
59
59
|
|
@@ -4,7 +4,7 @@ module GOVUKDesignSystemFormBuilder
|
|
4
4
|
using PrefixableArray
|
5
5
|
|
6
6
|
def html
|
7
|
-
safe_join([item, @
|
7
|
+
safe_join([item, @conditional_content])
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
@@ -61,9 +61,9 @@ module GOVUKDesignSystemFormBuilder
|
|
61
61
|
build_id('conditional')
|
62
62
|
end
|
63
63
|
|
64
|
-
def conditional_content(
|
65
|
-
if
|
66
|
-
@
|
64
|
+
def conditional_content(block_content)
|
65
|
+
if block_content.present?
|
66
|
+
@conditional_content = conditional_container(block_content)
|
67
67
|
@conditional_id = conditional_id
|
68
68
|
end
|
69
69
|
end
|
@@ -48,7 +48,7 @@ module GOVUKDesignSystemFormBuilder
|
|
48
48
|
{
|
49
49
|
id: field_id(link_errors: true),
|
50
50
|
class: classes,
|
51
|
-
aria: { describedby:
|
51
|
+
aria: { describedby: combine_references(hint_id, error_id, supplemental_id) }
|
52
52
|
}
|
53
53
|
end
|
54
54
|
|
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: 2.7.
|
4
|
+
version: 2.7.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: 2021-
|
11
|
+
date: 2021-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deep_merge
|