govuk_publishing_components 24.18.4 → 24.18.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +14 -0
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +6 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +5 -3
- data/app/views/govuk_publishing_components/components/_details.html.erb +7 -4
- data/app/views/govuk_publishing_components/components/docs/details.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +4 -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: c0dd119f435f1a28904b9dcdb3606a673ce104affaf5ae042da92d0a0baed59f
|
4
|
+
data.tar.gz: b8812490fbe415509399aafe027c44e73a1d6792462a1d36454ce8fc58c57790
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aca12277c18d9a05932d9b88d86a7c7e009a6fccc27740dd938165c19518b882b7b073b133215302e07930540f15af881e33fca4ee43fa4cf5ce09e9f53456f2
|
7
|
+
data.tar.gz: e0a26bacdc1cc6bc26a8e9392cff1ed1173c4af095d02fce45fba908cd520ccf23f41cdf49c9b3d3c37dca77a03f2b331050f98eda781418c91379f2e9fd1683
|
@@ -206,6 +206,13 @@
|
|
206
206
|
['Percent', 80],
|
207
207
|
['Percent', 100]
|
208
208
|
],
|
209
|
+
'/guidance/brexit-guidance-for-businesses.cy': [
|
210
|
+
['Percent', 20],
|
211
|
+
['Percent', 40],
|
212
|
+
['Percent', 60],
|
213
|
+
['Percent', 80],
|
214
|
+
['Percent', 100]
|
215
|
+
],
|
209
216
|
'/guidance/brexit-guidance-for-individuals-and-families': [
|
210
217
|
['Percent', 20],
|
211
218
|
['Percent', 40],
|
@@ -213,6 +220,13 @@
|
|
213
220
|
['Percent', 80],
|
214
221
|
['Percent', 100]
|
215
222
|
],
|
223
|
+
'/guidance/brexit-guidance-for-individuals-and-families.cy': [
|
224
|
+
['Percent', 20],
|
225
|
+
['Percent', 40],
|
226
|
+
['Percent', 60],
|
227
|
+
['Percent', 80],
|
228
|
+
['Percent', 100]
|
229
|
+
],
|
216
230
|
'/guidance/import-and-export-goods-using-preference-agreements': [
|
217
231
|
['Percent', 20],
|
218
232
|
['Percent', 40],
|
@@ -7,24 +7,26 @@ window.GOVUK.Modules.GovukDetails = window.GOVUKFrontend;
|
|
7
7
|
(function (Modules) {
|
8
8
|
function GemDetails ($module) {
|
9
9
|
this.$module = $module
|
10
|
-
this
|
10
|
+
this.$summary = this.$module.querySelector('.govuk-details__summary')
|
11
|
+
|
12
|
+
this.customTrackLabel = this.$summary.getAttribute('data-track-label')
|
11
13
|
this.detailsClick = this.$module.querySelector('[data-details-track-click]')
|
12
14
|
}
|
13
15
|
|
14
16
|
GemDetails.prototype.init = function () {
|
15
17
|
if (this.customTrackLabel) { // If a custom label has been provided, we can simply call the tracking module
|
16
18
|
var trackDetails = new window.GOVUK.Modules.GemTrackClick()
|
17
|
-
trackDetails.start($(this.$
|
19
|
+
trackDetails.start($(this.$summary))
|
18
20
|
} else if (this.detailsClick) { // If no custom label is set, we use the open/close status as the label
|
19
21
|
this.detailsClick.addEventListener('click', function (event) {
|
20
|
-
this.trackDefault(this.$
|
22
|
+
this.trackDefault(this.$summary)
|
21
23
|
}.bind(this))
|
22
24
|
}
|
23
25
|
}
|
24
26
|
|
25
27
|
GemDetails.prototype.trackDefault = function (element) {
|
26
28
|
if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
|
27
|
-
var componentStatus = (
|
29
|
+
var componentStatus = (this.$module.getAttribute('open') == null) ? 'open' : 'closed'
|
28
30
|
var trackCategory = element.getAttribute('data-track-category')
|
29
31
|
var trackAction = element.getAttribute('data-track-action')
|
30
32
|
var trackOptions = element.getAttribute('data-track-options')
|
@@ -151,11 +151,11 @@
|
|
151
151
|
|
152
152
|
&:before {
|
153
153
|
height: 30px;
|
154
|
-
width:
|
154
|
+
width: 30px;
|
155
155
|
background-image: image-url("govuk_publishing_components/action-link-arrow--brexit.svg");
|
156
156
|
background-repeat: no-repeat;
|
157
|
-
background-size:
|
158
|
-
background-position: 0
|
157
|
+
background-size: 18px auto;
|
158
|
+
background-position: 0 2px;
|
159
159
|
}
|
160
160
|
|
161
161
|
@include govuk-media-query($until: tablet) {
|
@@ -166,7 +166,9 @@
|
|
166
166
|
margin-bottom: govuk-spacing(2);
|
167
167
|
|
168
168
|
&:before {
|
169
|
+
width: 35px;
|
169
170
|
background-position: 0 4px;
|
171
|
+
background-size: 25px auto;
|
170
172
|
}
|
171
173
|
}
|
172
174
|
}
|
@@ -6,15 +6,18 @@
|
|
6
6
|
css_classes = %w(gem-c-details govuk-details)
|
7
7
|
css_classes << (shared_helper.get_margin_bottom)
|
8
8
|
|
9
|
+
details_data_attributes = {}
|
10
|
+
details_data_attributes[:module] = 'govuk-details gem-details'
|
11
|
+
|
9
12
|
data_attributes ||= {}
|
10
|
-
data_attributes[:
|
13
|
+
data_attributes[:details_track_click] = ''
|
11
14
|
%>
|
12
|
-
<%= tag.details class: css_classes, data:
|
13
|
-
|
15
|
+
<%= tag.details class: css_classes, data: details_data_attributes, open: open do %>
|
16
|
+
<%= tag.summary class: "govuk-details__summary", data: data_attributes do %>
|
14
17
|
<span class="govuk-details__summary-text">
|
15
18
|
<%= title %>
|
16
19
|
</span>
|
17
|
-
|
20
|
+
<% end %>
|
18
21
|
<div class="govuk-details__text">
|
19
22
|
<%= yield %>
|
20
23
|
</div>
|
@@ -22,7 +22,7 @@ examples:
|
|
22
22
|
block: |
|
23
23
|
We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
|
24
24
|
with_data_attributes:
|
25
|
-
description: Can be used for tracking. By default, `track-label` is set to the status ("open" or "closed") unless a track_label is passed into the component.
|
25
|
+
description: Can be used for tracking. Tracking is applied to the summary element when the details element is opened and closed. By default, `track-label` is set to the status ("open" or "closed") unless a track_label is passed into the component.
|
26
26
|
data:
|
27
27
|
title: Help with nationality
|
28
28
|
data_attributes:
|
@@ -105,7 +105,10 @@ examples:
|
|
105
105
|
with_search_bar:
|
106
106
|
data:
|
107
107
|
search: true
|
108
|
-
|
108
|
+
with_custom_logo_link:
|
109
|
+
description: The header logo links to root by default. This option allows us to override that in certain instances.
|
110
|
+
data:
|
111
|
+
logo_link: "/account/home"
|
109
112
|
accessibility_criteria: |
|
110
113
|
The component must:
|
111
114
|
|
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: 24.18.
|
4
|
+
version: 24.18.5
|
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: 2021-07-
|
11
|
+
date: 2021-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|