@ons/design-system 51.0.0 → 52.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/components/address-input/autosuggest.address.setter.js +6 -2
- package/components/checkboxes/checkbox-with-autoselect.js +2 -1
- package/components/footer/_macro.njk +3 -3
- package/components/header/_macro.njk +1 -1
- package/components/mutually-exclusive/_macro.njk +1 -1
- package/components/mutually-exclusive/_macro.spec.js +2 -0
- package/components/question/_macro.njk +12 -10
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/ONSdigital/design-system/releases)
|
|
4
4
|
[](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml)
|
|
5
|
-
[](https://codecov.io/gh/ONSdigital/design-system)
|
|
6
|
-
[](https://www.codacy.com/app/bameyrick/design-system)
|
|
7
5
|
[](https://github.com/ONSdigital/design-system/pulls)
|
|
8
6
|
[](https://github.com/ONSdigital/design-system/commits)
|
|
9
7
|
[](https://github.com/ONSdigital/design-system/graphs/contributors)
|
|
@@ -104,14 +104,18 @@ export default class AddressSetter {
|
|
|
104
104
|
|
|
105
105
|
clearManualInputs() {
|
|
106
106
|
this.manualInputs.forEach(input => {
|
|
107
|
-
input
|
|
107
|
+
if (input) {
|
|
108
|
+
input.value = '';
|
|
109
|
+
}
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
checkManualInputsValues(onLoad) {
|
|
112
114
|
if (onLoad) {
|
|
113
115
|
this.originalValues = this.manualInputs.map(input => {
|
|
114
|
-
|
|
116
|
+
if (input) {
|
|
117
|
+
return input.value;
|
|
118
|
+
}
|
|
115
119
|
});
|
|
116
120
|
} else if (this.uprn.value !== '' && this.originalValues.length) {
|
|
117
121
|
this.newValues = this.manualInputs.map(input => {
|
|
@@ -21,7 +21,8 @@ export default class CheckboxWithAutoSelect {
|
|
|
21
21
|
this.unselectAllText = this.button.getAttribute('data-unselect-all');
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
handleButtonEvent() {
|
|
24
|
+
handleButtonEvent(event) {
|
|
25
|
+
event.preventDefault();
|
|
25
26
|
this.checkboxes.forEach(checkbox => {
|
|
26
27
|
checkbox.checked = this.allChecked === false ? true : false;
|
|
27
28
|
});
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
12
|
{% set poweredByLogo %}
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
{% if params.poweredBy is defined and params.poweredBy and params.poweredBy.logo is defined and params.poweredBy.logo %}
|
|
15
15
|
{{
|
|
16
16
|
onsIcon({
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
{{
|
|
24
24
|
onsIcon({
|
|
25
25
|
"iconType": 'ons-logo-cy',
|
|
26
|
-
"altText":
|
|
26
|
+
"altText": 'Swyddfa Ystadegau Gwladol'
|
|
27
27
|
})
|
|
28
28
|
}}
|
|
29
29
|
{% else %}
|
|
30
30
|
{{
|
|
31
31
|
onsIcon({
|
|
32
32
|
"iconType": 'ons-logo-en',
|
|
33
|
-
"altText":
|
|
33
|
+
"altText": 'Office for National Statistics'
|
|
34
34
|
})
|
|
35
35
|
}}
|
|
36
36
|
{% endif %}
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
{% if params.navigation is defined %}
|
|
162
162
|
<div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink ons-u-d-no@l">
|
|
163
163
|
{% if isPatternLib and params.navigation.siteSearchAutosuggest %}
|
|
164
|
-
<span class="ons-grid ons-u-d-no@xxs@xs">
|
|
164
|
+
<span class="ons-grid ons-u-d-no@xxs@xs ons-u-ml-no">
|
|
165
165
|
{{ onsButton({
|
|
166
166
|
"text": "Search",
|
|
167
167
|
"classes": "ons-btn--search ons-u-ml-xs ons-u-d-no ons-js-toggle-search",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dontWrap": true,
|
|
53
53
|
"radios": params.exclusiveOptions,
|
|
54
54
|
"inputClasses": "ons-js-exclusive-option",
|
|
55
|
-
"name": "mutuallyExclusiveRadio",
|
|
55
|
+
"name": params.exclusiveOptions[0].name | default("mutuallyExclusiveRadio"),
|
|
56
56
|
"deselectMessage": params.deselectMessage
|
|
57
57
|
})
|
|
58
58
|
}}
|
|
@@ -45,6 +45,7 @@ const EXAMPLE_MUTUALLY_EXCLUSIVE_RADIOS = {
|
|
|
45
45
|
exclusiveOptions: [
|
|
46
46
|
{
|
|
47
47
|
id: 'house',
|
|
48
|
+
name: 'mutuallyExclusiveRadio',
|
|
48
49
|
label: {
|
|
49
50
|
text: 'House or bungalow',
|
|
50
51
|
},
|
|
@@ -52,6 +53,7 @@ const EXAMPLE_MUTUALLY_EXCLUSIVE_RADIOS = {
|
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
id: 'flat',
|
|
56
|
+
name: 'mutuallyExclusiveRadio',
|
|
55
57
|
label: {
|
|
56
58
|
text: 'Flat, maisonette or apartment',
|
|
57
59
|
},
|
|
@@ -120,14 +120,16 @@
|
|
|
120
120
|
{% endif %}
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
|
-
{%
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
{% if params.submitButton != (false or null) %}
|
|
124
|
+
{% from "components/button/_macro.njk" import onsButton %}
|
|
125
|
+
{{
|
|
126
|
+
onsButton({
|
|
127
|
+
"id": params.submitButton.id,
|
|
128
|
+
"submitType": params.submitButton.submitType,
|
|
129
|
+
"text": params.submitButton.text | default ('Save and continue'),
|
|
130
|
+
"classes": params.submitButton.classes,
|
|
131
|
+
"attributes": params.submitButton.attributes
|
|
132
|
+
})
|
|
133
|
+
}}
|
|
134
|
+
{% endif %}
|
|
133
135
|
{% endmacro %}
|