govuk_publishing_components 35.6.0 → 35.8.0
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/component_guide/audit-filter.js +45 -0
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +206 -114
- data/app/assets/stylesheets/component_guide/application.scss +0 -25
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +5 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +4 -0
- data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +37 -49
- data/app/views/govuk_publishing_components/audit/show.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +38 -18
- data/app/views/govuk_publishing_components/components/_character_count.html.erb +4 -2
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +8 -7
- data/app/views/govuk_publishing_components/components/_feedback.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +9 -2
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +20 -14
- data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_select.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/attachment/_thumbnail_document.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/attachment/_thumbnail_html.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/attachment.yml +21 -0
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +17 -0
- data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +6 -0
- data/app/views/layouts/govuk_publishing_components/application.html.erb +23 -20
- data/config/locales/ar.yml +1 -0
- data/config/locales/az.yml +1 -0
- data/config/locales/be.yml +1 -0
- data/config/locales/bg.yml +1 -0
- data/config/locales/bn.yml +1 -0
- data/config/locales/cs.yml +1 -0
- data/config/locales/cy.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +1 -0
- data/config/locales/dr.yml +1 -0
- data/config/locales/el.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/es-419.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/et.yml +1 -0
- data/config/locales/fa.yml +1 -0
- data/config/locales/fi.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/config/locales/gd.yml +1 -0
- data/config/locales/gu.yml +1 -0
- data/config/locales/he.yml +1 -0
- data/config/locales/hi.yml +1 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +1 -0
- data/config/locales/hy.yml +1 -0
- data/config/locales/id.yml +1 -0
- data/config/locales/is.yml +1 -0
- data/config/locales/it.yml +1 -0
- data/config/locales/ja.yml +1 -0
- data/config/locales/ka.yml +1 -0
- data/config/locales/kk.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +1 -0
- data/config/locales/ms.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/config/locales/no.yml +1 -0
- data/config/locales/pa-pk.yml +1 -0
- data/config/locales/pa.yml +1 -0
- data/config/locales/pl.yml +1 -0
- data/config/locales/ps.yml +1 -0
- data/config/locales/pt.yml +1 -0
- data/config/locales/ro.yml +1 -0
- data/config/locales/ru.yml +1 -0
- data/config/locales/si.yml +1 -0
- data/config/locales/sk.yml +1 -0
- data/config/locales/sl.yml +1 -0
- data/config/locales/so.yml +1 -0
- data/config/locales/sq.yml +1 -0
- data/config/locales/sr.yml +1 -0
- data/config/locales/sv.yml +1 -0
- data/config/locales/sw.yml +1 -0
- data/config/locales/ta.yml +1 -0
- data/config/locales/th.yml +1 -0
- data/config/locales/tk.yml +1 -0
- data/config/locales/tr.yml +1 -0
- data/config/locales/uk.yml +1 -0
- data/config/locales/ur.yml +1 -0
- data/config/locales/uz.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-hk.yml +1 -0
- data/config/locales/zh-tw.yml +1 -0
- data/config/locales/zh.yml +1 -0
- data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +5 -1
- data/lib/govuk_publishing_components/presenters/attachment_helper.rb +15 -3
- data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +5 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/README.md +4 -0
- data/node_modules/axe-core/axe.js +25 -19
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/package.json +1 -1
- data/node_modules/axe-core/sri-history.json +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb44475cd33bb952348a502c37c3efd863abe1725c3eb74e52542b84c333c2b5
|
4
|
+
data.tar.gz: 9625af4c341034a1a2b3f690ef08c286baaf740f5aaf972d7f8da5259d90487b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4ef66116738fae07573951c81aad049cb817f05c525ad987c2060f4617583a7858d9cc01a085d3c9a18a20d6c768fe319754e6885046194ca0bb85c98de5454
|
7
|
+
data.tar.gz: 55cebac0cd80a787a1e057cb671ea33b1e0c9e8da029472ba9b1518cf46cc6a0bdd1bf9e15bedf91107e8ec365a703809498cd6bec9be896fddf55283427a0d0
|
@@ -5,6 +5,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
5
5
|
function AuditFilter ($module) {
|
6
6
|
this.module = $module
|
7
7
|
this.data = this.module.querySelector('[data-audit-list]')
|
8
|
+
this.headings = this.module.querySelector('[data-audit-headings]')
|
8
9
|
}
|
9
10
|
|
10
11
|
AuditFilter.prototype.init = function () {
|
@@ -14,6 +15,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
14
15
|
|
15
16
|
this.filterComponentsFunction = this.filterComponents.bind(this)
|
16
17
|
this.select.addEventListener('change', this.filterComponentsFunction)
|
18
|
+
this.setHeadingCount()
|
17
19
|
}
|
18
20
|
}
|
19
21
|
|
@@ -75,6 +77,49 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
75
77
|
}
|
76
78
|
}
|
77
79
|
}
|
80
|
+
this.setHeadingCount()
|
81
|
+
}
|
82
|
+
|
83
|
+
AuditFilter.prototype.setHeadingCount = function () {
|
84
|
+
if (this.headings) {
|
85
|
+
var visibleRows = this.data.querySelectorAll('[data-application]:not([hidden])')
|
86
|
+
|
87
|
+
if (!this.headingLabels) {
|
88
|
+
this.headingLabels = this.getHeadingLabels()
|
89
|
+
}
|
90
|
+
// need an array of zeroes same length as headingLabels to store the counts
|
91
|
+
var headingCounts = new Array(this.headingLabels.length)
|
92
|
+
for (var i = 0; i < this.headingLabels.length; ++i) {
|
93
|
+
headingCounts[i] = 0
|
94
|
+
}
|
95
|
+
|
96
|
+
for (var j = 0; j < visibleRows.length; j++) {
|
97
|
+
for (var k = 0; k < this.headingLabels.length; k++) {
|
98
|
+
var cell = visibleRows[j].querySelector('[data-component-type=' + this.headingLabels[k] + ']')
|
99
|
+
if (cell.textContent.trim().length) {
|
100
|
+
headingCounts[k] += 1
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
var reg = /\([0-9]+\)/i
|
106
|
+
for (var l = 0; l < this.headingLabels.length; l++) {
|
107
|
+
var headingItem = this.headings.querySelector('[data-component-type=' + this.headingLabels[l] + ']')
|
108
|
+
headingItem.textContent = headingItem.textContent.replace(reg, '') + ' (' + headingCounts[l] + ')'
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
AuditFilter.prototype.getHeadingLabels = function () {
|
114
|
+
var headings = this.headings.querySelectorAll('[data-component-type]')
|
115
|
+
var labels = []
|
116
|
+
for (var i = 0; i < headings.length; i++) {
|
117
|
+
var label = headings[i].getAttribute('data-component-type')
|
118
|
+
if (labels.indexOf(label) === -1) {
|
119
|
+
labels.push(label)
|
120
|
+
}
|
121
|
+
}
|
122
|
+
return labels
|
78
123
|
}
|
79
124
|
|
80
125
|
Modules.AuditFilter = AuditFilter
|