govuk_publishing_components 35.3.3 → 35.3.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-ga4/ga4-core.js +4 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +1 -1
- data/app/assets/stylesheets/component_guide/application.scss +37 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +10 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +0 -24
- data/app/views/govuk_publishing_components/component_guide/example.html.erb +1 -1
- data/app/views/govuk_publishing_components/component_guide/preview.html.erb +1 -1
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +6 -2
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/metadata.yml +1 -3
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +5 -5
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +1 -0
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +1 -1
- data/app/views/layouts/govuk_publishing_components/application.html.erb +1 -0
- data/config/locales/en.yml +2 -2
- data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +4 -0
- data/lib/govuk_publishing_components/presenters/breadcrumbs_helper.rb +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/axe.d.ts +77 -6
- data/node_modules/axe-core/axe.js +955 -600
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/locales/_template.json +6 -6
- data/node_modules/axe-core/locales/ja.json +91 -11
- data/node_modules/axe-core/package.json +5 -5
- data/node_modules/axe-core/sri-history.json +4 -0
- data/node_modules/govuk-frontend/README.md +4 -5
- data/node_modules/govuk-frontend/govuk/all-ie8.scss +8 -0
- data/node_modules/govuk-frontend/govuk/all.js +738 -258
- data/node_modules/govuk-frontend/govuk/all.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +11 -7
- data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/common/govuk-frontend-version.js +17 -0
- data/node_modules/govuk-frontend/govuk/common/govuk-frontend-version.js.map +1 -0
- data/node_modules/govuk-frontend/govuk/common/index.js +16 -4
- data/node_modules/govuk-frontend/govuk/common/index.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +20 -10
- data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/common.js +16 -4
- data/node_modules/govuk-frontend/govuk/common.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +3 -3
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +234 -86
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +32 -13
- data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +8 -2
- data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +1 -0
- data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/back-link/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +12 -12
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +8 -6
- data/node_modules/govuk-frontend/govuk/components/button/button.js +54 -19
- data/node_modules/govuk-frontend/govuk/components/button/button.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +11 -1
- data/node_modules/govuk-frontend/govuk/components/button/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/button/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +170 -76
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +24 -24
- data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +3 -3
- data/node_modules/govuk-frontend/govuk/components/checkboxes/_index.scss +6 -6
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +75 -24
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +47 -47
- data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/checkboxes/template.njk +3 -3
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +24 -24
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +26 -26
- data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/date-input/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/details/details.js +39 -13
- data/node_modules/govuk-frontend/govuk/components/details/details.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/details/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +10 -10
- data/node_modules/govuk-frontend/govuk/components/error-message/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +67 -27
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +19 -19
- data/node_modules/govuk-frontend/govuk/components/error-summary/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +19 -19
- data/node_modules/govuk-frontend/govuk/components/fieldset/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +6 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +14 -14
- data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/file-upload/template.njk +2 -1
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +0 -7
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +24 -24
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +22 -22
- data/node_modules/govuk-frontend/govuk/components/header/header.js +46 -14
- data/node_modules/govuk-frontend/govuk/components/header/header.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/hint/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/input/_index.scss +15 -3
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +54 -41
- data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/input/template.njk +2 -1
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/inset-text/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +6 -6
- data/node_modules/govuk-frontend/govuk/components/label/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/notification-banner/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +49 -22
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +16 -16
- data/node_modules/govuk-frontend/govuk/components/pagination/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +10 -10
- data/node_modules/govuk-frontend/govuk/components/panel/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/phase-banner/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/radios/_index.scss +5 -5
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +46 -46
- data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +65 -22
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/radios/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/select/_index.scss +7 -1
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +19 -20
- data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/select/template.njk +5 -2
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/skip-link/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +41 -13
- data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +34 -34
- data/node_modules/govuk-frontend/govuk/components/summary-list/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +21 -21
- data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +15 -15
- data/node_modules/govuk-frontend/govuk/components/tabs/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +178 -60
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/components/tabs/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/tag/_index.scss +18 -18
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/tag/macro-options.json +1 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/_index.scss +8 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +18 -18
- data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +7 -1
- data/node_modules/govuk-frontend/govuk/components/textarea/template.njk +2 -1
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +9 -5
- data/node_modules/govuk-frontend/govuk/components/warning-text/macro-options.json +3 -3
- data/node_modules/govuk-frontend/govuk/components/warning-text/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/core/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/core/_govuk-frontend-version.scss +5 -0
- data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +5 -2
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_font-faces.scss +1 -1
- data/node_modules/govuk-frontend/govuk/i18n.js +38 -30
- data/node_modules/govuk-frontend/govuk/i18n.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/macros/i18n.njk +12 -11
- data/node_modules/govuk-frontend/govuk/objects/_width-container.scss +1 -1
- data/node_modules/govuk-frontend/govuk/settings/_colours-organisations.scss +4 -0
- data/node_modules/govuk-frontend/govuk/settings/_ie8.scss +16 -0
- data/node_modules/govuk-frontend/govuk/settings/_links.scss +5 -1
- data/node_modules/govuk-frontend/govuk/tools/_ie8.scss +38 -2
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js +2 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/DOMTokenList.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +2 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js +2 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Document.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js +10 -3
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/classList.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js +4 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/closest.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +13 -7
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js +2 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/matches.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js +8 -2
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/nextElementSibling.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js +8 -2
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/previousElementSibling.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js +4 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js +10 -3
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Event.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js +4 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Function/prototype/bind.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js +2 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Object/defineProperty.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +3 -2
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js.map +1 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js +2 -1
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Window.js.map +1 -1
- data/node_modules/govuk-frontend/govuk-esm/all.mjs +81 -60
- data/node_modules/govuk-frontend/govuk-esm/all.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/common/closest-attribute-value.mjs +12 -8
- data/node_modules/govuk-frontend/govuk-esm/common/closest-attribute-value.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/common/govuk-frontend-version.mjs +9 -0
- data/node_modules/govuk-frontend/govuk-esm/common/govuk-frontend-version.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/common/index.mjs +44 -29
- data/node_modules/govuk-frontend/govuk-esm/common/index.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs +15 -9
- data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/common.mjs +3 -5
- data/node_modules/govuk-frontend/govuk-esm/common.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +319 -211
- data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +47 -30
- data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +169 -115
- data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +88 -51
- data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +64 -54
- data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +69 -50
- data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +59 -35
- data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +36 -25
- data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +67 -38
- data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +49 -32
- data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +263 -163
- data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/i18n.mjs +68 -57
- data/node_modules/govuk-frontend/govuk-esm/i18n.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/DOMTokenList.mjs +5 -3
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/DOMTokenList.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Date/now.mjs +4 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Date/now.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Document.mjs +4 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Document.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/classList.mjs +7 -4
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/classList.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/closest.mjs +5 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/closest.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/dataset.mjs +13 -10
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/dataset.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/matches.mjs +4 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/matches.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/nextElementSibling.mjs +6 -3
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/nextElementSibling.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/previousElementSibling.mjs +6 -3
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/previousElementSibling.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element.mjs +5 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Event.mjs +7 -4
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Event.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/bind.mjs +5 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Function/prototype/bind.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/defineProperty.mjs +4 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Object/defineProperty.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/String/prototype/trim.mjs +5 -3
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/String/prototype/trim.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Window.mjs +4 -2
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Window.mjs.map +1 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit/init.js +1 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +2 -1
- data/node_modules/govuk-frontend/package.json +3 -2
- metadata +44 -7
- /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_13px.png → dbt_crest_13px.png} +0 -0
- /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_13px_x2.png → dbt_crest_13px_x2.png} +0 -0
- /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_18px.png → dbt_crest_18px.png} +0 -0
- /data/app/assets/images/govuk_publishing_components/crests/{dit_crest_18px_x2.png → dbt_crest_18px_x2.png} +0 -0
@@ -1,14 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';
|
2
|
+
import { extractConfigByNamespace, mergeConfigs } from '../../common/index.mjs';
|
3
|
+
import { normaliseDataset } from '../../common/normalise-dataset.mjs';
|
4
|
+
import { I18n } from '../../i18n.mjs';
|
5
|
+
import '../../vendor/polyfills/Date/now.mjs';
|
6
|
+
import '../../vendor/polyfills/Element/prototype/classList.mjs';
|
7
|
+
import '../../vendor/polyfills/Event.mjs';
|
8
|
+
import '../../vendor/polyfills/Function/prototype/bind.mjs';
|
3
9
|
|
4
|
-
|
5
|
-
import { extractConfigByNamespace, mergeConfigs } from '../../common/index.mjs'
|
6
|
-
import { normaliseDataset } from '../../common/normalise-dataset.mjs'
|
7
|
-
import { I18n } from '../../i18n.mjs'
|
8
|
-
import '../../vendor/polyfills/Date/now.mjs'
|
9
|
-
import '../../vendor/polyfills/Element/prototype/classList.mjs'
|
10
|
-
import '../../vendor/polyfills/Event.mjs' // addEventListener, event.target normalization and DOMContentLoaded
|
11
|
-
import '../../vendor/polyfills/Function/prototype/bind.mjs'
|
10
|
+
/* eslint-disable es-x/no-date-now -- Polyfill imported */
|
12
11
|
|
13
12
|
/**
|
14
13
|
* @constant
|
@@ -40,7 +39,7 @@ var CHARACTER_COUNT_TRANSLATIONS = {
|
|
40
39
|
textareaDescription: {
|
41
40
|
other: ''
|
42
41
|
}
|
43
|
-
}
|
42
|
+
};
|
44
43
|
|
45
44
|
/**
|
46
45
|
* JavaScript enhancements for the CharacterCount component
|
@@ -53,21 +52,31 @@ var CHARACTER_COUNT_TRANSLATIONS = {
|
|
53
52
|
* of the available characters/words has been entered.
|
54
53
|
*
|
55
54
|
* @class
|
56
|
-
* @param {
|
55
|
+
* @param {Element} $module - HTML element to use for character count
|
57
56
|
* @param {CharacterCountConfig} [config] - Character count config
|
58
57
|
*/
|
59
58
|
function CharacterCount ($module, config) {
|
60
|
-
if (
|
59
|
+
if (!($module instanceof HTMLElement)) {
|
60
|
+
return this
|
61
|
+
}
|
62
|
+
|
63
|
+
var $textarea = $module.querySelector('.govuk-js-character-count');
|
64
|
+
if (
|
65
|
+
!(
|
66
|
+
$textarea instanceof HTMLTextAreaElement ||
|
67
|
+
$textarea instanceof HTMLInputElement
|
68
|
+
)
|
69
|
+
) {
|
61
70
|
return this
|
62
71
|
}
|
63
72
|
|
64
73
|
var defaultConfig = {
|
65
74
|
threshold: 0,
|
66
75
|
i18n: CHARACTER_COUNT_TRANSLATIONS
|
67
|
-
}
|
76
|
+
};
|
68
77
|
|
69
78
|
// Read config set using dataset ('data-' values)
|
70
|
-
var datasetConfig = normaliseDataset($module.dataset)
|
79
|
+
var datasetConfig = normaliseDataset($module.dataset);
|
71
80
|
|
72
81
|
// To ensure data-attributes take complete precedence, even if they change the
|
73
82
|
// type of count, we need to reset the `maxlength` and `maxwords` from the
|
@@ -75,40 +84,62 @@ function CharacterCount ($module, config) {
|
|
75
84
|
//
|
76
85
|
// We can't mutate `config`, though, as it may be shared across multiple
|
77
86
|
// components inside `initAll`.
|
78
|
-
var configOverrides = {}
|
87
|
+
var configOverrides = {};
|
79
88
|
if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {
|
80
89
|
configOverrides = {
|
81
90
|
maxlength: false,
|
82
91
|
maxwords: false
|
83
|
-
}
|
92
|
+
};
|
84
93
|
}
|
85
94
|
|
95
|
+
/**
|
96
|
+
* @deprecated Will be made private in v5.0
|
97
|
+
* @type {CharacterCountConfig}
|
98
|
+
*/
|
86
99
|
this.config = mergeConfigs(
|
87
100
|
defaultConfig,
|
88
101
|
config || {},
|
89
102
|
configOverrides,
|
90
103
|
datasetConfig
|
91
|
-
)
|
104
|
+
);
|
92
105
|
|
106
|
+
/** @deprecated Will be made private in v5.0 */
|
93
107
|
this.i18n = new I18n(extractConfigByNamespace(this.config, 'i18n'), {
|
94
108
|
// Read the fallback if necessary rather than have it set in the defaults
|
95
109
|
locale: closestAttributeValue($module, 'lang')
|
96
|
-
})
|
110
|
+
});
|
97
111
|
|
112
|
+
/** @deprecated Will be made private in v5.0 */
|
113
|
+
this.maxLength = Infinity;
|
98
114
|
// Determine the limit attribute (characters or words)
|
99
|
-
if (this.config.maxwords) {
|
100
|
-
this.maxLength = this.config.maxwords
|
101
|
-
} else if (this.config.maxlength) {
|
102
|
-
this.maxLength = this.config.maxlength
|
115
|
+
if ('maxwords' in this.config && this.config.maxwords) {
|
116
|
+
this.maxLength = this.config.maxwords;
|
117
|
+
} else if ('maxlength' in this.config && this.config.maxlength) {
|
118
|
+
this.maxLength = this.config.maxlength;
|
103
119
|
} else {
|
104
120
|
return
|
105
121
|
}
|
106
122
|
|
107
|
-
|
108
|
-
this.$
|
109
|
-
|
110
|
-
|
111
|
-
this
|
123
|
+
/** @deprecated Will be made private in v5.0 */
|
124
|
+
this.$module = $module;
|
125
|
+
|
126
|
+
/** @deprecated Will be made private in v5.0 */
|
127
|
+
this.$textarea = $textarea;
|
128
|
+
|
129
|
+
/** @deprecated Will be made private in v5.0 */
|
130
|
+
this.$visibleCountMessage = null;
|
131
|
+
|
132
|
+
/** @deprecated Will be made private in v5.0 */
|
133
|
+
this.$screenReaderCountMessage = null;
|
134
|
+
|
135
|
+
/** @deprecated Will be made private in v5.0 */
|
136
|
+
this.lastInputTimestamp = null;
|
137
|
+
|
138
|
+
/** @deprecated Will be made private in v5.0 */
|
139
|
+
this.lastInputValue = '';
|
140
|
+
|
141
|
+
/** @deprecated Will be made private in v5.0 */
|
142
|
+
this.valueChecker = null;
|
112
143
|
}
|
113
144
|
|
114
145
|
/**
|
@@ -116,87 +147,94 @@ function CharacterCount ($module, config) {
|
|
116
147
|
*/
|
117
148
|
CharacterCount.prototype.init = function () {
|
118
149
|
// Check that required elements are present
|
119
|
-
if (!this.$textarea) {
|
150
|
+
if (!this.$module || !this.$textarea) {
|
120
151
|
return
|
121
152
|
}
|
122
153
|
|
123
|
-
var $textarea = this.$textarea
|
124
|
-
var $textareaDescription = document.getElementById($textarea.id + '-info')
|
154
|
+
var $textarea = this.$textarea;
|
155
|
+
var $textareaDescription = document.getElementById($textarea.id + '-info');
|
156
|
+
if (!$textareaDescription) {
|
157
|
+
return
|
158
|
+
}
|
125
159
|
|
126
|
-
// Inject a
|
160
|
+
// Inject a description for the textarea if none is present already
|
127
161
|
// for when the component was rendered with no maxlength, maxwords
|
128
162
|
// nor custom textareaDescriptionText
|
129
163
|
if ($textareaDescription.innerText.match(/^\s*$/)) {
|
130
|
-
$textareaDescription.innerText = this.i18n.t('textareaDescription', { count: this.maxLength })
|
164
|
+
$textareaDescription.innerText = this.i18n.t('textareaDescription', { count: this.maxLength });
|
131
165
|
}
|
132
166
|
|
133
167
|
// Move the textarea description to be immediately after the textarea
|
134
168
|
// Kept for backwards compatibility
|
135
|
-
$textarea.insertAdjacentElement('afterend', $textareaDescription)
|
169
|
+
$textarea.insertAdjacentElement('afterend', $textareaDescription);
|
136
170
|
|
137
171
|
// Create the *screen reader* specific live-updating counter
|
138
172
|
// This doesn't need any styling classes, as it is never visible
|
139
|
-
var $screenReaderCountMessage = document.createElement('div')
|
140
|
-
$screenReaderCountMessage.className = 'govuk-character-count__sr-status govuk-visually-hidden'
|
141
|
-
$screenReaderCountMessage.setAttribute('aria-live', 'polite')
|
142
|
-
this.$screenReaderCountMessage = $screenReaderCountMessage
|
143
|
-
$textareaDescription.insertAdjacentElement('afterend', $screenReaderCountMessage)
|
173
|
+
var $screenReaderCountMessage = document.createElement('div');
|
174
|
+
$screenReaderCountMessage.className = 'govuk-character-count__sr-status govuk-visually-hidden';
|
175
|
+
$screenReaderCountMessage.setAttribute('aria-live', 'polite');
|
176
|
+
this.$screenReaderCountMessage = $screenReaderCountMessage;
|
177
|
+
$textareaDescription.insertAdjacentElement('afterend', $screenReaderCountMessage);
|
144
178
|
|
145
179
|
// Create our live-updating counter element, copying the classes from the
|
146
180
|
// textarea description for backwards compatibility as these may have been
|
147
181
|
// configured
|
148
|
-
var $visibleCountMessage = document.createElement('div')
|
149
|
-
$visibleCountMessage.className = $textareaDescription.className
|
150
|
-
$visibleCountMessage.classList.add('govuk-character-count__status')
|
151
|
-
$visibleCountMessage.setAttribute('aria-hidden', 'true')
|
152
|
-
this.$visibleCountMessage = $visibleCountMessage
|
153
|
-
$textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage)
|
182
|
+
var $visibleCountMessage = document.createElement('div');
|
183
|
+
$visibleCountMessage.className = $textareaDescription.className;
|
184
|
+
$visibleCountMessage.classList.add('govuk-character-count__status');
|
185
|
+
$visibleCountMessage.setAttribute('aria-hidden', 'true');
|
186
|
+
this.$visibleCountMessage = $visibleCountMessage;
|
187
|
+
$textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage);
|
154
188
|
|
155
189
|
// Hide the textarea description
|
156
|
-
$textareaDescription.classList.add('govuk-visually-hidden')
|
190
|
+
$textareaDescription.classList.add('govuk-visually-hidden');
|
157
191
|
|
158
192
|
// Remove hard limit if set
|
159
|
-
$textarea.removeAttribute('maxlength')
|
193
|
+
$textarea.removeAttribute('maxlength');
|
160
194
|
|
161
|
-
this.bindChangeEvents()
|
195
|
+
this.bindChangeEvents();
|
162
196
|
|
163
197
|
// When the page is restored after navigating 'back' in some browsers the
|
164
198
|
// state of the character count is not restored until *after* the
|
165
199
|
// DOMContentLoaded event is fired, so we need to manually update it after the
|
166
200
|
// pageshow event in browsers that support it.
|
167
|
-
|
168
|
-
window
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
this.updateCountMessage()
|
173
|
-
}
|
201
|
+
window.addEventListener(
|
202
|
+
'onpageshow' in window ? 'pageshow' : 'DOMContentLoaded',
|
203
|
+
this.updateCountMessage.bind(this)
|
204
|
+
);
|
205
|
+
|
206
|
+
this.updateCountMessage();
|
207
|
+
};
|
174
208
|
|
175
209
|
/**
|
176
210
|
* Bind change events
|
177
211
|
*
|
178
212
|
* Set up event listeners on the $textarea so that the count messages update
|
179
213
|
* when the user types.
|
214
|
+
*
|
215
|
+
* @deprecated Will be made private in v5.0
|
180
216
|
*/
|
181
217
|
CharacterCount.prototype.bindChangeEvents = function () {
|
182
|
-
var $textarea = this.$textarea
|
183
|
-
$textarea.addEventListener('keyup', this.handleKeyUp.bind(this))
|
218
|
+
var $textarea = this.$textarea;
|
219
|
+
$textarea.addEventListener('keyup', this.handleKeyUp.bind(this));
|
184
220
|
|
185
221
|
// Bind focus/blur events to start/stop polling
|
186
|
-
$textarea.addEventListener('focus', this.handleFocus.bind(this))
|
187
|
-
$textarea.addEventListener('blur', this.handleBlur.bind(this))
|
188
|
-
}
|
222
|
+
$textarea.addEventListener('focus', this.handleFocus.bind(this));
|
223
|
+
$textarea.addEventListener('blur', this.handleBlur.bind(this));
|
224
|
+
};
|
189
225
|
|
190
226
|
/**
|
191
227
|
* Handle key up event
|
192
228
|
*
|
193
229
|
* Update the visible character counter and keep track of when the last update
|
194
230
|
* happened for each keypress
|
231
|
+
*
|
232
|
+
* @deprecated Will be made private in v5.0
|
195
233
|
*/
|
196
234
|
CharacterCount.prototype.handleKeyUp = function () {
|
197
|
-
this.updateVisibleCountMessage()
|
198
|
-
this.lastInputTimestamp = Date.now()
|
199
|
-
}
|
235
|
+
this.updateVisibleCountMessage();
|
236
|
+
this.lastInputTimestamp = Date.now();
|
237
|
+
};
|
200
238
|
|
201
239
|
/**
|
202
240
|
* Handle focus event
|
@@ -210,128 +248,142 @@ CharacterCount.prototype.handleKeyUp = function () {
|
|
210
248
|
*
|
211
249
|
* This is so that the update triggered by the manual comparison doesn't
|
212
250
|
* conflict with debounced KeyboardEvent updates.
|
251
|
+
*
|
252
|
+
* @deprecated Will be made private in v5.0
|
213
253
|
*/
|
214
254
|
CharacterCount.prototype.handleFocus = function () {
|
215
255
|
this.valueChecker = setInterval(function () {
|
216
256
|
if (!this.lastInputTimestamp || (Date.now() - 500) >= this.lastInputTimestamp) {
|
217
|
-
this.updateIfValueChanged()
|
257
|
+
this.updateIfValueChanged();
|
218
258
|
}
|
219
|
-
}.bind(this), 1000)
|
220
|
-
}
|
259
|
+
}.bind(this), 1000);
|
260
|
+
};
|
221
261
|
|
222
262
|
/**
|
223
263
|
* Handle blur event
|
224
264
|
*
|
225
265
|
* Stop checking the textarea value once the textarea no longer has focus
|
266
|
+
*
|
267
|
+
* @deprecated Will be made private in v5.0
|
226
268
|
*/
|
227
269
|
CharacterCount.prototype.handleBlur = function () {
|
228
270
|
// Cancel value checking on blur
|
229
|
-
clearInterval(this.valueChecker)
|
230
|
-
}
|
271
|
+
clearInterval(this.valueChecker);
|
272
|
+
};
|
231
273
|
|
232
274
|
/**
|
233
275
|
* Update count message if textarea value has changed
|
276
|
+
*
|
277
|
+
* @deprecated Will be made private in v5.0
|
234
278
|
*/
|
235
279
|
CharacterCount.prototype.updateIfValueChanged = function () {
|
236
|
-
if (
|
237
|
-
|
238
|
-
this
|
239
|
-
this.updateCountMessage()
|
280
|
+
if (this.$textarea.value !== this.lastInputValue) {
|
281
|
+
this.lastInputValue = this.$textarea.value;
|
282
|
+
this.updateCountMessage();
|
240
283
|
}
|
241
|
-
}
|
284
|
+
};
|
242
285
|
|
243
286
|
/**
|
244
287
|
* Update count message
|
245
288
|
*
|
246
289
|
* Helper function to update both the visible and screen reader-specific
|
247
290
|
* counters simultaneously (e.g. on init)
|
291
|
+
*
|
292
|
+
* @deprecated Will be made private in v5.0
|
248
293
|
*/
|
249
294
|
CharacterCount.prototype.updateCountMessage = function () {
|
250
|
-
this.updateVisibleCountMessage()
|
251
|
-
this.updateScreenReaderCountMessage()
|
252
|
-
}
|
295
|
+
this.updateVisibleCountMessage();
|
296
|
+
this.updateScreenReaderCountMessage();
|
297
|
+
};
|
253
298
|
|
254
299
|
/**
|
255
300
|
* Update visible count message
|
301
|
+
*
|
302
|
+
* @deprecated Will be made private in v5.0
|
256
303
|
*/
|
257
304
|
CharacterCount.prototype.updateVisibleCountMessage = function () {
|
258
|
-
var $textarea = this.$textarea
|
259
|
-
var $visibleCountMessage = this.$visibleCountMessage
|
260
|
-
var remainingNumber = this.maxLength - this.count($textarea.value)
|
305
|
+
var $textarea = this.$textarea;
|
306
|
+
var $visibleCountMessage = this.$visibleCountMessage;
|
307
|
+
var remainingNumber = this.maxLength - this.count($textarea.value);
|
261
308
|
|
262
309
|
// If input is over the threshold, remove the disabled class which renders the
|
263
310
|
// counter invisible.
|
264
311
|
if (this.isOverThreshold()) {
|
265
|
-
$visibleCountMessage.classList.remove('govuk-character-count__message--disabled')
|
312
|
+
$visibleCountMessage.classList.remove('govuk-character-count__message--disabled');
|
266
313
|
} else {
|
267
|
-
$visibleCountMessage.classList.add('govuk-character-count__message--disabled')
|
314
|
+
$visibleCountMessage.classList.add('govuk-character-count__message--disabled');
|
268
315
|
}
|
269
316
|
|
270
317
|
// Update styles
|
271
318
|
if (remainingNumber < 0) {
|
272
|
-
$textarea.classList.add('govuk-textarea--error')
|
273
|
-
$visibleCountMessage.classList.remove('govuk-hint')
|
274
|
-
$visibleCountMessage.classList.add('govuk-error-message')
|
319
|
+
$textarea.classList.add('govuk-textarea--error');
|
320
|
+
$visibleCountMessage.classList.remove('govuk-hint');
|
321
|
+
$visibleCountMessage.classList.add('govuk-error-message');
|
275
322
|
} else {
|
276
|
-
$textarea.classList.remove('govuk-textarea--error')
|
277
|
-
$visibleCountMessage.classList.remove('govuk-error-message')
|
278
|
-
$visibleCountMessage.classList.add('govuk-hint')
|
323
|
+
$textarea.classList.remove('govuk-textarea--error');
|
324
|
+
$visibleCountMessage.classList.remove('govuk-error-message');
|
325
|
+
$visibleCountMessage.classList.add('govuk-hint');
|
279
326
|
}
|
280
327
|
|
281
328
|
// Update message
|
282
|
-
$visibleCountMessage.innerText = this.getCountMessage()
|
283
|
-
}
|
329
|
+
$visibleCountMessage.innerText = this.getCountMessage();
|
330
|
+
};
|
284
331
|
|
285
332
|
/**
|
286
333
|
* Update screen reader count message
|
334
|
+
*
|
335
|
+
* @deprecated Will be made private in v5.0
|
287
336
|
*/
|
288
337
|
CharacterCount.prototype.updateScreenReaderCountMessage = function () {
|
289
|
-
var $screenReaderCountMessage = this.$screenReaderCountMessage
|
338
|
+
var $screenReaderCountMessage = this.$screenReaderCountMessage;
|
290
339
|
|
291
340
|
// If over the threshold, remove the aria-hidden attribute, allowing screen
|
292
341
|
// readers to announce the content of the element.
|
293
342
|
if (this.isOverThreshold()) {
|
294
|
-
$screenReaderCountMessage.removeAttribute('aria-hidden')
|
343
|
+
$screenReaderCountMessage.removeAttribute('aria-hidden');
|
295
344
|
} else {
|
296
|
-
$screenReaderCountMessage.setAttribute('aria-hidden', true)
|
345
|
+
$screenReaderCountMessage.setAttribute('aria-hidden', 'true');
|
297
346
|
}
|
298
347
|
|
299
348
|
// Update message
|
300
|
-
$screenReaderCountMessage.innerText = this.getCountMessage()
|
301
|
-
}
|
349
|
+
$screenReaderCountMessage.innerText = this.getCountMessage();
|
350
|
+
};
|
302
351
|
|
303
352
|
/**
|
304
353
|
* Count the number of characters (or words, if `config.maxwords` is set)
|
305
354
|
* in the given text
|
306
355
|
*
|
356
|
+
* @deprecated Will be made private in v5.0
|
307
357
|
* @param {string} text - The text to count the characters of
|
308
358
|
* @returns {number} the number of characters (or words) in the text
|
309
359
|
*/
|
310
360
|
CharacterCount.prototype.count = function (text) {
|
311
|
-
if (this.config.maxwords) {
|
312
|
-
var tokens = text.match(/\S+/g) || [] // Matches consecutive non-whitespace chars
|
361
|
+
if ('maxwords' in this.config && this.config.maxwords) {
|
362
|
+
var tokens = text.match(/\S+/g) || []; // Matches consecutive non-whitespace chars
|
313
363
|
return tokens.length
|
314
364
|
} else {
|
315
365
|
return text.length
|
316
366
|
}
|
317
|
-
}
|
367
|
+
};
|
318
368
|
|
319
369
|
/**
|
320
370
|
* Get count message
|
321
371
|
*
|
372
|
+
* @deprecated Will be made private in v5.0
|
322
373
|
* @returns {string} Status message
|
323
374
|
*/
|
324
375
|
CharacterCount.prototype.getCountMessage = function () {
|
325
|
-
var remainingNumber = this.maxLength - this.count(this.$textarea.value)
|
376
|
+
var remainingNumber = this.maxLength - this.count(this.$textarea.value);
|
326
377
|
|
327
|
-
var countType = this.config.maxwords ? 'words' : 'characters'
|
378
|
+
var countType = 'maxwords' in this.config && this.config.maxwords ? 'words' : 'characters';
|
328
379
|
return this.formatCountMessage(remainingNumber, countType)
|
329
|
-
}
|
380
|
+
};
|
330
381
|
|
331
382
|
/**
|
332
383
|
* Formats the message shown to users according to what's counted
|
333
384
|
* and how many remain
|
334
385
|
*
|
386
|
+
* @deprecated Will be made private in v5.0
|
335
387
|
* @param {number} remainingNumber - The number of words/characaters remaining
|
336
388
|
* @param {string} countType - "words" or "characters"
|
337
389
|
* @returns {string} Status message
|
@@ -341,10 +393,10 @@ CharacterCount.prototype.formatCountMessage = function (remainingNumber, countTy
|
|
341
393
|
return this.i18n.t(countType + 'AtLimit')
|
342
394
|
}
|
343
395
|
|
344
|
-
var translationKeySuffix = remainingNumber < 0 ? 'OverLimit' : 'UnderLimit'
|
396
|
+
var translationKeySuffix = remainingNumber < 0 ? 'OverLimit' : 'UnderLimit';
|
345
397
|
|
346
398
|
return this.i18n.t(countType + translationKeySuffix, { count: Math.abs(remainingNumber) })
|
347
|
-
}
|
399
|
+
};
|
348
400
|
|
349
401
|
/**
|
350
402
|
* Check if count is over threshold
|
@@ -353,6 +405,7 @@ CharacterCount.prototype.formatCountMessage = function (remainingNumber, countTy
|
|
353
405
|
* If there is no configured threshold, it is set to 0 and this function will
|
354
406
|
* always return true.
|
355
407
|
*
|
408
|
+
* @deprecated Will be made private in v5.0
|
356
409
|
* @returns {boolean} true if the current count is over the config.threshold
|
357
410
|
* (or no threshold is set)
|
358
411
|
*/
|
@@ -362,18 +415,16 @@ CharacterCount.prototype.isOverThreshold = function () {
|
|
362
415
|
return true
|
363
416
|
}
|
364
417
|
|
365
|
-
var $textarea = this.$textarea
|
418
|
+
var $textarea = this.$textarea;
|
366
419
|
|
367
420
|
// Determine the remaining number of characters/words
|
368
|
-
var currentLength = this.count($textarea.value)
|
369
|
-
var maxLength = this.maxLength
|
421
|
+
var currentLength = this.count($textarea.value);
|
422
|
+
var maxLength = this.maxLength;
|
370
423
|
|
371
|
-
var thresholdValue = maxLength * this.config.threshold / 100
|
424
|
+
var thresholdValue = maxLength * this.config.threshold / 100;
|
372
425
|
|
373
426
|
return (thresholdValue <= currentLength)
|
374
|
-
}
|
375
|
-
|
376
|
-
export default CharacterCount
|
427
|
+
};
|
377
428
|
|
378
429
|
/**
|
379
430
|
* Character count config
|
@@ -386,10 +437,10 @@ export default CharacterCount
|
|
386
437
|
*
|
387
438
|
* @typedef {object} CharacterCountConfigWithMaxLength
|
388
439
|
* @property {number} [maxlength] - The maximum number of characters.
|
389
|
-
*
|
440
|
+
* If maxwords is provided, the maxlength option will be ignored.
|
390
441
|
* @property {number} [threshold = 0] - The percentage value of the limit at
|
391
|
-
*
|
392
|
-
*
|
442
|
+
* which point the count message is displayed. If this attribute is set, the
|
443
|
+
* count message will be hidden by default.
|
393
444
|
* @property {CharacterCountTranslations} [i18n = CHARACTER_COUNT_TRANSLATIONS] - See constant {@link CHARACTER_COUNT_TRANSLATIONS}
|
394
445
|
*/
|
395
446
|
|
@@ -398,10 +449,10 @@ export default CharacterCount
|
|
398
449
|
*
|
399
450
|
* @typedef {object} CharacterCountConfigWithMaxWords
|
400
451
|
* @property {number} [maxwords] - The maximum number of words. If maxwords is
|
401
|
-
*
|
452
|
+
* provided, the maxlength option will be ignored.
|
402
453
|
* @property {number} [threshold = 0] - The percentage value of the limit at
|
403
|
-
*
|
404
|
-
*
|
454
|
+
* which point the count message is displayed. If this attribute is set, the
|
455
|
+
* count message will be hidden by default.
|
405
456
|
* @property {CharacterCountTranslations} [i18n = CHARACTER_COUNT_TRANSLATIONS] - See constant {@link CHARACTER_COUNT_TRANSLATIONS}
|
406
457
|
*/
|
407
458
|
|
@@ -454,3 +505,6 @@ export default CharacterCount
|
|
454
505
|
/**
|
455
506
|
* @typedef {import('../../i18n.mjs').TranslationPluralForms} TranslationPluralForms
|
456
507
|
*/
|
508
|
+
|
509
|
+
export default CharacterCount;
|
510
|
+
//# sourceMappingURL=components/character-count/character-count.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"character-count.mjs","sources":["../../../../src/govuk/components/character-count/character-count.mjs"],"sourcesContent":["/* eslint-disable es-x/no-date-now -- Polyfill imported */\n/* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */\n\nimport { closestAttributeValue } from '../../common/closest-attribute-value.mjs'\nimport { extractConfigByNamespace, mergeConfigs } from '../../common/index.mjs'\nimport { normaliseDataset } from '../../common/normalise-dataset.mjs'\nimport { I18n } from '../../i18n.mjs'\nimport '../../vendor/polyfills/Date/now.mjs'\nimport '../../vendor/polyfills/Element/prototype/classList.mjs'\nimport '../../vendor/polyfills/Event.mjs' // addEventListener, event.target normalization and DOMContentLoaded\nimport '../../vendor/polyfills/Function/prototype/bind.mjs'\n\n/**\n * @constant\n * @type {CharacterCountTranslations}\n * @see Default value for {@link CharacterCountConfig.i18n}\n * @default\n */\nvar CHARACTER_COUNT_TRANSLATIONS = {\n // Characters\n charactersUnderLimit: {\n one: 'You have %{count} character remaining',\n other: 'You have %{count} characters remaining'\n },\n charactersAtLimit: 'You have 0 characters remaining',\n charactersOverLimit: {\n one: 'You have %{count} character too many',\n other: 'You have %{count} characters too many'\n },\n // Words\n wordsUnderLimit: {\n one: 'You have %{count} word remaining',\n other: 'You have %{count} words remaining'\n },\n wordsAtLimit: 'You have 0 words remaining',\n wordsOverLimit: {\n one: 'You have %{count} word too many',\n other: 'You have %{count} words too many'\n },\n textareaDescription: {\n other: ''\n }\n}\n\n/**\n * JavaScript enhancements for the CharacterCount component\n *\n * Tracks the number of characters or words in the `.govuk-js-character-count`\n * `<textarea>` inside the element. Displays a message with the remaining number\n * of characters/words available, or the number of characters/words in excess.\n *\n * You can configure the message to only appear after a certain percentage\n * of the available characters/words has been entered.\n *\n * @class\n * @param {Element} $module - HTML element to use for character count\n * @param {CharacterCountConfig} [config] - Character count config\n */\nfunction CharacterCount ($module, config) {\n if (!($module instanceof HTMLElement)) {\n return this\n }\n\n var $textarea = $module.querySelector('.govuk-js-character-count')\n if (\n !(\n $textarea instanceof HTMLTextAreaElement ||\n $textarea instanceof HTMLInputElement\n )\n ) {\n return this\n }\n\n var defaultConfig = {\n threshold: 0,\n i18n: CHARACTER_COUNT_TRANSLATIONS\n }\n\n // Read config set using dataset ('data-' values)\n var datasetConfig = normaliseDataset($module.dataset)\n\n // To ensure data-attributes take complete precedence, even if they change the\n // type of count, we need to reset the `maxlength` and `maxwords` from the\n // JavaScript config.\n //\n // We can't mutate `config`, though, as it may be shared across multiple\n // components inside `initAll`.\n var configOverrides = {}\n if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {\n configOverrides = {\n maxlength: false,\n maxwords: false\n }\n }\n\n /**\n * @deprecated Will be made private in v5.0\n * @type {CharacterCountConfig}\n */\n this.config = mergeConfigs(\n defaultConfig,\n config || {},\n configOverrides,\n datasetConfig\n )\n\n /** @deprecated Will be made private in v5.0 */\n this.i18n = new I18n(extractConfigByNamespace(this.config, 'i18n'), {\n // Read the fallback if necessary rather than have it set in the defaults\n locale: closestAttributeValue($module, 'lang')\n })\n\n /** @deprecated Will be made private in v5.0 */\n this.maxLength = Infinity\n // Determine the limit attribute (characters or words)\n if ('maxwords' in this.config && this.config.maxwords) {\n this.maxLength = this.config.maxwords\n } else if ('maxlength' in this.config && this.config.maxlength) {\n this.maxLength = this.config.maxlength\n } else {\n return\n }\n\n /** @deprecated Will be made private in v5.0 */\n this.$module = $module\n\n /** @deprecated Will be made private in v5.0 */\n this.$textarea = $textarea\n\n /** @deprecated Will be made private in v5.0 */\n this.$visibleCountMessage = null\n\n /** @deprecated Will be made private in v5.0 */\n this.$screenReaderCountMessage = null\n\n /** @deprecated Will be made private in v5.0 */\n this.lastInputTimestamp = null\n\n /** @deprecated Will be made private in v5.0 */\n this.lastInputValue = ''\n\n /** @deprecated Will be made private in v5.0 */\n this.valueChecker = null\n}\n\n/**\n * Initialise component\n */\nCharacterCount.prototype.init = function () {\n // Check that required elements are present\n if (!this.$module || !this.$textarea) {\n return\n }\n\n var $textarea = this.$textarea\n var $textareaDescription = document.getElementById($textarea.id + '-info')\n if (!$textareaDescription) {\n return\n }\n\n // Inject a description for the textarea if none is present already\n // for when the component was rendered with no maxlength, maxwords\n // nor custom textareaDescriptionText\n if ($textareaDescription.innerText.match(/^\\s*$/)) {\n $textareaDescription.innerText = this.i18n.t('textareaDescription', { count: this.maxLength })\n }\n\n // Move the textarea description to be immediately after the textarea\n // Kept for backwards compatibility\n $textarea.insertAdjacentElement('afterend', $textareaDescription)\n\n // Create the *screen reader* specific live-updating counter\n // This doesn't need any styling classes, as it is never visible\n var $screenReaderCountMessage = document.createElement('div')\n $screenReaderCountMessage.className = 'govuk-character-count__sr-status govuk-visually-hidden'\n $screenReaderCountMessage.setAttribute('aria-live', 'polite')\n this.$screenReaderCountMessage = $screenReaderCountMessage\n $textareaDescription.insertAdjacentElement('afterend', $screenReaderCountMessage)\n\n // Create our live-updating counter element, copying the classes from the\n // textarea description for backwards compatibility as these may have been\n // configured\n var $visibleCountMessage = document.createElement('div')\n $visibleCountMessage.className = $textareaDescription.className\n $visibleCountMessage.classList.add('govuk-character-count__status')\n $visibleCountMessage.setAttribute('aria-hidden', 'true')\n this.$visibleCountMessage = $visibleCountMessage\n $textareaDescription.insertAdjacentElement('afterend', $visibleCountMessage)\n\n // Hide the textarea description\n $textareaDescription.classList.add('govuk-visually-hidden')\n\n // Remove hard limit if set\n $textarea.removeAttribute('maxlength')\n\n this.bindChangeEvents()\n\n // When the page is restored after navigating 'back' in some browsers the\n // state of the character count is not restored until *after* the\n // DOMContentLoaded event is fired, so we need to manually update it after the\n // pageshow event in browsers that support it.\n window.addEventListener(\n 'onpageshow' in window ? 'pageshow' : 'DOMContentLoaded',\n this.updateCountMessage.bind(this)\n )\n\n this.updateCountMessage()\n}\n\n/**\n * Bind change events\n *\n * Set up event listeners on the $textarea so that the count messages update\n * when the user types.\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.bindChangeEvents = function () {\n var $textarea = this.$textarea\n $textarea.addEventListener('keyup', this.handleKeyUp.bind(this))\n\n // Bind focus/blur events to start/stop polling\n $textarea.addEventListener('focus', this.handleFocus.bind(this))\n $textarea.addEventListener('blur', this.handleBlur.bind(this))\n}\n\n/**\n * Handle key up event\n *\n * Update the visible character counter and keep track of when the last update\n * happened for each keypress\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.handleKeyUp = function () {\n this.updateVisibleCountMessage()\n this.lastInputTimestamp = Date.now()\n}\n\n/**\n * Handle focus event\n *\n * Speech recognition software such as Dragon NaturallySpeaking will modify the\n * fields by directly changing its `value`. These changes don't trigger events\n * in JavaScript, so we need to poll to handle when and if they occur.\n *\n * Once the keyup event hasn't been detected for at least 1000 ms (1s), check if\n * the textarea value has changed and update the count message if it has.\n *\n * This is so that the update triggered by the manual comparison doesn't\n * conflict with debounced KeyboardEvent updates.\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.handleFocus = function () {\n this.valueChecker = setInterval(function () {\n if (!this.lastInputTimestamp || (Date.now() - 500) >= this.lastInputTimestamp) {\n this.updateIfValueChanged()\n }\n }.bind(this), 1000)\n}\n\n/**\n * Handle blur event\n *\n * Stop checking the textarea value once the textarea no longer has focus\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.handleBlur = function () {\n // Cancel value checking on blur\n clearInterval(this.valueChecker)\n}\n\n/**\n * Update count message if textarea value has changed\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.updateIfValueChanged = function () {\n if (this.$textarea.value !== this.lastInputValue) {\n this.lastInputValue = this.$textarea.value\n this.updateCountMessage()\n }\n}\n\n/**\n * Update count message\n *\n * Helper function to update both the visible and screen reader-specific\n * counters simultaneously (e.g. on init)\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.updateCountMessage = function () {\n this.updateVisibleCountMessage()\n this.updateScreenReaderCountMessage()\n}\n\n/**\n * Update visible count message\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.updateVisibleCountMessage = function () {\n var $textarea = this.$textarea\n var $visibleCountMessage = this.$visibleCountMessage\n var remainingNumber = this.maxLength - this.count($textarea.value)\n\n // If input is over the threshold, remove the disabled class which renders the\n // counter invisible.\n if (this.isOverThreshold()) {\n $visibleCountMessage.classList.remove('govuk-character-count__message--disabled')\n } else {\n $visibleCountMessage.classList.add('govuk-character-count__message--disabled')\n }\n\n // Update styles\n if (remainingNumber < 0) {\n $textarea.classList.add('govuk-textarea--error')\n $visibleCountMessage.classList.remove('govuk-hint')\n $visibleCountMessage.classList.add('govuk-error-message')\n } else {\n $textarea.classList.remove('govuk-textarea--error')\n $visibleCountMessage.classList.remove('govuk-error-message')\n $visibleCountMessage.classList.add('govuk-hint')\n }\n\n // Update message\n $visibleCountMessage.innerText = this.getCountMessage()\n}\n\n/**\n * Update screen reader count message\n *\n * @deprecated Will be made private in v5.0\n */\nCharacterCount.prototype.updateScreenReaderCountMessage = function () {\n var $screenReaderCountMessage = this.$screenReaderCountMessage\n\n // If over the threshold, remove the aria-hidden attribute, allowing screen\n // readers to announce the content of the element.\n if (this.isOverThreshold()) {\n $screenReaderCountMessage.removeAttribute('aria-hidden')\n } else {\n $screenReaderCountMessage.setAttribute('aria-hidden', 'true')\n }\n\n // Update message\n $screenReaderCountMessage.innerText = this.getCountMessage()\n}\n\n/**\n * Count the number of characters (or words, if `config.maxwords` is set)\n * in the given text\n *\n * @deprecated Will be made private in v5.0\n * @param {string} text - The text to count the characters of\n * @returns {number} the number of characters (or words) in the text\n */\nCharacterCount.prototype.count = function (text) {\n if ('maxwords' in this.config && this.config.maxwords) {\n var tokens = text.match(/\\S+/g) || [] // Matches consecutive non-whitespace chars\n return tokens.length\n } else {\n return text.length\n }\n}\n\n/**\n * Get count message\n *\n * @deprecated Will be made private in v5.0\n * @returns {string} Status message\n */\nCharacterCount.prototype.getCountMessage = function () {\n var remainingNumber = this.maxLength - this.count(this.$textarea.value)\n\n var countType = 'maxwords' in this.config && this.config.maxwords ? 'words' : 'characters'\n return this.formatCountMessage(remainingNumber, countType)\n}\n\n/**\n * Formats the message shown to users according to what's counted\n * and how many remain\n *\n * @deprecated Will be made private in v5.0\n * @param {number} remainingNumber - The number of words/characaters remaining\n * @param {string} countType - \"words\" or \"characters\"\n * @returns {string} Status message\n */\nCharacterCount.prototype.formatCountMessage = function (remainingNumber, countType) {\n if (remainingNumber === 0) {\n return this.i18n.t(countType + 'AtLimit')\n }\n\n var translationKeySuffix = remainingNumber < 0 ? 'OverLimit' : 'UnderLimit'\n\n return this.i18n.t(countType + translationKeySuffix, { count: Math.abs(remainingNumber) })\n}\n\n/**\n * Check if count is over threshold\n *\n * Checks whether the value is over the configured threshold for the input.\n * If there is no configured threshold, it is set to 0 and this function will\n * always return true.\n *\n * @deprecated Will be made private in v5.0\n * @returns {boolean} true if the current count is over the config.threshold\n * (or no threshold is set)\n */\nCharacterCount.prototype.isOverThreshold = function () {\n // No threshold means we're always above threshold so save some computation\n if (!this.config.threshold) {\n return true\n }\n\n var $textarea = this.$textarea\n\n // Determine the remaining number of characters/words\n var currentLength = this.count($textarea.value)\n var maxLength = this.maxLength\n\n var thresholdValue = maxLength * this.config.threshold / 100\n\n return (thresholdValue <= currentLength)\n}\n\nexport default CharacterCount\n\n/**\n * Character count config\n *\n * @typedef {CharacterCountConfigWithMaxLength | CharacterCountConfigWithMaxWords} CharacterCountConfig\n */\n\n/**\n * Character count config (with maximum number of characters)\n *\n * @typedef {object} CharacterCountConfigWithMaxLength\n * @property {number} [maxlength] - The maximum number of characters.\n * If maxwords is provided, the maxlength option will be ignored.\n * @property {number} [threshold = 0] - The percentage value of the limit at\n * which point the count message is displayed. If this attribute is set, the\n * count message will be hidden by default.\n * @property {CharacterCountTranslations} [i18n = CHARACTER_COUNT_TRANSLATIONS] - See constant {@link CHARACTER_COUNT_TRANSLATIONS}\n */\n\n/**\n * Character count config (with maximum number of words)\n *\n * @typedef {object} CharacterCountConfigWithMaxWords\n * @property {number} [maxwords] - The maximum number of words. If maxwords is\n * provided, the maxlength option will be ignored.\n * @property {number} [threshold = 0] - The percentage value of the limit at\n * which point the count message is displayed. If this attribute is set, the\n * count message will be hidden by default.\n * @property {CharacterCountTranslations} [i18n = CHARACTER_COUNT_TRANSLATIONS] - See constant {@link CHARACTER_COUNT_TRANSLATIONS}\n */\n\n/**\n * Character count translations\n *\n * @typedef {object} CharacterCountTranslations\n *\n * Messages shown to users as they type. It provides feedback on how many words\n * or characters they have remaining or if they are over the limit. This also\n * includes a message used as an accessible description for the textarea.\n * @property {TranslationPluralForms} [charactersUnderLimit] - Message displayed\n * when the number of characters is under the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [charactersAtLimit] - Message displayed when the number of\n * characters reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [charactersOverLimit] - Message displayed\n * when the number of characters is over the configured maximum, `maxlength`.\n * This message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining characters. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [wordsUnderLimit] - Message displayed when\n * the number of words is under the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {string} [wordsAtLimit] - Message displayed when the number of\n * words reaches the configured maximum, `maxlength`. This message is\n * displayed visually and through assistive technologies.\n * @property {TranslationPluralForms} [wordsOverLimit] - Message displayed when\n * the number of words is over the configured maximum, `maxlength`. This\n * message is displayed visually and through assistive technologies. The\n * component will replace the `%{count}` placeholder with the number of\n * remaining words. This is a [pluralised list of\n * messages](https://frontend.design-system.service.gov.uk/localise-govuk-frontend).\n * @property {TranslationPluralForms} [textareaDescription] - Message made\n * available to assistive technologies, if none is already present in the\n * HTML, to describe that the component accepts only a limited amount of\n * content. It is visible on the page when JavaScript is unavailable. The\n * component will replace the `%{count}` placeholder with the value of the\n * `maxlength` or `maxwords` parameter.\n */\n\n/**\n * @typedef {import('../../i18n.mjs').TranslationPluralForms} TranslationPluralForms\n */\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA,AAUA;;;;;;;AAOA,IAAI,4BAA4B,GAAG;;EAEjC,oBAAoB,EAAE;IACpB,GAAG,EAAE,uCAAuC;IAC5C,KAAK,EAAE,wCAAwC;GAChD;EACD,iBAAiB,EAAE,iCAAiC;EACpD,mBAAmB,EAA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