hof 23.0.0-vite-sourcemap-beta → 23.0.0-vite-sourcemap-beta.3

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +97 -6
  3. package/build/tasks/vite/index.js +4 -1
  4. package/build/tasks/vite/vite.config.js +1 -4
  5. package/components/amount-with-unit-select/fields.js +15 -0
  6. package/components/amount-with-unit-select/hooks.js +168 -0
  7. package/components/amount-with-unit-select/index.js +107 -0
  8. package/components/amount-with-unit-select/templates/amount-with-unit-select.html +20 -0
  9. package/components/amount-with-unit-select/utils.js +197 -0
  10. package/components/amount-with-unit-select/validation.js +175 -0
  11. package/components/index.js +1 -0
  12. package/controller/controller.js +5 -3
  13. package/controller/validation/index.js +1 -1
  14. package/controller/validation/validators.js +0 -1
  15. package/frontend/template-mixins/mixins/template-mixins.js +55 -5
  16. package/frontend/template-mixins/partials/forms/grouped-inputs-select.html +13 -0
  17. package/frontend/template-mixins/partials/forms/grouped-inputs-text.html +37 -0
  18. package/frontend/themes/gov-uk/styles/_grouped-input.scss +5 -0
  19. package/frontend/themes/gov-uk/styles/govuk.scss +1 -0
  20. package/frontend/toolkit/assets/javascript/form-focus.js +4 -0
  21. package/package.json +2 -1
  22. package/sandbox/apps/sandbox/fields.js +18 -1
  23. package/sandbox/apps/sandbox/index.js +4 -0
  24. package/sandbox/apps/sandbox/sections/summary-data-sections.js +7 -1
  25. package/sandbox/apps/sandbox/translations/en/default.json +33 -0
  26. package/sandbox/apps/sandbox/translations/src/en/fields.json +10 -0
  27. package/sandbox/apps/sandbox/translations/src/en/pages.json +3 -0
  28. package/sandbox/apps/sandbox/translations/src/en/validation.json +12 -0
  29. package/sandbox/public/assets/index-CsI1K_CH.js +60 -0
  30. package/sandbox/public/css/app.css +7 -3
  31. package/sandbox/public/js/bundle.js +1 -1
  32. package/sandbox/public/js/bundle.js.map +1 -0
@@ -39,5 +39,11 @@ module.exports = {
39
39
  ],
40
40
  whatHappened: [
41
41
  'whatHappened'
42
- ]
42
+ ],
43
+ amountWithUnitSelect:
44
+ [{
45
+ field: 'amountWithUnitSelect',
46
+ parse: val => val ?
47
+ (val.substring(0, val.lastIndexOf('-')) || '0') + ' ' + val.substring(val.lastIndexOf('-') + 1) : ''
48
+ }]
43
49
  };
@@ -107,6 +107,24 @@
107
107
  "options": {
108
108
  "null": "Select..."
109
109
  }
110
+ },
111
+ "amountWithUnitSelect": {
112
+ "label": "Amount",
113
+ "amountLabel": "Amount:",
114
+ "unitLabel": "Unit:",
115
+ "options": [
116
+ {
117
+ "null": "Select..."
118
+ },
119
+ {
120
+ "label": "Litres",
121
+ "value": "L"
122
+ },
123
+ {
124
+ "label": "Kilograms",
125
+ "value": "KG"
126
+ }
127
+ ]
110
128
  }
111
129
  },
112
130
  "journey": {
@@ -163,6 +181,9 @@
163
181
  },
164
182
  "whatHappened": {
165
183
  "header": "What happened"
184
+ },
185
+ "amountWithUnitSelect": {
186
+ "header": "Entered amount"
166
187
  }
167
188
  }
168
189
  },
@@ -240,6 +261,18 @@
240
261
  },
241
262
  "appealStages": {
242
263
  "required": "Select an appeal stage from the list"
264
+ },
265
+ "amountWithUnitSelect": {
266
+ "default": "Enter the amount in the correct format; for example, 10 Litres",
267
+ "alphanum": "The amount must not contain any special characters",
268
+ "required": "Enter an amount and a unit value"
269
+ },
270
+ "amountWithUnitSelect-unit": {
271
+ "default": "A valid value must be selected as the amount unit",
272
+ "required": "A unit must be selected for the amount"
273
+ },
274
+ "amountWithUnitSelect-amount": {
275
+ "required": "An amount must be selected with the unit"
243
276
  }
244
277
  }
245
278
  }
@@ -97,5 +97,15 @@
97
97
  "options": {
98
98
  "null": "Select..."
99
99
  }
100
+ },
101
+ "amountWithUnitSelect": {
102
+ "label": "Amount",
103
+ "amountLabel": "Amount:",
104
+ "unitLabel": "Unit:",
105
+ "options": [
106
+ { "null": "Select..." },
107
+ { "label": "Litres", "value": "L" },
108
+ { "label": "Kilograms", "value": "KG" }
109
+ ]
100
110
  }
101
111
  }
@@ -45,6 +45,9 @@
45
45
  },
46
46
  "whatHappened": {
47
47
  "header": "What happened"
48
+ },
49
+ "amountWithUnitSelect": {
50
+ "header": "Entered amount"
48
51
  }
49
52
  }
50
53
  },
@@ -50,5 +50,17 @@
50
50
  },
51
51
  "appealStages": {
52
52
  "required": "Select an appeal stage from the list"
53
+ },
54
+ "amountWithUnitSelect": {
55
+ "default": "Enter the amount in the correct format; for example, 10 Litres",
56
+ "alphanum": "The amount must not contain any special characters",
57
+ "required": "Enter an amount and a unit value"
58
+ },
59
+ "amountWithUnitSelect-unit": {
60
+ "default": "A valid value must be selected as the amount unit",
61
+ "required": "A unit must be selected for the amount"
62
+ },
63
+ "amountWithUnitSelect-amount": {
64
+ "required": "An amount must be selected with the unit"
53
65
  }
54
66
  }