govuk_publishing_components 21.34.0 → 21.34.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +20 -3
- data/app/views/govuk_publishing_components/components/docs/radio.yml +12 -0
- data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +3 -1
- data/lib/govuk_publishing_components/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: 4e520e8f4d8396e3e7b6abd02a2b4e5c35af1a491909c010c003654cbffd7815
|
4
|
+
data.tar.gz: f36c4843d284f739f868ef8286089872464568a79500efebc8a9f4cd161b15f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee4f82df1fecd0979a2f7b557340443af3acd12a917174a36ad369378e469541e39616639d341b654a706bdecc3a332e785b8554abe085343d2d553707532c3
|
7
|
+
data.tar.gz: 76e2ed627dd262c031ec78b0990d2deab975cca1ec8441a8c125609a0d9a3d08b3f41feed463a8fe258ee57647c8e029d18c2f18bd390e9a536892a3f9b89a41
|
@@ -285,9 +285,26 @@ examples:
|
|
285
285
|
- label: "Phone"
|
286
286
|
value: "phone"
|
287
287
|
conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone" name="contactingme" type="tel"></div>
|
288
|
-
- label: "
|
289
|
-
value: "
|
290
|
-
conditional: "
|
288
|
+
- label: "Text message"
|
289
|
+
value: "text"
|
290
|
+
conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
|
291
|
+
checkbox_items_with_conditional_reveal_checked:
|
292
|
+
data:
|
293
|
+
name: "contacting-checked"
|
294
|
+
id: "contacting-checked"
|
295
|
+
heading: "How would you like to be contacted?"
|
296
|
+
hint_text: "Please select all options that are relevant to you."
|
297
|
+
items:
|
298
|
+
- label: "Email"
|
299
|
+
value: "email"
|
300
|
+
conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-email">Email address</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-email" name="contactingme" type="email"></div>
|
301
|
+
checked: true
|
302
|
+
- label: "Phone"
|
303
|
+
value: "phone"
|
304
|
+
conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-phone">Phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-phone" name="contactingme" type="tel"></div>
|
305
|
+
- label: "Text message"
|
306
|
+
value: "text"
|
307
|
+
conditional: <div class="govuk-form-group"><label class="govuk-label" for="contact-by-text">Mobile phone number</label><input class="govuk-input govuk-!-width-one-third" id="contact-by-text" name="contactingme" type="tel"></div>
|
291
308
|
checkbox_items_with_checked_items:
|
292
309
|
data:
|
293
310
|
name: "nationality"
|
@@ -313,6 +313,18 @@ examples:
|
|
313
313
|
- value: "govuk-verify"
|
314
314
|
text: "Use GOV.UK Verify"
|
315
315
|
conditional: "You’ll need to prove your identity using GOV.UK Verify"
|
316
|
+
conditional_checked:
|
317
|
+
data:
|
318
|
+
name: "radio-group-conditional"
|
319
|
+
id_prefix: "conditional-checked"
|
320
|
+
items:
|
321
|
+
- value: "government-gateway"
|
322
|
+
text: "Use Government Gateway"
|
323
|
+
conditional: "You’ll need to prove your identity using Government Gateway"
|
324
|
+
checked: true
|
325
|
+
- value: "govuk-verify"
|
326
|
+
text: "Use GOV.UK Verify"
|
327
|
+
conditional: "You’ll need to prove your identity using GOV.UK Verify"
|
316
328
|
tracking-url:
|
317
329
|
data:
|
318
330
|
name: "radio-group-tracking-url"
|
@@ -70,11 +70,13 @@ module GovukPublishingComponents
|
|
70
70
|
|
71
71
|
def checkbox_markup(checkbox, index)
|
72
72
|
checkbox_id = checkbox[:id] || "#{@id}-#{index}"
|
73
|
-
controls = checkbox[:
|
73
|
+
controls = checkbox[:controls]
|
74
|
+
aria_controls = "#{checkbox_id}-conditional-#{index || rand(1..100)}" if checkbox[:conditional].present?
|
74
75
|
checkbox_name = checkbox[:name].present? ? checkbox[:name] : @name
|
75
76
|
checked = true if checkbox[:checked].present?
|
76
77
|
data = checkbox[:data_attributes] || {}
|
77
78
|
data[:controls] = controls
|
79
|
+
data["aria-controls"] = aria_controls
|
78
80
|
|
79
81
|
capture do
|
80
82
|
concat check_box_tag checkbox_name, checkbox[:value], checked, class: "govuk-checkboxes__input", id: checkbox_id, data: data
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 21.34.
|
4
|
+
version: 21.34.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gds-api-adapters
|