govuk_publishing_components 32.1.0 → 33.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/component_guide/accessibility-test.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +175 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-ecommerce-tracker.js +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +5 -13
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +80 -309
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +2 -2
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-specialist-link-tracker.js +140 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +3 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +12 -1
- data/app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js +24 -8
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +22 -1
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +140 -191
- data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +2 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +3 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +10 -30
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +0 -7
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +14 -1
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +27 -26
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +11 -13
- data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +4 -1
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +15 -3
- data/app/views/govuk_publishing_components/components/docs/button.yml +10 -0
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +59 -30
- data/app/views/govuk_publishing_components/components/docs/single_page_notification_button.yml +10 -1
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +34 -0
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +3 -3
- data/lib/govuk_publishing_components/presenters/button_helper.rb +9 -2
- data/lib/govuk_publishing_components/presenters/single_page_notification_button_helper.rb +25 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/axe.js +4559 -4673
- data/node_modules/axe-core/axe.min.js +2 -2
- data/node_modules/axe-core/package.json +2 -2
- data/node_modules/axe-core/sri-history.json +4 -0
- data/node_modules/govuk-frontend/README.md +1 -2
- data/node_modules/govuk-frontend/govuk/all.js +1398 -273
- data/node_modules/govuk-frontend/govuk/common/closest-attribute-value.js +70 -0
- data/node_modules/govuk-frontend/govuk/common/index.js +172 -0
- data/node_modules/govuk-frontend/govuk/common/normalise-dataset.js +373 -0
- data/node_modules/govuk-frontend/govuk/common.js +138 -3
- data/node_modules/govuk-frontend/govuk/components/accordion/accordion.js +753 -25
- data/node_modules/govuk-frontend/govuk/components/accordion/fixtures.json +54 -22
- data/node_modules/govuk-frontend/govuk/components/accordion/macro-options.json +36 -0
- data/node_modules/govuk-frontend/govuk/components/accordion/template.njk +7 -1
- data/node_modules/govuk-frontend/govuk/components/back-link/fixtures.json +12 -12
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +22 -22
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +23 -5
- data/node_modules/govuk-frontend/govuk/components/button/button.js +365 -107
- data/node_modules/govuk-frontend/govuk/components/button/fixtures.json +85 -66
- data/node_modules/govuk-frontend/govuk/components/button/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +9 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1033 -121
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +112 -36
- data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +42 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/template.njk +27 -3
- data/node_modules/govuk-frontend/govuk/components/checkboxes/checkboxes.js +30 -2
- data/node_modules/govuk-frontend/govuk/components/checkboxes/fixtures.json +96 -93
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +46 -46
- data/node_modules/govuk-frontend/govuk/components/date-input/fixtures.json +50 -50
- data/node_modules/govuk-frontend/govuk/components/details/details.js +43 -13
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +20 -20
- data/node_modules/govuk-frontend/govuk/components/error-message/fixtures.json +20 -20
- data/node_modules/govuk-frontend/govuk/components/error-summary/error-summary.js +268 -6
- data/node_modules/govuk-frontend/govuk/components/error-summary/fixtures.json +44 -35
- data/node_modules/govuk-frontend/govuk/components/error-summary/template.njk +25 -21
- data/node_modules/govuk-frontend/govuk/components/fieldset/fixtures.json +51 -39
- data/node_modules/govuk-frontend/govuk/components/file-upload/fixtures.json +26 -26
- data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/footer/fixtures.json +46 -46
- data/node_modules/govuk-frontend/govuk/components/footer/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +93 -38
- data/node_modules/govuk-frontend/govuk/components/header/header.js +6 -0
- data/node_modules/govuk-frontend/govuk/components/header/macro-options.json +8 -2
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -2
- data/node_modules/govuk-frontend/govuk/components/hint/fixtures.json +12 -12
- data/node_modules/govuk-frontend/govuk/components/input/fixtures.json +80 -80
- data/node_modules/govuk-frontend/govuk/components/inset-text/fixtures.json +12 -12
- data/node_modules/govuk-frontend/govuk/components/label/fixtures.json +34 -34
- data/node_modules/govuk-frontend/govuk/components/notification-banner/fixtures.json +56 -46
- data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js +252 -2
- data/node_modules/govuk-frontend/govuk/components/notification-banner/template.njk +1 -1
- data/node_modules/govuk-frontend/govuk/components/pagination/_index.scss +10 -7
- data/node_modules/govuk-frontend/govuk/components/pagination/fixtures.json +33 -26
- data/node_modules/govuk-frontend/govuk/components/panel/fixtures.json +18 -18
- data/node_modules/govuk-frontend/govuk/components/phase-banner/fixtures.json +14 -14
- data/node_modules/govuk-frontend/govuk/components/radios/fixtures.json +94 -91
- data/node_modules/govuk-frontend/govuk/components/radios/radios.js +30 -2
- data/node_modules/govuk-frontend/govuk/components/select/fixtures.json +32 -32
- data/node_modules/govuk-frontend/govuk/components/skip-link/fixtures.json +22 -20
- data/node_modules/govuk-frontend/govuk/components/skip-link/skip-link.js +10 -4
- data/node_modules/govuk-frontend/govuk/components/summary-list/fixtures.json +50 -50
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +1 -1
- data/node_modules/govuk-frontend/govuk/components/table/fixtures.json +40 -40
- data/node_modules/govuk-frontend/govuk/components/tabs/fixtures.json +29 -29
- data/node_modules/govuk-frontend/govuk/components/tabs/tabs.js +28 -0
- data/node_modules/govuk-frontend/govuk/components/tag/fixtures.json +28 -28
- data/node_modules/govuk-frontend/govuk/components/textarea/fixtures.json +34 -34
- data/node_modules/govuk-frontend/govuk/components/warning-text/fixtures.json +14 -14
- data/node_modules/govuk-frontend/govuk/core/_section-break.scss +1 -1
- data/node_modules/govuk-frontend/govuk/helpers/_colour.scss +2 -2
- data/node_modules/govuk-frontend/govuk/helpers/_links.scss +6 -6
- data/node_modules/govuk-frontend/govuk/i18n.js +390 -0
- data/node_modules/govuk-frontend/govuk/macros/i18n.njk +15 -0
- data/node_modules/govuk-frontend/govuk/settings/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +12 -0
- data/node_modules/govuk-frontend/govuk/settings/_compatibility.scss +26 -0
- data/node_modules/govuk-frontend/govuk/settings/_typography-font.scss +23 -0
- data/node_modules/govuk-frontend/govuk/settings/_typography-responsive.scss +12 -0
- data/node_modules/govuk-frontend/govuk/settings/_warnings.scss +53 -0
- data/node_modules/govuk-frontend/govuk/tools/_compatibility.scss +20 -6
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Date/now.js +21 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/Element/prototype/dataset.js +300 -0
- data/node_modules/govuk-frontend/govuk/vendor/polyfills/String/prototype/trim.js +21 -0
- data/node_modules/govuk-frontend/govuk-esm/all.mjs +50 -27
- data/node_modules/govuk-frontend/govuk-esm/common/closest-attribute-value.mjs +15 -0
- data/node_modules/govuk-frontend/govuk-esm/common/index.mjs +159 -0
- data/node_modules/govuk-frontend/govuk-esm/common/normalise-dataset.mjs +58 -0
- data/node_modules/govuk-frontend/govuk-esm/common.mjs +6 -28
- data/node_modules/govuk-frontend/govuk-esm/components/accordion/accordion.mjs +113 -43
- data/node_modules/govuk-frontend/govuk-esm/components/button/button.mjs +67 -30
- data/node_modules/govuk-frontend/govuk-esm/components/character-count/character-count.mjs +325 -123
- data/node_modules/govuk-frontend/govuk-esm/components/checkboxes/checkboxes.mjs +9 -3
- data/node_modules/govuk-frontend/govuk-esm/components/details/details.mjs +22 -8
- data/node_modules/govuk-frontend/govuk-esm/components/error-summary/error-summary.mjs +48 -6
- data/node_modules/govuk-frontend/govuk-esm/components/header/header.mjs +6 -0
- data/node_modules/govuk-frontend/govuk-esm/components/notification-banner/notification-banner.mjs +32 -2
- data/node_modules/govuk-frontend/govuk-esm/components/radios/radios.mjs +9 -3
- data/node_modules/govuk-frontend/govuk-esm/components/skip-link/skip-link.mjs +10 -4
- data/node_modules/govuk-frontend/govuk-esm/components/tabs/tabs.mjs +8 -2
- data/node_modules/govuk-frontend/govuk-esm/i18n.mjs +380 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Date/now.mjs +13 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/Element/prototype/dataset.mjs +68 -0
- data/node_modules/govuk-frontend/govuk-esm/vendor/polyfills/String/prototype/trim.mjs +13 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit/init.js +7 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit/init.scss +12 -0
- data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +138 -7
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +22 -3
data/node_modules/govuk-frontend/govuk/components/notification-banner/notification-banner.js
CHANGED
@@ -501,8 +501,247 @@ if (detect) return
|
|
501
501
|
})
|
502
502
|
.call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
503
503
|
|
504
|
-
|
504
|
+
/**
|
505
|
+
* Common helpers which do not require polyfill.
|
506
|
+
*
|
507
|
+
* IMPORTANT: If a helper require a polyfill, please isolate it in its own module
|
508
|
+
* so that the polyfill can be properly tree-shaken and does not burden
|
509
|
+
* the components that do not need that helper
|
510
|
+
*
|
511
|
+
* @module common/index
|
512
|
+
*/
|
513
|
+
|
514
|
+
/**
|
515
|
+
* Config flattening function
|
516
|
+
*
|
517
|
+
* Takes any number of objects, flattens them into namespaced key-value pairs,
|
518
|
+
* (e.g. {'i18n.showSection': 'Show section'}) and combines them together, with
|
519
|
+
* greatest priority on the LAST item passed in.
|
520
|
+
*
|
521
|
+
* @returns {object} A flattened object of key-value pairs.
|
522
|
+
*/
|
523
|
+
function mergeConfigs (/* configObject1, configObject2, ...configObjects */) {
|
524
|
+
/**
|
525
|
+
* Function to take nested objects and flatten them to a dot-separated keyed
|
526
|
+
* object. Doing this means we don't need to do any deep/recursive merging of
|
527
|
+
* each of our objects, nor transform our dataset from a flat list into a
|
528
|
+
* nested object.
|
529
|
+
*
|
530
|
+
* @param {object} configObject - Deeply nested object
|
531
|
+
* @returns {object} Flattened object with dot-separated keys
|
532
|
+
*/
|
533
|
+
var flattenObject = function (configObject) {
|
534
|
+
// Prepare an empty return object
|
535
|
+
var flattenedObject = {};
|
536
|
+
|
537
|
+
// Our flattening function, this is called recursively for each level of
|
538
|
+
// depth in the object. At each level we prepend the previous level names to
|
539
|
+
// the key using `prefix`.
|
540
|
+
var flattenLoop = function (obj, prefix) {
|
541
|
+
// Loop through keys...
|
542
|
+
for (var key in obj) {
|
543
|
+
// Check to see if this is a prototypical key/value,
|
544
|
+
// if it is, skip it.
|
545
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
546
|
+
continue
|
547
|
+
}
|
548
|
+
var value = obj[key];
|
549
|
+
var prefixedKey = prefix ? prefix + '.' + key : key;
|
550
|
+
if (typeof value === 'object') {
|
551
|
+
// If the value is a nested object, recurse over that too
|
552
|
+
flattenLoop(value, prefixedKey);
|
553
|
+
} else {
|
554
|
+
// Otherwise, add this value to our return object
|
555
|
+
flattenedObject[prefixedKey] = value;
|
556
|
+
}
|
557
|
+
}
|
558
|
+
};
|
559
|
+
|
560
|
+
// Kick off the recursive loop
|
561
|
+
flattenLoop(configObject);
|
562
|
+
return flattenedObject
|
563
|
+
};
|
564
|
+
|
565
|
+
// Start with an empty object as our base
|
566
|
+
var formattedConfigObject = {};
|
567
|
+
|
568
|
+
// Loop through each of the remaining passed objects and push their keys
|
569
|
+
// one-by-one into configObject. Any duplicate keys will override the existing
|
570
|
+
// key with the new value.
|
571
|
+
for (var i = 0; i < arguments.length; i++) {
|
572
|
+
var obj = flattenObject(arguments[i]);
|
573
|
+
for (var key in obj) {
|
574
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
575
|
+
formattedConfigObject[key] = obj[key];
|
576
|
+
}
|
577
|
+
}
|
578
|
+
}
|
579
|
+
|
580
|
+
return formattedConfigObject
|
581
|
+
}
|
582
|
+
|
583
|
+
/**
|
584
|
+
* @callback nodeListIterator
|
585
|
+
* @param {Element} value - The current node being iterated on
|
586
|
+
* @param {number} index - The current index in the iteration
|
587
|
+
* @param {NodeListOf<Element>} nodes - NodeList from querySelectorAll()
|
588
|
+
* @returns {undefined}
|
589
|
+
*/
|
590
|
+
|
591
|
+
(function(undefined) {
|
592
|
+
|
593
|
+
// Detection from https://raw.githubusercontent.com/Financial-Times/polyfill-library/13cf7c340974d128d557580b5e2dafcd1b1192d1/polyfills/Element/prototype/dataset/detect.js
|
594
|
+
var detect = (function(){
|
595
|
+
if (!document.documentElement.dataset) {
|
596
|
+
return false;
|
597
|
+
}
|
598
|
+
var el = document.createElement('div');
|
599
|
+
el.setAttribute("data-a-b", "c");
|
600
|
+
return el.dataset && el.dataset.aB == "c";
|
601
|
+
}());
|
602
|
+
|
603
|
+
if (detect) return
|
604
|
+
|
605
|
+
// Polyfill derived from https://raw.githubusercontent.com/Financial-Times/polyfill-library/13cf7c340974d128d557580b5e2dafcd1b1192d1/polyfills/Element/prototype/dataset/polyfill.js
|
606
|
+
Object.defineProperty(Element.prototype, 'dataset', {
|
607
|
+
get: function() {
|
608
|
+
var element = this;
|
609
|
+
var attributes = this.attributes;
|
610
|
+
var map = {};
|
611
|
+
|
612
|
+
for (var i = 0; i < attributes.length; i++) {
|
613
|
+
var attribute = attributes[i];
|
614
|
+
|
615
|
+
// This regex has been edited from the original polyfill, to add
|
616
|
+
// support for period (.) separators in data-* attribute names. These
|
617
|
+
// are allowed in the HTML spec, but were not covered by the original
|
618
|
+
// polyfill's regex. We use periods in our i18n implementation.
|
619
|
+
if (attribute && attribute.name && (/^data-\w[.\w-]*$/).test(attribute.name)) {
|
620
|
+
var name = attribute.name;
|
621
|
+
var value = attribute.value;
|
622
|
+
|
623
|
+
var propName = name.substr(5).replace(/-./g, function (prop) {
|
624
|
+
return prop.charAt(1).toUpperCase();
|
625
|
+
});
|
626
|
+
|
627
|
+
// If this browser supports __defineGetter__ and __defineSetter__,
|
628
|
+
// continue using defineProperty. If not (like IE 8 and below), we use
|
629
|
+
// a hacky fallback which at least gives an object in the right format
|
630
|
+
if ('__defineGetter__' in Object.prototype && '__defineSetter__' in Object.prototype) {
|
631
|
+
Object.defineProperty(map, propName, {
|
632
|
+
enumerable: true,
|
633
|
+
get: function() {
|
634
|
+
return this.value;
|
635
|
+
}.bind({value: value || ''}),
|
636
|
+
set: function setter(name, value) {
|
637
|
+
if (typeof value !== 'undefined') {
|
638
|
+
this.setAttribute(name, value);
|
639
|
+
} else {
|
640
|
+
this.removeAttribute(name);
|
641
|
+
}
|
642
|
+
}.bind(element, name)
|
643
|
+
});
|
644
|
+
} else {
|
645
|
+
map[propName] = value;
|
646
|
+
}
|
647
|
+
|
648
|
+
}
|
649
|
+
}
|
650
|
+
|
651
|
+
return map;
|
652
|
+
}
|
653
|
+
});
|
654
|
+
|
655
|
+
}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
656
|
+
|
657
|
+
(function(undefined) {
|
658
|
+
|
659
|
+
// Detection from https://github.com/mdn/content/blob/cf607d68522cd35ee7670782d3ee3a361eaef2e4/files/en-us/web/javascript/reference/global_objects/string/trim/index.md#polyfill
|
660
|
+
var detect = ('trim' in String.prototype);
|
661
|
+
|
662
|
+
if (detect) return
|
663
|
+
|
664
|
+
// Polyfill from https://github.com/mdn/content/blob/cf607d68522cd35ee7670782d3ee3a361eaef2e4/files/en-us/web/javascript/reference/global_objects/string/trim/index.md#polyfill
|
665
|
+
String.prototype.trim = function () {
|
666
|
+
return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
667
|
+
};
|
668
|
+
|
669
|
+
}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
670
|
+
|
671
|
+
/**
|
672
|
+
* Normalise string
|
673
|
+
*
|
674
|
+
* 'If it looks like a duck, and it quacks like a duck…' 🦆
|
675
|
+
*
|
676
|
+
* If the passed value looks like a boolean or a number, convert it to a boolean
|
677
|
+
* or number.
|
678
|
+
*
|
679
|
+
* Designed to be used to convert config passed via data attributes (which are
|
680
|
+
* always strings) into something sensible.
|
681
|
+
*
|
682
|
+
* @param {string} value - The value to normalise
|
683
|
+
* @returns {string | boolean | number | undefined} Normalised data
|
684
|
+
*/
|
685
|
+
function normaliseString (value) {
|
686
|
+
if (typeof value !== 'string') {
|
687
|
+
return value
|
688
|
+
}
|
689
|
+
|
690
|
+
var trimmedValue = value.trim();
|
691
|
+
|
692
|
+
if (trimmedValue === 'true') {
|
693
|
+
return true
|
694
|
+
}
|
695
|
+
|
696
|
+
if (trimmedValue === 'false') {
|
697
|
+
return false
|
698
|
+
}
|
699
|
+
|
700
|
+
// Empty / whitespace-only strings are considered finite so we need to check
|
701
|
+
// the length of the trimmed string as well
|
702
|
+
if (trimmedValue.length > 0 && isFinite(trimmedValue)) {
|
703
|
+
return Number(trimmedValue)
|
704
|
+
}
|
705
|
+
|
706
|
+
return value
|
707
|
+
}
|
708
|
+
|
709
|
+
/**
|
710
|
+
* Normalise dataset
|
711
|
+
*
|
712
|
+
* Loop over an object and normalise each value using normaliseData function
|
713
|
+
*
|
714
|
+
* @param {DOMStringMap} dataset - HTML element dataset
|
715
|
+
* @returns {Object<string, string | boolean | number | undefined>} Normalised dataset
|
716
|
+
*/
|
717
|
+
function normaliseDataset (dataset) {
|
718
|
+
var out = {};
|
719
|
+
|
720
|
+
for (var key in dataset) {
|
721
|
+
out[key] = normaliseString(dataset[key]);
|
722
|
+
}
|
723
|
+
|
724
|
+
return out
|
725
|
+
}
|
726
|
+
|
727
|
+
/**
|
728
|
+
* Notification Banner component
|
729
|
+
*
|
730
|
+
* @class
|
731
|
+
* @param {HTMLElement} $module - HTML element to use for notification banner
|
732
|
+
* @param {NotificationBannerConfig} config - Notification banner config
|
733
|
+
*/
|
734
|
+
function NotificationBanner ($module, config) {
|
505
735
|
this.$module = $module;
|
736
|
+
|
737
|
+
var defaultConfig = {
|
738
|
+
disableAutoFocus: false
|
739
|
+
};
|
740
|
+
this.config = mergeConfigs(
|
741
|
+
defaultConfig,
|
742
|
+
config || {},
|
743
|
+
normaliseDataset($module.dataset)
|
744
|
+
);
|
506
745
|
}
|
507
746
|
|
508
747
|
/**
|
@@ -531,7 +770,7 @@ NotificationBanner.prototype.init = function () {
|
|
531
770
|
NotificationBanner.prototype.setFocus = function () {
|
532
771
|
var $module = this.$module;
|
533
772
|
|
534
|
-
if (
|
773
|
+
if (this.config.disableAutoFocus) {
|
535
774
|
return
|
536
775
|
}
|
537
776
|
|
@@ -553,6 +792,17 @@ NotificationBanner.prototype.setFocus = function () {
|
|
553
792
|
$module.focus();
|
554
793
|
};
|
555
794
|
|
795
|
+
/**
|
796
|
+
* Notification banner config
|
797
|
+
*
|
798
|
+
* @typedef {object} NotificationBannerConfig
|
799
|
+
* @property {boolean} [disableAutoFocus = false] -
|
800
|
+
* If set to `true` the notification banner will not be focussed when the page
|
801
|
+
* loads. This only applies if the component has a `role` of `alert` – in
|
802
|
+
* other cases the component will not be focused on page load, regardless of
|
803
|
+
* this option.
|
804
|
+
*/
|
805
|
+
|
556
806
|
return NotificationBanner;
|
557
807
|
|
558
808
|
})));
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<div class="govuk-notification-banner{% if typeClass %} {{ typeClass }}{% endif %}{% if params.classes %} {{ params.classes }}{% endif %}" role="{{ role }}"
|
30
30
|
aria-labelledby="{{ params.titleId | default('govuk-notification-banner-title')}}"
|
31
31
|
data-module="govuk-notification-banner"
|
32
|
-
{%- if params.disableAutoFocus %} data-disable-auto-focus="
|
32
|
+
{%- if params.disableAutoFocus !== undefined %} data-disable-auto-focus="{{ params.disableAutoFocus }}"{% endif %}
|
33
33
|
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
|
34
34
|
<div class="govuk-notification-banner__header">
|
35
35
|
<h{{ params.titleHeadingLevel | default(2) }} class="govuk-notification-banner__title" id="{{ params.titleId | default('govuk-notification-banner-title') }}" >
|
@@ -114,13 +114,16 @@
|
|
114
114
|
display: block;
|
115
115
|
min-width: govuk-spacing(3);
|
116
116
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
117
|
+
// Increase the touch area for the link to the parent element.
|
118
|
+
@media screen {
|
119
|
+
&:after {
|
120
|
+
content: "";
|
121
|
+
position: absolute;
|
122
|
+
top: 0;
|
123
|
+
right: 0;
|
124
|
+
bottom: 0;
|
125
|
+
left: 0;
|
126
|
+
}
|
124
127
|
}
|
125
128
|
|
126
129
|
// Add link hover decoration to prev/next text if no label present on prev/next only mode
|
@@ -17,6 +17,7 @@
|
|
17
17
|
},
|
18
18
|
{
|
19
19
|
"number": 2,
|
20
|
+
"href": "/page/2",
|
20
21
|
"current": true
|
21
22
|
},
|
22
23
|
{
|
@@ -25,8 +26,8 @@
|
|
25
26
|
}
|
26
27
|
]
|
27
28
|
},
|
28
|
-
"
|
29
|
-
"
|
29
|
+
"hidden": false,
|
30
|
+
"html": "<nav class=\"govuk-pagination\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous</span></a>\n </div>\n <ul class=\"govuk-pagination__list\"><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/1\" aria-label=\"Page 1\">\n 1\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--current\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/2\" aria-label=\"Page 2\" aria-current=\"page\">\n 2\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/3\" aria-label=\"Page 3\">\n 3\n </a>\n </li></ul><div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <span class=\"govuk-pagination__link-title\">Next</span>\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg></a>\n </div></nav>"
|
30
31
|
},
|
31
32
|
{
|
32
33
|
"name": "with custom navigation landmark",
|
@@ -45,6 +46,7 @@
|
|
45
46
|
},
|
46
47
|
{
|
47
48
|
"number": 2,
|
49
|
+
"href": "/page/2",
|
48
50
|
"current": true
|
49
51
|
},
|
50
52
|
{
|
@@ -53,8 +55,8 @@
|
|
53
55
|
}
|
54
56
|
]
|
55
57
|
},
|
56
|
-
"
|
57
|
-
"
|
58
|
+
"hidden": false,
|
59
|
+
"html": "<nav class=\"govuk-pagination\" role=\"navigation\" aria-label=\"search\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous</span></a>\n </div>\n <ul class=\"govuk-pagination__list\"><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/1\" aria-label=\"Page 1\">\n 1\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--current\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/2\" aria-label=\"Page 2\" aria-current=\"page\">\n 2\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/3\" aria-label=\"Page 3\">\n 3\n </a>\n </li></ul><div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <span class=\"govuk-pagination__link-title\">Next</span>\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg></a>\n </div></nav>"
|
58
60
|
},
|
59
61
|
{
|
60
62
|
"name": "with custom link and item text",
|
@@ -74,6 +76,7 @@
|
|
74
76
|
},
|
75
77
|
{
|
76
78
|
"number": "two",
|
79
|
+
"href": "/page/2",
|
77
80
|
"current": true
|
78
81
|
},
|
79
82
|
{
|
@@ -82,8 +85,8 @@
|
|
82
85
|
}
|
83
86
|
]
|
84
87
|
},
|
85
|
-
"
|
86
|
-
"
|
88
|
+
"hidden": false,
|
89
|
+
"html": "<nav class=\"govuk-pagination\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous page</span></a>\n </div>\n <ul class=\"govuk-pagination__list\"><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/1\" aria-label=\"Page one\">\n one\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--current\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/2\" aria-label=\"Page two\" aria-current=\"page\">\n two\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/3\" aria-label=\"Page three\">\n three\n </a>\n </li></ul><div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <span class=\"govuk-pagination__link-title\">Next page</span>\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg></a>\n </div></nav>"
|
87
90
|
},
|
88
91
|
{
|
89
92
|
"name": "with custom accessible labels on item links",
|
@@ -102,6 +105,7 @@
|
|
102
105
|
},
|
103
106
|
{
|
104
107
|
"number": 2,
|
108
|
+
"href": "/page/2",
|
105
109
|
"current": true,
|
106
110
|
"visuallyHiddenText": "2nd page (you are currently on this page)"
|
107
111
|
},
|
@@ -112,8 +116,8 @@
|
|
112
116
|
}
|
113
117
|
]
|
114
118
|
},
|
115
|
-
"
|
116
|
-
"
|
119
|
+
"hidden": false,
|
120
|
+
"html": "<nav class=\"govuk-pagination\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous</span></a>\n </div>\n <ul class=\"govuk-pagination__list\"><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/1\" aria-label=\"1st page\">\n 1\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--current\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/2\" aria-label=\"2nd page (you are currently on this page)\" aria-current=\"page\">\n 2\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/3\" aria-label=\"3rd page\">\n 3\n </a>\n </li></ul><div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <span class=\"govuk-pagination__link-title\">Next</span>\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg></a>\n </div></nav>"
|
117
121
|
},
|
118
122
|
{
|
119
123
|
"name": "with many pages",
|
@@ -142,6 +146,7 @@
|
|
142
146
|
},
|
143
147
|
{
|
144
148
|
"number": 10,
|
149
|
+
"href": "/page/10",
|
145
150
|
"current": true
|
146
151
|
},
|
147
152
|
{
|
@@ -161,8 +166,8 @@
|
|
161
166
|
}
|
162
167
|
]
|
163
168
|
},
|
164
|
-
"
|
165
|
-
"
|
169
|
+
"hidden": false,
|
170
|
+
"html": "<nav class=\"govuk-pagination\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous</span></a>\n </div>\n <ul class=\"govuk-pagination__list\"><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/1\" aria-label=\"Page 1\">\n 1\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--ellipses\">⋯</li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/8\" aria-label=\"Page 8\">\n 8\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/9\" aria-label=\"Page 9\">\n 9\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--current\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/10\" aria-label=\"Page 10\" aria-current=\"page\">\n 10\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/11\" aria-label=\"Page 11\">\n 11\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/12\" aria-label=\"Page 12\">\n 12\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--ellipses\">⋯</li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/40\" aria-label=\"Page 40\">\n 40\n </a>\n </li></ul><div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <span class=\"govuk-pagination__link-title\">Next</span>\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg></a>\n </div></nav>"
|
166
171
|
},
|
167
172
|
{
|
168
173
|
"name": "first page",
|
@@ -173,6 +178,7 @@
|
|
173
178
|
"items": [
|
174
179
|
{
|
175
180
|
"number": 1,
|
181
|
+
"href": "/page/1",
|
176
182
|
"current": true
|
177
183
|
},
|
178
184
|
{
|
@@ -185,8 +191,8 @@
|
|
185
191
|
}
|
186
192
|
]
|
187
193
|
},
|
188
|
-
"
|
189
|
-
"
|
194
|
+
"hidden": false,
|
195
|
+
"html": "<nav class=\"govuk-pagination\" role=\"navigation\" aria-label=\"results\"><ul class=\"govuk-pagination__list\"><li class=\"govuk-pagination__item govuk-pagination__item--current\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/1\" aria-label=\"Page 1\" aria-current=\"page\">\n 1\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/2\" aria-label=\"Page 2\">\n 2\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/3\" aria-label=\"Page 3\">\n 3\n </a>\n </li></ul><div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <span class=\"govuk-pagination__link-title\">Next</span>\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg></a>\n </div></nav>"
|
190
196
|
},
|
191
197
|
{
|
192
198
|
"name": "last page",
|
@@ -205,12 +211,13 @@
|
|
205
211
|
},
|
206
212
|
{
|
207
213
|
"number": 3,
|
214
|
+
"href": "/page/3",
|
208
215
|
"current": true
|
209
216
|
}
|
210
217
|
]
|
211
218
|
},
|
212
|
-
"
|
213
|
-
"
|
219
|
+
"hidden": false,
|
220
|
+
"html": "<nav class=\"govuk-pagination\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous</span></a>\n </div>\n <ul class=\"govuk-pagination__list\"><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/1\" aria-label=\"Page 1\">\n 1\n </a>\n </li><li class=\"govuk-pagination__item\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/2\" aria-label=\"Page 2\">\n 2\n </a>\n </li><li class=\"govuk-pagination__item govuk-pagination__item--current\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/page/3\" aria-label=\"Page 3\" aria-current=\"page\">\n 3\n </a>\n </li></ul></nav>"
|
214
221
|
},
|
215
222
|
{
|
216
223
|
"name": "with prev and next only",
|
@@ -222,8 +229,8 @@
|
|
222
229
|
"href": "/next"
|
223
230
|
}
|
224
231
|
},
|
225
|
-
"
|
226
|
-
"
|
232
|
+
"hidden": false,
|
233
|
+
"html": "<nav class=\"govuk-pagination govuk-pagination--block\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title govuk-pagination__link-title--decorated\">Previous</span></a>\n </div>\n <div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title govuk-pagination__link-title--decorated\">Next</span></a>\n </div></nav>"
|
227
234
|
},
|
228
235
|
{
|
229
236
|
"name": "with prev and next only and labels",
|
@@ -239,8 +246,8 @@
|
|
239
246
|
"href": "/next"
|
240
247
|
}
|
241
248
|
},
|
242
|
-
"
|
243
|
-
"
|
249
|
+
"hidden": false,
|
250
|
+
"html": "<nav class=\"govuk-pagination govuk-pagination--block\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous page</span><span class=\"govuk-visually-hidden\">:</span>\n <span class=\"govuk-pagination__link-label\">1 of 3</span></a>\n </div>\n <div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Next page</span><span class=\"govuk-visually-hidden\">:</span>\n <span class=\"govuk-pagination__link-label\">3 of 3</span></a>\n </div></nav>"
|
244
251
|
},
|
245
252
|
{
|
246
253
|
"name": "with prev and next only and very long labels",
|
@@ -256,8 +263,8 @@
|
|
256
263
|
"href": "/next"
|
257
264
|
}
|
258
265
|
},
|
259
|
-
"
|
260
|
-
"
|
266
|
+
"hidden": false,
|
267
|
+
"html": "<nav class=\"govuk-pagination govuk-pagination--block\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Previous page</span><span class=\"govuk-visually-hidden\">:</span>\n <span class=\"govuk-pagination__link-label\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span></a>\n </div>\n <div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title\">Next page</span><span class=\"govuk-visually-hidden\">:</span>\n <span class=\"govuk-pagination__link-label\">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span></a>\n </div></nav>"
|
261
268
|
},
|
262
269
|
{
|
263
270
|
"name": "with prev and next only in a different language",
|
@@ -273,8 +280,8 @@
|
|
273
280
|
"visuallyHiddenText": "Page suivante"
|
274
281
|
}
|
275
282
|
},
|
276
|
-
"
|
277
|
-
"
|
283
|
+
"hidden": false,
|
284
|
+
"html": "<nav class=\"govuk-pagination govuk-pagination--block\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title govuk-pagination__link-title--decorated\">précédente</span></a>\n </div>\n <div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title govuk-pagination__link-title--decorated\">suivante</span></a>\n </div></nav>"
|
278
285
|
},
|
279
286
|
{
|
280
287
|
"name": "with previous only",
|
@@ -283,8 +290,8 @@
|
|
283
290
|
"href": "/previous"
|
284
291
|
}
|
285
292
|
},
|
286
|
-
"
|
287
|
-
"
|
293
|
+
"hidden": false,
|
294
|
+
"html": "<nav class=\"govuk-pagination govuk-pagination--block\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__prev\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/previous\" rel=\"prev\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--prev\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title govuk-pagination__link-title--decorated\">Previous</span></a>\n </div>\n </nav>"
|
288
295
|
},
|
289
296
|
{
|
290
297
|
"name": "with next only",
|
@@ -293,8 +300,8 @@
|
|
293
300
|
"href": "/next"
|
294
301
|
}
|
295
302
|
},
|
296
|
-
"
|
297
|
-
"
|
303
|
+
"hidden": false,
|
304
|
+
"html": "<nav class=\"govuk-pagination govuk-pagination--block\" role=\"navigation\" aria-label=\"results\"><div class=\"govuk-pagination__next\">\n <a class=\"govuk-link govuk-pagination__link\" href=\"/next\" rel=\"next\">\n <svg class=\"govuk-pagination__icon govuk-pagination__icon--next\" xmlns=\"http://www.w3.org/2000/svg\" height=\"13\" width=\"15\" aria-hidden=\"true\" focusable=\"false\" viewBox=\"0 0 15 13\">\n <path d=\"m8.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z\"></path>\n </svg>\n <span class=\"govuk-pagination__link-title govuk-pagination__link-title--decorated\">Next</span></a>\n </div></nav>"
|
298
305
|
}
|
299
306
|
]
|
300
307
|
}
|