govuk_publishing_components 68.2.0 → 69.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +44 -17
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +98 -139
- data/app/assets/javascripts/govuk_publishing_components/components/option-select.js +26 -16
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +12 -11
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +3 -1
- data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +14 -11
- data/app/assets/stylesheets/component_guide/application.scss +7 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_add-another.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_app-promo-banner.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +5 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +6 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_cross-service-header.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +6 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_figure.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +6 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +15 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_option-select.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +1 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/_pagination.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_password-input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_search-with-autocomplete.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_select-with-search.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_service-navigation.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +3 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_sub-navigation-menu.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_summary-banner.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_summary-card.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_tag.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +7 -7
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +9 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_media-player.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +3 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +5 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_index.scss +0 -1
- data/app/views/govuk_publishing_components/components/_date_input.html.erb +16 -10
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +81 -74
- data/app/views/govuk_publishing_components/components/_option_select.html.erb +9 -20
- data/app/views/govuk_publishing_components/components/docs/date_input.yml +23 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/choices.js/README.md +1 -1
- data/node_modules/choices.js/package.json +5 -9
- data/node_modules/choices.js/public/assets/scripts/choices.js +32 -23
- data/node_modules/choices.js/public/assets/scripts/choices.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.mjs +32 -23
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.js +31 -22
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.search-basic.mjs +31 -22
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.js +30 -21
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.search-kmp.mjs +30 -21
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.js +30 -21
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.min.js +2 -2
- data/node_modules/choices.js/public/assets/scripts/choices.search-prefix.mjs +30 -21
- data/node_modules/choices.js/public/types/src/scripts/choices.d.ts +3 -3
- data/node_modules/choices.js/public/types/src/scripts/interfaces/templates.d.ts +1 -1
- data/node_modules/choices.js/src/scripts/choices.ts +30 -25
- data/node_modules/choices.js/src/scripts/components/dropdown.ts +7 -3
- data/node_modules/choices.js/src/scripts/interfaces/templates.ts +1 -1
- data/node_modules/choices.js/src/scripts/templates.ts +8 -3
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_accordion.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_back-link.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +7 -3
- data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_breadcrumbs.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +8 -4
- data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_button.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_character-count.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_checkboxes.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +10 -6
- data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_cookie-banner.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_date-input.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/details/_details.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_error-message.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_error-summary.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_exit-this-page.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_fieldset.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/fieldset/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_file-upload.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_footer.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_header.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_hint.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/input/_input.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_inset-text.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/label/_label.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +6 -2
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_notification-banner.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/pagination/_pagination.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/panel/_panel.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/password-input/_password-input.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_phase-banner.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +14 -10
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/radios/_radios.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/select/_select.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_service-navigation.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -3
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_skip-link.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +15 -2
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_summary-list.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/table/_table.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +5 -2
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tabs/_tabs.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/tag/_tag.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +6 -2
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/task-list/_task-list.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/textarea/_textarea.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_warning-text.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_global-styles.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +4 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_links.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +10 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +14 -13
- data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +38 -70
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_device-pixels.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +4 -4
- data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +17 -15
- data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss +2 -2
- data/node_modules/govuk-frontend/dist/govuk/helpers/_shape-arrow.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +19 -13
- data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +48 -26
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss +13 -11
- data/node_modules/govuk-frontend/dist/govuk/helpers/_visually-hidden.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/objects/_grid.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +10 -9
- data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_spacing.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_text-align.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +7 -2
- data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss +18 -0
- data/node_modules/govuk-frontend/dist/govuk/settings/_assets.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +28 -4
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/settings/_links.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss +8 -16
- data/node_modules/govuk-frontend/dist/govuk/settings/_measurements.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss +4 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_typography-font.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss +15 -2
- data/node_modules/govuk-frontend/dist/govuk/settings/_warnings.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss +3 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_exports.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss +13 -5
- data/node_modules/govuk-frontend/dist/govuk/tools/_font-url.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss +24 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_if.scss.map +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss +13 -5
- data/node_modules/govuk-frontend/dist/govuk/tools/_image-url.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +5 -3
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +4 -2
- data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_index.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss +3 -0
- data/node_modules/govuk-frontend/dist/govuk/utilities/_visually-hidden.scss.map +1 -1
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss +3 -1
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/init.scss.map +1 -1
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
- data/node_modules/govuk-frontend/package.json +7 -7
- metadata +4 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_grid-helper.scss +0 -145
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d6a8ca8a18729239925c15778ecfe6f9e699c8c1531d199e3259ed084c2b40f
|
|
4
|
+
data.tar.gz: f94b13c75a3b38547a27716a5b40252b8a62a83cd609365c056eb578d6901741
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5318a3a3ddda3807aedfa588342b942574d5d863ca064d553b9fd83beb0a9817e927f0e8583bd76a9dd90a344b7961e7f4c8c6bcbbb0f1bc2d32bfdc01575b1c
|
|
7
|
+
data.tar.gz: bca644a69295230d4e4715a01819589b4e50c11c84e47b5410772e4b614b9d7bcbf109680b50015a63907195dea5f7eaa586672e18c0f5115507a11815c54706
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
this.useSelectCount = this.module.hasAttribute('data-ga4-form-use-select-count')
|
|
12
12
|
this.redacted = false
|
|
13
13
|
this.useFallbackValue = this.module.hasAttribute('data-ga4-form-no-answer-undefined') ? undefined : 'No answer given'
|
|
14
|
+
this.piiRemover = new window.GOVUK.analyticsGa4.PIIRemover()
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
Ga4FormTracker.prototype.init = function () {
|
|
@@ -117,6 +118,8 @@
|
|
|
117
118
|
|
|
118
119
|
var isDateField = elem.closest('.govuk-date-input')
|
|
119
120
|
|
|
121
|
+
var forceReportValue = elem.hasAttribute('data-ga4-force-report-value-in-form-tracker')
|
|
122
|
+
|
|
120
123
|
if (conditionalCheckbox && !conditionalCheckboxChecked) {
|
|
121
124
|
// don't include conditional field if condition not checked
|
|
122
125
|
inputs.splice(i, 1)
|
|
@@ -146,25 +149,10 @@
|
|
|
146
149
|
// if placeholder value in select, do not include as not filled in
|
|
147
150
|
inputs.splice(i, 1)
|
|
148
151
|
} else {
|
|
149
|
-
input.answer = this.
|
|
152
|
+
input.answer = this.getInputAnswerFromSelect(selectedOptions, forceReportValue)
|
|
150
153
|
}
|
|
151
154
|
} else if (isTextField && elem.value) {
|
|
152
|
-
|
|
153
|
-
if (this.useTextCount && !isDateField) {
|
|
154
|
-
input.answer = elem.value.length
|
|
155
|
-
} else {
|
|
156
|
-
var PIIRemover = new window.GOVUK.analyticsGa4.PIIRemover()
|
|
157
|
-
input.answer = PIIRemover.stripPIIWithOverride(elem.value, true, true)
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
// if recording JSON and text input not allowed
|
|
161
|
-
// set the specific answer to '[REDACTED]'
|
|
162
|
-
if (this.recordJson) {
|
|
163
|
-
input.answer = '[REDACTED]'
|
|
164
|
-
} else {
|
|
165
|
-
this.redacted = true
|
|
166
|
-
}
|
|
167
|
-
}
|
|
155
|
+
input.answer = this.getInputAnswerFromText(elem, isDateField, forceReportValue)
|
|
168
156
|
} else if (inputType === 'file') {
|
|
169
157
|
input.answer = elem.files.length + ' files chosen'
|
|
170
158
|
} else {
|
|
@@ -201,6 +189,45 @@
|
|
|
201
189
|
return inputs
|
|
202
190
|
}
|
|
203
191
|
|
|
192
|
+
Ga4FormTracker.prototype.getInputAnswerFromSelect = function (selectedOptions, forceReportValue) {
|
|
193
|
+
var joinedSelections = selectedOptions.join(',')
|
|
194
|
+
|
|
195
|
+
if (forceReportValue) {
|
|
196
|
+
return joinedSelections
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (this.useSelectCount && selectedOptions.length > 1) {
|
|
200
|
+
return selectedOptions.length
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return joinedSelections
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
Ga4FormTracker.prototype.getInputAnswerFromText = function (inputElement, isDateField, forceReportValue) {
|
|
207
|
+
var willRecordInputValue = this.includeTextInputValues || inputElement.hasAttribute('data-ga4-form-include-input')
|
|
208
|
+
var willReplaceInputValueWithLength = this.useTextCount && !isDateField
|
|
209
|
+
|
|
210
|
+
if (forceReportValue) {
|
|
211
|
+
willReplaceInputValueWithLength = false
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (willRecordInputValue) {
|
|
215
|
+
if (willReplaceInputValueWithLength) {
|
|
216
|
+
return inputElement.value.length
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return this.piiRemover.stripPIIWithOverride(inputElement.value, true, true)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// if recording JSON when recording text input not allowed
|
|
223
|
+
// set the specific answer to '[REDACTED]'
|
|
224
|
+
if (this.recordJson) {
|
|
225
|
+
return '[REDACTED]'
|
|
226
|
+
} else {
|
|
227
|
+
this.redacted = true
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
204
231
|
Ga4FormTracker.prototype.combineGivenAnswers = function (data) {
|
|
205
232
|
var answers = this.recordJson ? {} : []
|
|
206
233
|
|
data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js
CHANGED
|
@@ -1,89 +1,51 @@
|
|
|
1
1
|
(function (Modules) {
|
|
2
|
-
|
|
2
|
+
const SETTINGS = {
|
|
3
3
|
label: {
|
|
4
4
|
hide: 'data-text-for-hide',
|
|
5
5
|
show: 'data-text-for-show'
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
// Small helpers that update the label when the state of the button has
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var newLabel = $button.getAttribute(SETTINGS.label[showOrHide])
|
|
9
|
+
// Small helpers that update the label when the state of the button has changed:
|
|
10
|
+
const setLabel = function (button, showOrHide) {
|
|
11
|
+
const newLabel = button.getAttribute(SETTINGS.label[showOrHide])
|
|
13
12
|
|
|
14
13
|
if (newLabel) {
|
|
15
|
-
|
|
14
|
+
button.setAttribute('aria-label', newLabel)
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
// Wrapper functions to contain all of the mechanisms needed for hiding and
|
|
20
19
|
// toggling the menus.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
setLabel(
|
|
20
|
+
const hide = function (button, menu) {
|
|
21
|
+
button.setAttribute('aria-expanded', false)
|
|
22
|
+
button.classList.remove('gem-c-layout-super-navigation-header__open-button')
|
|
23
|
+
menu.setAttribute('hidden', 'hidden')
|
|
24
|
+
setLabel(button, 'show')
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
|
|
27
|
+
const show = function (button, menu) {
|
|
28
|
+
button.setAttribute('aria-expanded', true)
|
|
29
|
+
button.classList.add('gem-c-layout-super-navigation-header__open-button')
|
|
30
|
+
menu.removeAttribute('hidden')
|
|
31
|
+
setLabel(button, 'hide')
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const toggle = function (button, menu) {
|
|
35
|
+
const isOpen = button.getAttribute('aria-expanded') === 'true'
|
|
36
36
|
if (isOpen) {
|
|
37
|
-
hide(
|
|
37
|
+
hide(button, menu)
|
|
38
38
|
} else {
|
|
39
|
-
show(
|
|
39
|
+
show(button, menu)
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// returned; if not it recursively checks to see if the parent element is a
|
|
50
|
-
// `elementType`. This means that it can be used with `pointer-events: none`.
|
|
51
|
-
var closestParentIncluding = function ($element, elementType) {
|
|
52
|
-
if ($element.tagName.toLowerCase() === elementType.toLowerCase()) {
|
|
53
|
-
return $element
|
|
54
|
-
}
|
|
55
|
-
return closestParentIncluding($element.parentNode, elementType)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Searched the previous elements to find one with the same tag as set in
|
|
59
|
-
// `elementType` . If it's found the element is returned; if not, it returns
|
|
60
|
-
// null.
|
|
61
|
-
var closestPrevious = function ($element, elementType) {
|
|
62
|
-
if ($element === null) {
|
|
63
|
-
return null
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Using `previousSibling` means that there is a possibility that the
|
|
67
|
-
// $element could be a text node or a comment node - checking the `nodeType`
|
|
68
|
-
// of the element will ensure that it's a real element.
|
|
69
|
-
if ($element.nodeType === 1 && $element.tagName.toLowerCase() === elementType.toLowerCase()) {
|
|
70
|
-
return $element
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// If `previousElementSibling` can be used then let's use it as it'll be
|
|
74
|
-
// slightly faster since it skips things that aren't elements. If not,
|
|
75
|
-
// `previousSibling` can still be used as there's a `nodeType` check.
|
|
76
|
-
var previousElement = $element.previousElementSibling || $element.previousSibling
|
|
77
|
-
|
|
78
|
-
return closestPrevious(previousElement, elementType)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function SuperNavigationMegaMenu ($module) {
|
|
82
|
-
this.$module = $module
|
|
83
|
-
this.$searchToggle = this.$module.querySelector('#super-search-menu-toggle')
|
|
84
|
-
this.$searchMenu = this.$module.querySelector('#super-search-menu')
|
|
85
|
-
this.$navToggle = this.$module.querySelector('#super-navigation-menu-toggle')
|
|
86
|
-
this.$navMenu = this.$module.querySelector('#super-navigation-menu')
|
|
43
|
+
function SuperNavigationMegaMenu (module) {
|
|
44
|
+
this.module = module
|
|
45
|
+
this.searchToggle = this.module.querySelector('#super-search-menu-toggle')
|
|
46
|
+
this.searchMenu = this.module.querySelector('#super-search-menu')
|
|
47
|
+
this.navToggle = this.module.querySelector('#super-navigation-menu-toggle')
|
|
48
|
+
this.navMenu = this.module.querySelector('#super-navigation-menu')
|
|
87
49
|
|
|
88
50
|
// The menu toggler buttons need three attributes for this to work:
|
|
89
51
|
// - `aria-controls` contains the id of the menu to be toggled
|
|
@@ -91,132 +53,129 @@
|
|
|
91
53
|
// smaller screens
|
|
92
54
|
// - `data-toggle-desktop-group` is the group that the menu belongs to on
|
|
93
55
|
// larger screens
|
|
94
|
-
this
|
|
56
|
+
this.buttons = this.module.querySelectorAll(
|
|
95
57
|
'button[aria-controls][data-toggle-mobile-group][data-toggle-desktop-group]'
|
|
96
58
|
)
|
|
97
59
|
|
|
98
|
-
this.hiddenButtons = this
|
|
60
|
+
this.hiddenButtons = this.module.querySelectorAll('button[hidden]')
|
|
99
61
|
}
|
|
100
62
|
|
|
101
63
|
SuperNavigationMegaMenu.prototype.buttonHandler = function (event) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
for (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
hide($element, $menu)
|
|
64
|
+
const target = event.target.closest('button')
|
|
65
|
+
const targetMenu = this.module.querySelector('#' + target.getAttribute('aria-controls'))
|
|
66
|
+
|
|
67
|
+
const toggleGroupAttribute = 'data-toggle-desktop-group'
|
|
68
|
+
const toggleGroupName = target.getAttribute(toggleGroupAttribute)
|
|
69
|
+
const toggleGroupList = this.module.querySelectorAll('[' + toggleGroupAttribute + '="' + toggleGroupName + '"]')
|
|
70
|
+
|
|
71
|
+
for (const element of toggleGroupList) {
|
|
72
|
+
if (element !== target) {
|
|
73
|
+
const menu = this.module.querySelector('#' + element.getAttribute('aria-controls'))
|
|
74
|
+
hide(element, menu)
|
|
114
75
|
}
|
|
115
76
|
}
|
|
116
77
|
|
|
117
|
-
toggle(
|
|
78
|
+
toggle(target, targetMenu)
|
|
118
79
|
}
|
|
119
80
|
|
|
120
81
|
SuperNavigationMegaMenu.prototype.handleKeyDown = function (event) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
82
|
+
if (event.key !== 'Tab' && event.key !== 'Escape') {
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const navMenuLinks = this.navMenu.querySelectorAll('li a')
|
|
87
|
+
const firstNavLink = navMenuLinks[0]
|
|
88
|
+
const lastNavLink = navMenuLinks[navMenuLinks.length - 1]
|
|
89
|
+
const searchMenuTabbable = this.searchMenu.querySelectorAll('li a, input, button')
|
|
90
|
+
const lastSearchMenuTabbable = searchMenuTabbable[searchMenuTabbable.length - 1]
|
|
91
|
+
|
|
92
|
+
if (event.key === 'Tab') {
|
|
93
|
+
if (!this.navMenu.hasAttribute('hidden')) {
|
|
131
94
|
switch (document.activeElement) {
|
|
132
|
-
case this
|
|
95
|
+
case this.navToggle:
|
|
133
96
|
if (!event.shiftKey) {
|
|
134
97
|
event.preventDefault()
|
|
135
|
-
|
|
98
|
+
firstNavLink.focus()
|
|
136
99
|
}
|
|
137
100
|
break
|
|
138
|
-
case
|
|
101
|
+
case lastNavLink:
|
|
139
102
|
if (!event.shiftKey) {
|
|
140
103
|
event.preventDefault()
|
|
141
|
-
this
|
|
142
|
-
hide(this
|
|
104
|
+
this.searchToggle.focus()
|
|
105
|
+
hide(this.navToggle, this.navMenu)
|
|
143
106
|
}
|
|
144
107
|
break
|
|
145
|
-
case
|
|
108
|
+
case firstNavLink:
|
|
146
109
|
if (event.shiftKey) {
|
|
147
110
|
event.preventDefault()
|
|
148
|
-
this
|
|
111
|
+
this.navToggle.focus()
|
|
149
112
|
}
|
|
150
113
|
break
|
|
151
|
-
case this
|
|
114
|
+
case this.searchToggle:
|
|
152
115
|
if (event.shiftKey) {
|
|
153
116
|
event.preventDefault()
|
|
154
|
-
|
|
117
|
+
lastNavLink.focus()
|
|
155
118
|
}
|
|
156
119
|
break
|
|
157
120
|
default:
|
|
158
121
|
break
|
|
159
122
|
}
|
|
160
|
-
} else if (!this
|
|
161
|
-
if (document.activeElement ===
|
|
123
|
+
} else if (!this.searchMenu.hasAttribute('hidden')) {
|
|
124
|
+
if (document.activeElement === lastSearchMenuTabbable) {
|
|
162
125
|
if (!event.shiftKey) {
|
|
163
|
-
hide(this
|
|
126
|
+
hide(this.searchToggle, this.searchMenu)
|
|
164
127
|
}
|
|
165
128
|
}
|
|
166
129
|
}
|
|
167
|
-
} else if (event.
|
|
168
|
-
if (!this
|
|
169
|
-
hide(this
|
|
170
|
-
this
|
|
171
|
-
} else if (!this
|
|
172
|
-
hide(this
|
|
173
|
-
this
|
|
130
|
+
} else if (event.key === 'Escape') {
|
|
131
|
+
if (!this.navMenu.hasAttribute('hidden')) {
|
|
132
|
+
hide(this.navToggle, this.navMenu)
|
|
133
|
+
this.navToggle.focus()
|
|
134
|
+
} else if (!this.searchMenu.hasAttribute('hidden')) {
|
|
135
|
+
hide(this.searchToggle, this.searchMenu)
|
|
136
|
+
this.searchToggle.focus()
|
|
174
137
|
}
|
|
175
138
|
}
|
|
176
139
|
}
|
|
177
140
|
|
|
178
141
|
SuperNavigationMegaMenu.prototype.init = function () {
|
|
179
142
|
// Handle key events for tab and escape keys
|
|
180
|
-
this
|
|
143
|
+
this.module.addEventListener('keydown', this.handleKeyDown.bind(this))
|
|
181
144
|
|
|
182
|
-
for (
|
|
183
|
-
|
|
184
|
-
$button.addEventListener('click', this.buttonHandler.bind(this), true)
|
|
145
|
+
for (const button of this.buttons) {
|
|
146
|
+
button.addEventListener('click', this.buttonHandler.bind(this), true)
|
|
185
147
|
}
|
|
186
148
|
|
|
187
|
-
//
|
|
188
|
-
//
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
closestSiblingLink.setAttribute('hidden', 'hidden')
|
|
149
|
+
// Reveal toggle buttons hidden by default in HTML for non-JavaScript users
|
|
150
|
+
// and hide the fallback links now that JavaScript is available.
|
|
151
|
+
for (const element of this.hiddenButtons) {
|
|
152
|
+
element.removeAttribute('hidden')
|
|
153
|
+
|
|
154
|
+
let sibling = element.previousElementSibling
|
|
155
|
+
|
|
156
|
+
// Find and hide the preceding no JavaScript fallback links
|
|
157
|
+
while (sibling) {
|
|
158
|
+
if (sibling.matches('a')) {
|
|
159
|
+
sibling.setAttribute('hidden', 'hidden')
|
|
160
|
+
break
|
|
161
|
+
}
|
|
162
|
+
sibling = sibling.previousElementSibling
|
|
202
163
|
}
|
|
203
164
|
}
|
|
204
165
|
|
|
205
|
-
this
|
|
166
|
+
this.module.querySelector('.gem-c-layout-super-navigation-header__search-item-link')
|
|
206
167
|
.setAttribute('hidden', 'hidden')
|
|
207
168
|
|
|
208
169
|
// Navigation menu and search menu are hardcoded to be open in the markup -
|
|
209
|
-
// this means that the menu still makes sense with CSS and JavaScript turned
|
|
210
|
-
//
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
this.$module.classList.add('js-module-initialised')
|
|
170
|
+
// this means that the menu still makes sense with CSS and JavaScript turned off.
|
|
171
|
+
// The menus now need to be hidden as part of the JavaScript initialisation:
|
|
172
|
+
// - On both mobile and desktop, this means hiding the search menu
|
|
173
|
+
// - On mobile, this means hiding the navigation
|
|
174
|
+
// - On desktop, this means hiding the navigation button, showing the
|
|
175
|
+
// second level navigation menu
|
|
176
|
+
hide(this.searchToggle, this.searchMenu)
|
|
177
|
+
|
|
178
|
+
this.module.classList.add('js-module-initialised')
|
|
220
179
|
}
|
|
221
180
|
|
|
222
181
|
Modules.SuperNavigationMegaMenu = SuperNavigationMegaMenu
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
(function (Modules) {
|
|
2
|
-
/* This JavaScript provides two functional enhancements to option-select components:
|
|
3
|
-
1) A count that shows how many results have been checked in the option-container
|
|
4
|
-
2) Open/closing of the list of checkboxes
|
|
5
|
-
*/
|
|
6
2
|
function OptionSelect ($module) {
|
|
7
3
|
this.$optionSelect = $module
|
|
8
4
|
this.$options = this.$optionSelect.querySelectorAll("input[type='checkbox']")
|
|
9
5
|
this.$optionsContainer = this.$optionSelect.querySelector('.js-options-container')
|
|
10
6
|
this.$optionList = this.$optionsContainer.querySelector('.js-auto-height-inner')
|
|
11
7
|
this.$allCheckboxes = this.$optionsContainer.querySelectorAll('.govuk-checkboxes__item')
|
|
12
|
-
this.
|
|
8
|
+
this.filterAttributes = this.$optionSelect.getAttribute('data-filter-attributes')
|
|
13
9
|
|
|
14
10
|
this.checkedCheckboxes = []
|
|
15
11
|
|
|
@@ -19,15 +15,9 @@
|
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
OptionSelect.prototype.init = function () {
|
|
22
|
-
if (this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var optionSelectFilter = document.createElement('div')
|
|
27
|
-
optionSelectFilter.classList.add('gem-c-option-select__filter')
|
|
28
|
-
optionSelectFilter.innerHTML = filterEl.childNodes[0].nodeValue
|
|
29
|
-
|
|
30
|
-
this.$optionsContainer.parentNode.insertBefore(optionSelectFilter, this.$optionsContainer)
|
|
18
|
+
if (this.filterAttributes) {
|
|
19
|
+
this.filterAttributes = JSON.parse(this.filterAttributes)
|
|
20
|
+
this.$optionsContainer.parentNode.insertBefore(this.createFilter(), this.$optionsContainer)
|
|
31
21
|
|
|
32
22
|
this.$filter = this.$optionSelect.querySelector('input[name="option-select-filter"]')
|
|
33
23
|
this.$filterCount = document.getElementById(this.$filter.getAttribute('aria-describedby'))
|
|
@@ -73,6 +63,26 @@
|
|
|
73
63
|
}
|
|
74
64
|
}
|
|
75
65
|
|
|
66
|
+
OptionSelect.prototype.createFilter = function () {
|
|
67
|
+
const filter = document.createElement('div')
|
|
68
|
+
filter.classList.add('gem-c-option-select__filter')
|
|
69
|
+
|
|
70
|
+
const label = document.createElement('label')
|
|
71
|
+
label.classList.add('govuk-label', 'govuk-visually-hidden')
|
|
72
|
+
label.setAttribute('for', this.filterAttributes.id)
|
|
73
|
+
label.textContent = this.filterAttributes.title
|
|
74
|
+
|
|
75
|
+
const input = document.createElement('input')
|
|
76
|
+
input.classList.add('gem-c-option-select__filter-input', 'govuk-input')
|
|
77
|
+
input.name = 'option-select-filter'
|
|
78
|
+
input.id = this.filterAttributes.id
|
|
79
|
+
input.setAttribute('aria-describedby', this.filterAttributes.describedby)
|
|
80
|
+
input.setAttribute('aria-controls', this.filterAttributes.controls)
|
|
81
|
+
|
|
82
|
+
filter.append(label, input)
|
|
83
|
+
return filter
|
|
84
|
+
}
|
|
85
|
+
|
|
76
86
|
OptionSelect.prototype.toggleVisibility = function (isTabletOrLarger) {
|
|
77
87
|
if (isTabletOrLarger) {
|
|
78
88
|
if (this.isClosedOnLoad === 'true') {
|
|
@@ -142,8 +152,8 @@
|
|
|
142
152
|
|
|
143
153
|
var lenChecked = obj.$optionsContainer.querySelectorAll('.govuk-checkboxes__input:checked').length
|
|
144
154
|
var len = showCheckboxes.length + lenChecked
|
|
145
|
-
var
|
|
146
|
-
obj.$filterCount.
|
|
155
|
+
var hiddenText = len + (len === 1 ? obj.filterTextSingle : obj.filterTextMultiple) + ', ' + lenChecked + obj.filterTextSelected
|
|
156
|
+
obj.$filterCount.textContent = hiddenText
|
|
147
157
|
}
|
|
148
158
|
|
|
149
159
|
OptionSelect.prototype.replaceHeadingSpanWithButton = function replaceHeadingSpanWithButton () {
|
|
@@ -168,19 +168,20 @@
|
|
|
168
168
|
var thisel = this.$module.steps[i]
|
|
169
169
|
var title = thisel.querySelectorAll('.js-step-title')[0]
|
|
170
170
|
var contentId = thisel.querySelectorAll('.js-panel')[0].getAttribute('id')
|
|
171
|
-
var titleText = title.textContent
|
|
171
|
+
var titleText = title.textContent
|
|
172
172
|
|
|
173
173
|
title.outerHTML =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
174
|
+
`<span class="js-step-title">
|
|
175
|
+
<button class="gem-c-step-nav__button gem-c-step-nav__button--title js-step-title-button"
|
|
176
|
+
aria-expanded="false" aria-controls="${contentId}">
|
|
177
|
+
<span class="gem-c-step-nav____title-text-focus">
|
|
178
|
+
<span class="gem-c-step-nav__title-text js-step-title-text"></span>
|
|
179
|
+
<span class="govuk-visually-hidden gem-c-step-nav__section-heading-divider">, </span>
|
|
180
|
+
</span>
|
|
181
|
+
</button>
|
|
182
|
+
</span>`
|
|
183
|
+
|
|
184
|
+
thisel.querySelector('.gem-c-step-nav__title-text').textContent = titleText
|
|
184
185
|
|
|
185
186
|
if (this.$module.isGa4Enabled) {
|
|
186
187
|
var ga4JSON = {
|
data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js
CHANGED
|
@@ -45,9 +45,11 @@
|
|
|
45
45
|
<span class="govuk-heading-s">How to watch this YouTube video</span>
|
|
46
46
|
<span class="gem-c-govspeak__youtube-placeholder-text">There's a YouTube video on this page. You can't access it because of your cookie settings.</span>
|
|
47
47
|
<span class="gem-c-govspeak__youtube-placeholder-text">You can <a href="/help/cookies" class="govuk-link">change your cookie settings</a> or watch the video on YouTube instead:</span>
|
|
48
|
-
<a href="${href}" class="govuk-link"
|
|
48
|
+
<a href="${href}" class="govuk-link js-youtube-link"></a>
|
|
49
49
|
`
|
|
50
50
|
placeholder.innerHTML = markup
|
|
51
|
+
const link = placeholder.querySelector('.js-youtube-link')
|
|
52
|
+
link.textContent = text
|
|
51
53
|
$linkParent.after(placeholder)
|
|
52
54
|
$linkParent.classList.add('gem-c-govspeak__youtube-placeholder-link')
|
|
53
55
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// see https://github.com/alphagov/govuk_publishing_components/blob/main/docs/lib/trigger_event.md
|
|
2
|
-
(function (
|
|
2
|
+
(function () {
|
|
3
3
|
'use strict'
|
|
4
4
|
|
|
5
|
+
window.GOVUK = window.GOVUK || {}
|
|
6
|
+
|
|
5
7
|
window.GOVUK.triggerEvent = function (element, eventName, parameters) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
const params = parameters || {}
|
|
9
|
+
const keyCode = params.keyCode
|
|
10
|
+
const key = params.key
|
|
9
11
|
|
|
10
12
|
if (!Object.prototype.hasOwnProperty.call(params, 'bubbles')) {
|
|
11
13
|
params.bubbles = true
|
|
@@ -15,11 +17,10 @@
|
|
|
15
17
|
params.cancelable = true
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
event =
|
|
22
|
-
event.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail)
|
|
20
|
+
const event = new window.CustomEvent(eventName, params)
|
|
21
|
+
|
|
22
|
+
if (key) {
|
|
23
|
+
event.key = key
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
if (keyCode) {
|
|
@@ -30,6 +31,8 @@
|
|
|
30
31
|
event.shiftKey = true
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
element.dispatchEvent
|
|
34
|
+
if (element && typeof element.dispatchEvent === 'function') {
|
|
35
|
+
element.dispatchEvent(event)
|
|
36
|
+
}
|
|
34
37
|
}
|
|
35
|
-
}(
|
|
38
|
+
}())
|
|
@@ -15,7 +15,7 @@ $gem-guide-border-width: 1px;
|
|
|
15
15
|
border: 3px solid govuk-functional-colour(error);
|
|
16
16
|
margin: 0 0 govuk-spacing(6);
|
|
17
17
|
padding: govuk-spacing(6);
|
|
18
|
-
|
|
18
|
+
color: govuk-functional-colour(text);
|
|
19
19
|
|
|
20
20
|
.component-violation__title {
|
|
21
21
|
margin: 0;
|
|
@@ -68,7 +68,7 @@ $gem-guide-border-width: 1px;
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.component-guide-preview {
|
|
71
|
-
padding: govuk-spacing(8) govuk-spacing(6) govuk-spacing(6)
|
|
71
|
+
padding: govuk-spacing(8) govuk-spacing(6) govuk-spacing(6);
|
|
72
72
|
border: $gem-guide-border-width solid govuk-functional-colour(border);
|
|
73
73
|
position: relative;
|
|
74
74
|
margin-bottom: govuk-spacing(8);
|
|
@@ -115,8 +115,8 @@ $gem-guide-border-width: 1px;
|
|
|
115
115
|
.component-guide-preview--violation,
|
|
116
116
|
.component-guide-preview--warning {
|
|
117
117
|
margin-top: -$gem-guide-border-width;
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
|
|
119
|
+
color: govuk-functional-colour(text);
|
|
120
120
|
@include govuk-font($size: 19);
|
|
121
121
|
|
|
122
122
|
&:empty {
|
|
@@ -475,7 +475,7 @@ $code-delete-bg: #fadddd;
|
|
|
475
475
|
|
|
476
476
|
.gem-full-width__container {
|
|
477
477
|
container-type: inline-size;
|
|
478
|
-
container-name:
|
|
478
|
+
container-name: gem-page;
|
|
479
479
|
}
|
|
480
480
|
|
|
481
481
|
.full-width__table-wrapper {
|
|
@@ -500,7 +500,7 @@ $code-delete-bg: #fadddd;
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
@container
|
|
503
|
+
@container gem-page (width > 1040px) {
|
|
504
504
|
$w: 960px;
|
|
505
505
|
|
|
506
506
|
.gem-full-width__element {
|
|
@@ -529,7 +529,7 @@ $code-delete-bg: #fadddd;
|
|
|
529
529
|
.govuk-tabs {
|
|
530
530
|
$w: 920px;
|
|
531
531
|
|
|
532
|
-
@container
|
|
532
|
+
@container gem-page (width > 1040px) {
|
|
533
533
|
.full-width__table-wrapper {
|
|
534
534
|
margin-left: calc(((-100cqw + $w) / 2) - 1px);
|
|
535
535
|
margin-right: calc(((-100cqw + $w) / 2) - 1px);
|