hmrc-frontend 5.9.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hmrc/VERSION.txt +1 -1
- package/hmrc/{accessible-autocomplete-5.9.0.css → accessible-autocomplete-5.11.0.css} +4 -2
- package/hmrc/{accessible-autocomplete-5.9.0.js → accessible-autocomplete-5.11.0.js} +43 -0
- package/hmrc/accessible-autocomplete.js +9 -0
- package/hmrc/accessible-autocomplete.scss +8 -0
- package/hmrc/all.js +1678 -1642
- package/hmrc/components/accessible-autocomplete/README.md +64 -0
- package/hmrc/components/accessible-autocomplete/accessible-autocomplete.js +21 -0
- package/hmrc/components/accessible-autocomplete/macro.njk +3 -0
- package/hmrc/components/accessible-autocomplete/template.njk +42 -0
- package/hmrc/components/back-link-helper/README.md +4 -0
- package/hmrc/components/back-link-helper/back-link-helper.js +30 -0
- package/hmrc/{hmrc-frontend-5.9.0.min.css → hmrc-frontend-5.11.0.min.css} +1 -1
- package/hmrc/{hmrc-frontend-5.9.0.min.js → hmrc-frontend-5.11.0.min.js} +2 -2
- package/hmrc/{hmrc-frontend-ie8-5.9.0.min.css → hmrc-frontend-ie8-5.11.0.min.css} +1 -1
- package/hmrc/maps/accessible-autocomplete-5.11.0.css.map +1 -0
- package/hmrc/maps/hmrc-frontend-5.11.0.min.css.map +1 -0
- package/hmrc/maps/hmrc-frontend-5.11.0.min.js.map +1 -0
- package/hmrc/maps/hmrc-frontend-ie8-5.11.0.min.css.map +1 -0
- package/package.json +1 -1
- package/hmrc/maps/accessible-autocomplete-5.9.0.css.map +0 -1
- package/hmrc/maps/hmrc-frontend-5.9.0.min.css.map +0 -1
- package/hmrc/maps/hmrc-frontend-5.9.0.min.js.map +0 -1
- package/hmrc/maps/hmrc-frontend-ie8-5.9.0.min.css.map +0 -1
package/hmrc/VERSION.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.
|
|
1
|
+
5.11.0
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
.autocomplete__wrapper{position:relative}.autocomplete__hint,.autocomplete__input{-webkit-appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;margin-bottom:0;width:100%}.autocomplete__input{background-color:rgba(0,0,0,0);position:relative}.autocomplete__hint{color:#b1b4b6;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{outline:3px solid #fd0;outline-offset:0;-webkit-box-shadow:inset 0 0 0 2px;box-shadow:inset 0 0 0 2px}.autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{-webkit-box-shadow:rgba(0,0,0,.256863) 0 2px 6px;box-shadow:0 2px 6px rgba(0,0,0,.256863);left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-left-width:0;border-bottom:1px solid #b1b4b6;border-right-width:0;border-top-width:1px;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}@media (-ms-high-contrast:active),(forced-colors:active){.autocomplete__menu{border-color:FieldText}.autocomplete__option{background-color:Field;color:FieldText}.autocomplete__option--focused,.autocomplete__option:hover{forced-color-adjust:none;background-color:SelectedItem;border-color:SelectedItem;color:SelectedItemText;outline-color:SelectedItemText}}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:16px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:19px;line-height:1.31579}}
|
|
2
|
-
|
|
1
|
+
.autocomplete__wrapper{position:relative}.autocomplete__hint,.autocomplete__input{-webkit-appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;margin-bottom:0;width:100%}.autocomplete__input{background-color:rgba(0,0,0,0);position:relative}.autocomplete__hint{color:#b1b4b6;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{outline:3px solid #fd0;outline-offset:0;-webkit-box-shadow:inset 0 0 0 2px;box-shadow:inset 0 0 0 2px}.autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{-webkit-box-shadow:rgba(0,0,0,.256863) 0 2px 6px;box-shadow:0 2px 6px rgba(0,0,0,.256863);left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-left-width:0;border-bottom:1px solid #b1b4b6;border-right-width:0;border-top-width:1px;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}@media (-ms-high-contrast:active),(forced-colors:active){.autocomplete__menu{border-color:FieldText}.autocomplete__option{background-color:Field;color:FieldText}.autocomplete__option--focused,.autocomplete__option:hover{forced-color-adjust:none;background-color:SelectedItem;border-color:SelectedItem;color:SelectedItemText;outline-color:SelectedItemText}}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:16px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:19px;line-height:1.31579}}.autocomplete__input,.autocomplete__wrapper{font-family:GDS Transport,arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:16px;font-size:1rem;line-height:1.25}
|
|
2
|
+
|
|
3
|
+
/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */@font-face{font-family:GDS Transport;font-style:normal;font-weight:400;src:url(/assets/fonts/light-94a07e06a1-v2.woff2) format("woff2"),url(/assets/fonts/light-f591b13f7d-v2.woff) format("woff");font-display:fallback}@font-face{font-family:GDS Transport;font-style:normal;font-weight:700;src:url(/assets/fonts/bold-b542beb274-v2.woff2) format("woff2"),url(/assets/fonts/bold-affa96571d-v2.woff) format("woff");font-display:fallback}@media print{.autocomplete__input,.autocomplete__wrapper{font-family:sans-serif}}@media (min-width:40.0625em){.autocomplete__input,.autocomplete__wrapper{font-size:19px;font-size:1.1875rem;line-height:1.31579}}@media print{.autocomplete__input,.autocomplete__wrapper{font-size:14pt;line-height:1.15}}
|
|
4
|
+
/*# sourceMappingURL=maps/accessible-autocomplete-5.11.0.css.map */
|
|
@@ -1616,6 +1616,49 @@
|
|
|
1616
1616
|
|
|
1617
1617
|
var HMRCAccessibleAutocomplete = unwrapExports(accessibleAutocomplete_min);
|
|
1618
1618
|
|
|
1619
|
+
/**
|
|
1620
|
+
* TODO: Ideally this would be a NodeList.prototype.forEach polyfill
|
|
1621
|
+
* This seems to fail in IE8, requires more investigation.
|
|
1622
|
+
* See: https://github.com/imagitama/nodelist-foreach-polyfill
|
|
1623
|
+
*/
|
|
1624
|
+
// eslint-disable-next-line consistent-return
|
|
1625
|
+
function nodeListForEach(nodes, callback) {
|
|
1626
|
+
if (window.NodeList.prototype.forEach) {
|
|
1627
|
+
return nodes.forEach(callback);
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
for (var i = 0; i < nodes.length; i += 1) {
|
|
1631
|
+
callback.call(window, nodes[i], i, nodes);
|
|
1632
|
+
}
|
|
1633
|
+
} // eslint-disable-next-line import/prefer-default-export
|
|
1634
|
+
|
|
1635
|
+
function AccessibleAutoComplete($module, window, document) {
|
|
1636
|
+
this.$module = $module;
|
|
1637
|
+
this.window = window;
|
|
1638
|
+
this.document = document;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
AccessibleAutoComplete.prototype.init = function init() {
|
|
1642
|
+
if (this.$module) {
|
|
1643
|
+
var showAllValues = this.$module.getAttribute('data-show-all-values') === 'true';
|
|
1644
|
+
var autoselect = this.$module.getAttribute('data-auto-select') === 'true';
|
|
1645
|
+
var defaultValue = this.$module.getAttribute('data-default-value');
|
|
1646
|
+
window.HMRCAccessibleAutocomplete.enhanceSelectElement({
|
|
1647
|
+
selectElement: this.$module,
|
|
1648
|
+
showAllValues: showAllValues,
|
|
1649
|
+
autoselect: autoselect,
|
|
1650
|
+
defaultValue: defaultValue
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1619
1655
|
window.HMRCAccessibleAutocomplete = HMRCAccessibleAutocomplete;
|
|
1656
|
+
var $AccessibleAutocomplete = document.querySelectorAll('select[data-module="hmrc-accessible-autocomplete"]');
|
|
1657
|
+
|
|
1658
|
+
if ($AccessibleAutocomplete) {
|
|
1659
|
+
nodeListForEach($AccessibleAutocomplete, function (selectElement) {
|
|
1660
|
+
new AccessibleAutoComplete(selectElement, window, document).init();
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1620
1663
|
|
|
1621
1664
|
})));
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import HMRCAccessibleAutocomplete from 'accessible-autocomplete';
|
|
2
|
+
import { nodeListForEach } from './common';
|
|
3
|
+
import AccessibleAutoComplete from './components/accessible-autocomplete/accessible-autocomplete';
|
|
2
4
|
|
|
3
5
|
window.HMRCAccessibleAutocomplete = HMRCAccessibleAutocomplete;
|
|
6
|
+
|
|
7
|
+
const $AccessibleAutocomplete = document.querySelectorAll('select[data-module="hmrc-accessible-autocomplete"]');
|
|
8
|
+
if ($AccessibleAutocomplete) {
|
|
9
|
+
nodeListForEach($AccessibleAutocomplete, (selectElement) => {
|
|
10
|
+
new AccessibleAutoComplete(selectElement, window, document).init();
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
@import "../../govuk-frontend/govuk/settings/all";
|
|
2
|
+
@import "../../govuk-frontend/govuk/tools/all";
|
|
3
|
+
@import "../../govuk-frontend/govuk/helpers/all";
|
|
1
4
|
@import "../../accessible-autocomplete/dist/accessible-autocomplete.min";
|
|
5
|
+
|
|
6
|
+
.autocomplete__wrapper,
|
|
7
|
+
.autocomplete__input {
|
|
8
|
+
@include govuk-font($size: 19);
|
|
9
|
+
}
|