@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 CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![GitHub release](https://img.shields.io/github/release/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/releases)
4
4
  [![Tests](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml/badge.svg)](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml)
5
- [![codecov](https://codecov.io/gh/ONSdigital/design-system/branch/master/graph/badge.svg)](https://codecov.io/gh/ONSdigital/design-system)
6
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/e8f9a091991d4d5a85d0b0b85e26dde6)](https://www.codacy.com/app/bameyrick/design-system)
7
5
  [![GitHub pull requests](https://img.shields.io/github/issues-pr-raw/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/pulls)
8
6
  [![Github last commit](https://img.shields.io/github/last-commit/ONSdigital/design-system.svg)](https://github.com/ONSdigital/design-system/commits)
9
7
  [![Github contributors](https://img.shields.io/github/contributors/ONSdigital/design-system.svg)](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.value = '';
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
- return input.value;
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": params.poweredBy.alt | default('Swyddfa Ystadegau Gwladol')
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": params.poweredBy.alt | default('Office for National Statistics')
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
- {% from "components/button/_macro.njk" import onsButton %}
124
- {{
125
- onsButton({
126
- "id": params.submitButton.id,
127
- "submitType": params.submitButton.submitType,
128
- "text": params.submitButton.text | default ('Save and continue'),
129
- "classes": params.submitButton.classes,
130
- "attributes": params.submitButton.attributes
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 %}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ons/design-system",
3
3
  "description": "ONS Design System built CSS, JS, and Nunjucks templates",
4
- "version": "51.0.0",
4
+ "version": "52.0.0",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "author": {