govuk_publishing_components 36.0.0 → 36.0.2
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/_option_select.html.erb +17 -15
- data/app/views/govuk_publishing_components/components/docs/option_select.yml +1 -0
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +5 -6
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/sortablejs/README.md +2 -2
- data/node_modules/sortablejs/Sortable.js +599 -1028
- data/node_modules/sortablejs/Sortable.min.js +2 -2
- data/node_modules/sortablejs/modular/sortable.complete.esm.js +599 -1028
- data/node_modules/sortablejs/modular/sortable.core.esm.js +599 -1029
- data/node_modules/sortablejs/modular/sortable.esm.js +599 -1028
- data/node_modules/sortablejs/package.json +56 -56
- 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: 9964e934f4ce2788b32ae7209b5838a04a44cadbb302c4cf45bd723fd6e9cf38
|
4
|
+
data.tar.gz: 9aa95ca3c117ebef6c201f29990e1b12961b53c435c7904936c44e7b22b53cd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1094205965013e02ab4655bd58fa2e6ac6cfad898ba94275ab93fc3bec5c738fff2fe575e34ac2429e66c912fc54c25afdcf3f878d6090e20ce180bc805e4aa5
|
7
|
+
data.tar.gz: 52f249d3d4edbf8f16d696154c5faf1e751ea386eae9ede15bde6ad248bd705eda6c91b98dfaf4f221c03908b5dd57e9b8ce84eba0c9e85d2078aee907dfe9a8
|
@@ -7,15 +7,10 @@
|
|
7
7
|
checkboxes_count_id = checkboxes_id + "-count"
|
8
8
|
show_filter ||= false
|
9
9
|
large ||= false
|
10
|
-
|
11
|
-
classes = %w[gem-c-option-select__container js-options-container]
|
12
|
-
classes << "gem-c-option-select__container--large" if large
|
13
10
|
%>
|
14
11
|
|
15
12
|
<% if show_filter %>
|
16
|
-
<%
|
17
|
-
filter_id ||= "input-#{SecureRandom.hex(4)}"
|
18
|
-
%>
|
13
|
+
<% filter_id ||= "input-#{SecureRandom.hex(4)}" %>
|
19
14
|
<% filter = capture do %>
|
20
15
|
<%= tag.label for: filter_id, class: "govuk-label govuk-visually-hidden" do %>
|
21
16
|
Filter <%= title %>
|
@@ -34,20 +29,27 @@
|
|
34
29
|
<% filter_element = CGI::escapeHTML(filter) %>
|
35
30
|
<% end %>
|
36
31
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
32
|
+
<%
|
33
|
+
helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
34
|
+
helper.add_class("gem-c-option-select")
|
35
|
+
helper.add_data_attribute({ module: "option-select" })
|
36
|
+
helper.add_data_attribute({ "closed-on-load": true }) if local_assigns.include?(:closed_on_load) && closed_on_load
|
37
|
+
helper.add_data_attribute({ "closed-on-load-mobile": "true" }) if local_assigns.include?(:closed_on_load_mobile) && closed_on_load_mobile
|
38
|
+
helper.add_data_attribute({ "input-aria-controls": aria_controls_id }) if local_assigns.include?(:aria_controls_id)
|
39
|
+
helper.add_data_attribute({ "filter-element": filter_element }) if show_filter
|
40
|
+
|
41
|
+
options_container_classes = %w[gem-c-option-select__container js-options-container]
|
42
|
+
options_container_classes << "gem-c-option-select__container--large" if large
|
43
|
+
%>
|
44
|
+
|
45
|
+
<%= tag.div(**helper.all_attributes) do %>
|
44
46
|
<h3 class="gem-c-option-select__heading js-container-heading">
|
45
47
|
<span class="gem-c-option-select__title js-container-button" id="<%= title_id %>"><%= title %></span>
|
46
48
|
<svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="0" height="0" class="gem-c-option-select__icon gem-c-option-select__icon--up" aria-hidden="true" focusable="false"><path d="m798.16 609.84l-256-256c-16.683-16.683-43.691-16.683-60.331 0l-256 256c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0l225.84-225.84 225.84 225.84c16.683 16.683 43.691 16.683 60.331 0s16.683-43.691 0-60.331z"/></svg>
|
47
49
|
<svg version="1.1" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="0" height="0" class="gem-c-option-select__icon gem-c-option-select__icon--down" aria-hidden="true" focusable="false"><path d="m225.84 414.16l256 256c16.683 16.683 43.691 16.683 60.331 0l256-256c16.683-16.683 16.683-43.691 0-60.331s-43.691-16.683-60.331 0l-225.84 225.84-225.84-225.84c-16.683-16.683-43.691-16.683-60.331 0s-16.683 43.691 0 60.331z"/></svg>
|
48
50
|
</h3>
|
49
51
|
|
50
|
-
<%= content_tag(:div, role: "group", aria: { labelledby: title_id }, class:
|
52
|
+
<%= content_tag(:div, role: "group", aria: { labelledby: title_id }, class: options_container_classes, id: options_container_id, tabindex: "-1") do %>
|
51
53
|
<div class="gem-c-option-select__container-inner js-auto-height-inner">
|
52
54
|
<% if show_filter %>
|
53
55
|
<span id="<%= checkboxes_count_id %>"
|
@@ -68,4 +70,4 @@
|
|
68
70
|
} %>
|
69
71
|
</div>
|
70
72
|
<% end %>
|
71
|
-
|
73
|
+
<% end %>
|
@@ -22,6 +22,7 @@ accessibility_criteria: |
|
|
22
22
|
- inform the user that is it an editable field
|
23
23
|
- inform the user when there are matches, or if there are no matches
|
24
24
|
- inform the user as the number of matches changes
|
25
|
+
uses_component_wrapper_helper: true
|
25
26
|
examples:
|
26
27
|
default:
|
27
28
|
data:
|
@@ -92,13 +92,12 @@ module GovukPublishingComponents
|
|
92
92
|
def add_ga4_political_tags(meta_tags)
|
93
93
|
government = content_item.dig(:links, :government, 0)
|
94
94
|
|
95
|
-
# political: true/false is in a different place to current: true/false, which is why we have 'details' and 'government
|
95
|
+
# political: true/false is in a different place to current: true/false, which is why we have 'details' and 'government.dig(:details)'
|
96
96
|
if government && details[:political]
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
meta_tags["govuk:ga4-publishing-government"] = government_title
|
97
|
+
current_government = government.dig(:details, :current)
|
98
|
+
unless current_government
|
99
|
+
meta_tags["govuk:ga4-political-status"] = "historic"
|
100
|
+
meta_tags["govuk:ga4-publishing-government"] = government[:title] if government[:title]
|
102
101
|
end
|
103
102
|
end
|
104
103
|
|
@@ -54,12 +54,12 @@ Demo: http://sortablejs.github.io/Sortable/
|
|
54
54
|
|
55
55
|
Install with NPM:
|
56
56
|
```bash
|
57
|
-
|
57
|
+
npm install sortablejs --save
|
58
58
|
```
|
59
59
|
|
60
60
|
Install with Bower:
|
61
61
|
```bash
|
62
|
-
|
62
|
+
bower install --save sortablejs
|
63
63
|
```
|
64
64
|
|
65
65
|
Import into your project:
|