govuk_publishing_components 28.4.0 → 28.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/assets/javascripts/govuk_publishing_components/analytics/track-select-change.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +21 -291
- data/app/assets/javascripts/govuk_publishing_components/components/button.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/character-count.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/error-summary.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +7 -6
- data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/radio.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/skip-link.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +40 -37
- data/app/assets/javascripts/govuk_publishing_components/components/tabs.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +8 -10
- data/app/assets/javascripts/govuk_publishing_components/lib/initial-focus.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/lib/toggle.js +4 -3
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +1796 -911
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -329
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +95 -56
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +6 -17
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +0 -9
- data/app/models/govuk_publishing_components/component_docs.rb +1 -1
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +30 -15
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_button.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/_character_count.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_details.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_error_message.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_heading.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_hint.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_input.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +12 -1
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_list.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_notice.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_search.html.erb +4 -6
- data/app/views/govuk_publishing_components/components/_select.html.erb +20 -30
- data/app/views/govuk_publishing_components/components/_skip_link.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +8 -9
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_title.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -97
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/inset_text.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/select.yml +12 -0
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +13 -13
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/textarea.yml +1 -1
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +11 -11
- data/config/initializers/assets.rb +1 -0
- data/config/locales/ar.yml +2 -0
- data/config/locales/az.yml +2 -1
- data/config/locales/be.yml +2 -0
- data/config/locales/bg.yml +2 -0
- data/config/locales/bn.yml +2 -0
- data/config/locales/cs.yml +2 -0
- data/config/locales/cy.yml +2 -0
- data/config/locales/da.yml +2 -0
- data/config/locales/de.yml +2 -0
- data/config/locales/dr.yml +2 -0
- data/config/locales/el.yml +2 -0
- data/config/locales/es-419.yml +2 -0
- data/config/locales/es.yml +2 -0
- data/config/locales/et.yml +2 -0
- data/config/locales/fa.yml +2 -1
- data/config/locales/fi.yml +2 -0
- data/config/locales/fr.yml +2 -0
- data/config/locales/gd.yml +2 -0
- data/config/locales/gu.yml +2 -0
- data/config/locales/he.yml +2 -0
- data/config/locales/hi.yml +2 -0
- data/config/locales/hr.yml +2 -0
- data/config/locales/hu.yml +2 -0
- data/config/locales/hy.yml +2 -0
- data/config/locales/id.yml +2 -1
- data/config/locales/is.yml +2 -0
- data/config/locales/it.yml +2 -0
- data/config/locales/ja.yml +2 -1
- data/config/locales/ka.yml +2 -0
- data/config/locales/kk.yml +2 -0
- data/config/locales/ko.yml +2 -1
- data/config/locales/lt.yml +2 -0
- data/config/locales/lv.yml +2 -0
- data/config/locales/ms.yml +2 -1
- data/config/locales/mt.yml +2 -0
- data/config/locales/nl.yml +2 -0
- data/config/locales/no.yml +2 -0
- data/config/locales/pa-pk.yml +2 -0
- data/config/locales/pa.yml +2 -0
- data/config/locales/pl.yml +2 -0
- data/config/locales/ps.yml +2 -0
- data/config/locales/pt.yml +2 -0
- data/config/locales/ro.yml +2 -0
- data/config/locales/ru.yml +2 -0
- data/config/locales/si.yml +2 -0
- data/config/locales/sk.yml +2 -0
- data/config/locales/sl.yml +2 -0
- data/config/locales/so.yml +2 -0
- data/config/locales/sq.yml +2 -0
- data/config/locales/sr.yml +2 -1
- data/config/locales/sv.yml +2 -0
- data/config/locales/sw.yml +2 -0
- data/config/locales/ta.yml +2 -0
- data/config/locales/th.yml +2 -1
- data/config/locales/tk.yml +2 -0
- data/config/locales/tr.yml +2 -0
- data/config/locales/uk.yml +2 -0
- data/config/locales/ur.yml +2 -0
- data/config/locales/uz.yml +2 -0
- data/config/locales/vi.yml +2 -1
- data/config/locales/zh-hk.yml +2 -1
- data/config/locales/zh-tw.yml +2 -1
- data/config/locales/zh.yml +2 -1
- data/lib/govuk_publishing_components/presenters/select_helper.rb +85 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +294 -76
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +274 -99
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +169 -65
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +37 -5
- data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +4 -4
- data/node_modules/govuk-frontend/govuk/components/button/button.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +3 -3
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +15 -2
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +8 -10
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +52 -15
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +0 -2
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +31 -0
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +25 -25
- data/node_modules/govuk-frontend/govuk/components/details/details.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/error-message/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +8 -8
- data/node_modules/govuk-frontend/govuk/components/error-message/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +24 -3
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +25 -16
- data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +2 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +4 -4
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +3 -37
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +119 -15
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +6 -0
- data/node_modules/govuk-frontend/govuk/components/footer/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/header/_index.scss +10 -4
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +11 -11
- data/node_modules/govuk-frontend/govuk/components/header/header.js +4 -4
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -3
- data/node_modules/govuk-frontend/govuk/components/hint/_index.scss +1 -3
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +40 -40
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +4 -3
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +499 -2
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +0 -8
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +44 -45
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +4 -4
- data/node_modules/govuk-frontend/govuk/components/radios/template.njk +2 -9
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +6 -1
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +3 -3
- data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +13 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +9 -9
- data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +1108 -0
- data/node_modules/govuk-frontend/govuk/components/skip-link/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/_index.scss +20 -23
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +86 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/template.njk +1 -4
- data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +2 -2
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +2 -2
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +0 -5
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +4 -4
- data/node_modules/govuk-frontend/govuk/core/_all.scss +0 -1
- data/node_modules/govuk-frontend/govuk/core/_global-styles.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_links.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_lists.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +0 -6
- data/node_modules/govuk-frontend/govuk/core/_typography.scss +0 -6
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/objects/_main-wrapper.scss +15 -30
- data/node_modules/govuk-frontend/govuk/{core → objects}/_template.scss +1 -5
- data/node_modules/govuk-frontend/govuk/overrides/_display.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_spacing.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_text-align.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_typography.scss +0 -6
- data/node_modules/govuk-frontend/govuk/overrides/_width.scss +0 -6
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +3 -0
- data/node_modules/govuk-frontend/govuk/settings/_measurements.scss +0 -10
- data/node_modules/govuk-frontend/govuk/tools/_all.scss +0 -1
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +24 -45
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +0 -100
- data/lib/govuk_publishing_components/presenters/select.rb +0 -43
- data/lib/tasks/govuk_publishing_components_tasks.rake +0 -49
- data/node_modules/govuk-frontend/govuk/tools/_iff.scss +0 -17
data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/barchart-enhancement.js
CHANGED
@@ -24,7 +24,8 @@ window.GOVUK = window.GOVUK || {};
|
|
24
24
|
|
25
25
|
for (var i = 0; i < $barcharts.length; i++) {
|
26
26
|
var $table = $barcharts[i]
|
27
|
-
new GOVUK.Modules.MagnaCharta(
|
27
|
+
var magna = new GOVUK.Modules.MagnaCharta($table, { toggleText: 'Change between chart and table' })
|
28
|
+
magna.init()
|
28
29
|
$table.className = $table.className + ' js-barchart-table-init'
|
29
30
|
}
|
30
31
|
}
|
@@ -4,10 +4,8 @@ window.GOVUK = window.GOVUK || {}
|
|
4
4
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
5
5
|
|
6
6
|
(function (Modules) {
|
7
|
-
function MagnaCharta () {
|
8
|
-
|
9
|
-
MagnaCharta.prototype.start = function ($module, options) {
|
10
|
-
this.$module = $module[0]
|
7
|
+
function MagnaCharta ($module, options) {
|
8
|
+
this.$table = $module
|
11
9
|
this.options = {
|
12
10
|
outOf: 65,
|
13
11
|
applyOnInit: true,
|
@@ -22,14 +20,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
22
20
|
}
|
23
21
|
|
24
22
|
for (var k in options) this.options[k] = options[k]
|
23
|
+
}
|
24
|
+
|
25
|
+
MagnaCharta.prototype.init = function () {
|
25
26
|
this.detectIEVersion()
|
26
27
|
|
27
28
|
// Magna Charta doesn't work in IE7 or less - so plain tables are shown to those browsers
|
28
29
|
this.ENABLED = !(this.ie && this.ie < 8)
|
29
30
|
|
30
|
-
// store a reference to the table in the object
|
31
|
-
this.$table = $module
|
32
|
-
|
33
31
|
// a container around the graph element so that it can be targeted by screen readers, allowing us to inform screen reader users that the graph isn't accessible
|
34
32
|
this.$graphContainer = document.createElement('div')
|
35
33
|
this.$graphContainer.className = 'mc-chart-container'
|
@@ -47,7 +45,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
47
45
|
this.$graph.classList.add('mc-chart')
|
48
46
|
|
49
47
|
// get the id of the current chart within the page so that it can be used during the generation of the toggleLink
|
50
|
-
this.chartId = this.getChartId(
|
48
|
+
this.chartId = this.getChartId()
|
51
49
|
|
52
50
|
// set the stacked option based on
|
53
51
|
// giving the table a class of mc-stacked
|
@@ -458,12 +456,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
458
456
|
}
|
459
457
|
}
|
460
458
|
|
461
|
-
MagnaCharta.prototype.getChartId = function (
|
459
|
+
MagnaCharta.prototype.getChartId = function () {
|
462
460
|
var allCharts = document.querySelectorAll('table.js-barchart-table')
|
463
461
|
var id = null
|
464
462
|
|
465
463
|
for (var i = 0; i < allCharts.length; i++) {
|
466
|
-
if (allCharts[i] ===
|
464
|
+
if (allCharts[i] === this.$table) {
|
467
465
|
id = i
|
468
466
|
}
|
469
467
|
}
|
@@ -2,10 +2,11 @@ window.GOVUK = window.GOVUK || {}
|
|
2
2
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
3
3
|
|
4
4
|
(function (Modules) {
|
5
|
-
function InitialFocus () {
|
5
|
+
function InitialFocus ($module) {
|
6
|
+
this.$module = $module
|
7
|
+
}
|
6
8
|
|
7
|
-
InitialFocus.prototype.
|
8
|
-
this.$module = $module[0]
|
9
|
+
InitialFocus.prototype.init = function () {
|
9
10
|
this.$module.focus()
|
10
11
|
}
|
11
12
|
|
@@ -7,10 +7,11 @@ window.GOVUK = window.GOVUK || {}
|
|
7
7
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
8
8
|
|
9
9
|
(function (Modules) {
|
10
|
-
function GemToggleInputClassOnFocus () {
|
10
|
+
function GemToggleInputClassOnFocus ($module) {
|
11
|
+
this.$module = $module
|
12
|
+
}
|
11
13
|
|
12
|
-
GemToggleInputClassOnFocus.prototype.
|
13
|
-
this.$module = $module[0]
|
14
|
+
GemToggleInputClassOnFocus.prototype.init = function () {
|
14
15
|
this.toggleTarget = this.$module.querySelector('.js-class-toggle')
|
15
16
|
this.$module.addFocusClass = this.addFocusClass.bind(this)
|
16
17
|
this.$module.removeFocusClassFromEmptyInput = this.removeFocusClassFromEmptyInput.bind(this)
|
@@ -87,10 +87,11 @@ window.GOVUK = window.GOVUK || {}
|
|
87
87
|
window.GOVUK.Modules = window.GOVUK.Modules || {};
|
88
88
|
|
89
89
|
(function (Modules) {
|
90
|
-
function GemToggle () {
|
90
|
+
function GemToggle ($module) {
|
91
|
+
this.$module = $module
|
92
|
+
}
|
91
93
|
|
92
|
-
GemToggle.prototype.
|
93
|
-
this.$module = $module[0]
|
94
|
+
GemToggle.prototype.init = function () {
|
94
95
|
this.$module.toggleTrigger = this.$module.querySelector('[data-controls][data-expanded]')
|
95
96
|
|
96
97
|
if (this.$module.toggleTrigger) {
|