hof 22.9.0-beta → 22.9.0-beta.v2

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 (313) hide show
  1. package/package.json +1 -1
  2. package/hof-22.9.0.tgz +0 -0
  3. package/package/.eslintignore +0 -1
  4. package/package/CHANGELOG.md +0 -232
  5. package/package/LICENSE +0 -21
  6. package/package/README.md +0 -1887
  7. package/package/bin/hof-build +0 -10
  8. package/package/bin/hof-transpiler +0 -12
  9. package/package/build/helpers/importer.js +0 -29
  10. package/package/build/helpers/local.js +0 -35
  11. package/package/build/helpers/resolver/import.js +0 -32
  12. package/package/build/helpers/resolver/nearest-package-root.js +0 -33
  13. package/package/build/helpers/resolver/package.js +0 -29
  14. package/package/build/helpers/resolver.js +0 -16
  15. package/package/build/index.js +0 -49
  16. package/package/build/lib/env.js +0 -36
  17. package/package/build/lib/mkdir.js +0 -9
  18. package/package/build/lib/run.js +0 -17
  19. package/package/build/lib/spawn.js +0 -18
  20. package/package/build/tasks/browserify/compress.js +0 -15
  21. package/package/build/tasks/browserify/index.js +0 -48
  22. package/package/build/tasks/build/index.js +0 -6
  23. package/package/build/tasks/images/index.js +0 -27
  24. package/package/build/tasks/index.js +0 -8
  25. package/package/build/tasks/sass/index.js +0 -67
  26. package/package/build/tasks/translate/index.js +0 -20
  27. package/package/build/tasks/watch/index.js +0 -161
  28. package/package/components/address-lookup/default-model.js +0 -76
  29. package/package/components/address-lookup/defaults.js +0 -25
  30. package/package/components/address-lookup/index.js +0 -251
  31. package/package/components/address-lookup/templates/address-lookup.html +0 -14
  32. package/package/components/address-lookup/templates/address.html +0 -22
  33. package/package/components/address-lookup/templates/postcode.html +0 -9
  34. package/package/components/clear-session/Readme.md +0 -46
  35. package/package/components/clear-session/index.js +0 -26
  36. package/package/components/combine-and-loop-fields/Readme.md +0 -42
  37. package/package/components/combine-and-loop-fields/index.js +0 -156
  38. package/package/components/date/fields.js +0 -16
  39. package/package/components/date/index.js +0 -172
  40. package/package/components/date/templates/date.html +0 -20
  41. package/package/components/emailer/assets/images/govuk_logotype_email.png +0 -0
  42. package/package/components/emailer/assets/images/ho_crest_27px.png +0 -0
  43. package/package/components/emailer/assets/images/spacer.gif +0 -0
  44. package/package/components/emailer/email-service.js +0 -51
  45. package/package/components/emailer/emailer.js +0 -53
  46. package/package/components/emailer/index.js +0 -74
  47. package/package/components/emailer/transports/debug.js +0 -74
  48. package/package/components/emailer/transports/index.js +0 -8
  49. package/package/components/emailer/transports/ses.js +0 -36
  50. package/package/components/emailer/transports/smtp.js +0 -26
  51. package/package/components/emailer/transports/stub.js +0 -5
  52. package/package/components/emailer/views/layout.html +0 -63
  53. package/package/components/homeoffice-countries/index.js +0 -22
  54. package/package/components/index.js +0 -13
  55. package/package/components/notify/index.js +0 -62
  56. package/package/components/notify/notify.js +0 -51
  57. package/package/components/session-timeout-warning/index.js +0 -67
  58. package/package/components/summary/index.js +0 -237
  59. package/package/config/builder-defaults.js +0 -45
  60. package/package/config/component-defaults.js +0 -13
  61. package/package/config/hof-defaults.js +0 -65
  62. package/package/config/rate-limits.js +0 -20
  63. package/package/config/sanitisation-rules.js +0 -32
  64. package/package/controller/base-controller.js +0 -296
  65. package/package/controller/behaviour-hooks.js +0 -51
  66. package/package/controller/behaviour-session.js +0 -64
  67. package/package/controller/controller.js +0 -258
  68. package/package/controller/deprecate-error.js +0 -10
  69. package/package/controller/formatting/formatters.js +0 -70
  70. package/package/controller/formatting/index.js +0 -32
  71. package/package/controller/index.js +0 -17
  72. package/package/controller/validation/email.js +0 -30
  73. package/package/controller/validation/index.js +0 -101
  74. package/package/controller/validation/validators.js +0 -181
  75. package/package/controller/validation-error.js +0 -14
  76. package/package/frontend/govuk-template/build/config.js +0 -24
  77. package/package/frontend/govuk-template/build/govuk_template.html +0 -102
  78. package/package/frontend/govuk-template/build/index.js +0 -23
  79. package/package/frontend/govuk-template/govuk_template_generated.html +0 -102
  80. package/package/frontend/govuk-template/index.js +0 -29
  81. package/package/frontend/index.js +0 -9
  82. package/package/frontend/template-mixins/mixins/helpers.js +0 -103
  83. package/package/frontend/template-mixins/mixins/index.js +0 -37
  84. package/package/frontend/template-mixins/mixins/render.js +0 -12
  85. package/package/frontend/template-mixins/mixins/template-mixins.js +0 -520
  86. package/package/frontend/template-mixins/partials/forms/checkbox-group.html +0 -47
  87. package/package/frontend/template-mixins/partials/forms/checkbox.html +0 -16
  88. package/package/frontend/template-mixins/partials/forms/input-submit.html +0 -1
  89. package/package/frontend/template-mixins/partials/forms/input-text-date.html +0 -37
  90. package/package/frontend/template-mixins/partials/forms/input-text-group.html +0 -45
  91. package/package/frontend/template-mixins/partials/forms/option-group.html +0 -43
  92. package/package/frontend/template-mixins/partials/forms/select.html +0 -17
  93. package/package/frontend/template-mixins/partials/forms/textarea-group.html +0 -37
  94. package/package/frontend/template-mixins/partials/mixins/panel.html +0 -4
  95. package/package/frontend/template-partials/index.js +0 -9
  96. package/package/frontend/template-partials/translations/index.js +0 -26
  97. package/package/frontend/template-partials/translations/src/cy/base.json +0 -4
  98. package/package/frontend/template-partials/translations/src/cy/buttons.json +0 -6
  99. package/package/frontend/template-partials/translations/src/cy/cookies.json +0 -104
  100. package/package/frontend/template-partials/translations/src/cy/errorlist.json +0 -6
  101. package/package/frontend/template-partials/translations/src/cy/errors.json +0 -18
  102. package/package/frontend/template-partials/translations/src/cy/terms.json +0 -28
  103. package/package/frontend/template-partials/translations/src/en/accessibility.json +0 -43
  104. package/package/frontend/template-partials/translations/src/en/base.json +0 -5
  105. package/package/frontend/template-partials/translations/src/en/buttons.json +0 -10
  106. package/package/frontend/template-partials/translations/src/en/cookies.json +0 -116
  107. package/package/frontend/template-partials/translations/src/en/errorlist.json +0 -7
  108. package/package/frontend/template-partials/translations/src/en/errors.json +0 -35
  109. package/package/frontend/template-partials/translations/src/en/exit.json +0 -5
  110. package/package/frontend/template-partials/translations/src/en/fields.json +0 -5
  111. package/package/frontend/template-partials/translations/src/en/journey.json +0 -6
  112. package/package/frontend/template-partials/translations/src/en/save-and-exit.json +0 -4
  113. package/package/frontend/template-partials/translations/src/en/terms.json +0 -28
  114. package/package/frontend/template-partials/views/404.html +0 -9
  115. package/package/frontend/template-partials/views/accessibility.html +0 -55
  116. package/package/frontend/template-partials/views/confirm.html +0 -8
  117. package/package/frontend/template-partials/views/confirmation.html +0 -19
  118. package/package/frontend/template-partials/views/content/en/what-happens-next.md +0 -0
  119. package/package/frontend/template-partials/views/cookie-error.html +0 -1
  120. package/package/frontend/template-partials/views/cookies.html +0 -84
  121. package/package/frontend/template-partials/views/email/data-row.html +0 -4
  122. package/package/frontend/template-partials/views/email/formatted.html +0 -12
  123. package/package/frontend/template-partials/views/email/layout.html +0 -63
  124. package/package/frontend/template-partials/views/email/raw.html +0 -11
  125. package/package/frontend/template-partials/views/email/section-row.html +0 -3
  126. package/package/frontend/template-partials/views/error.html +0 -20
  127. package/package/frontend/template-partials/views/exit.html +0 -9
  128. package/package/frontend/template-partials/views/feedback-submitted.html +0 -11
  129. package/package/frontend/template-partials/views/layout.html +0 -55
  130. package/package/frontend/template-partials/views/partials/analytics-table.html +0 -25
  131. package/package/frontend/template-partials/views/partials/back.html +0 -5
  132. package/package/frontend/template-partials/views/partials/bullet-list.html +0 -7
  133. package/package/frontend/template-partials/views/partials/confirmation-alert.html +0 -6
  134. package/package/frontend/template-partials/views/partials/continue.html +0 -5
  135. package/package/frontend/template-partials/views/partials/cookie-banner.html +0 -29
  136. package/package/frontend/template-partials/views/partials/cookie-notification.html +0 -4
  137. package/package/frontend/template-partials/views/partials/cookie-settings-button.html +0 -1
  138. package/package/frontend/template-partials/views/partials/cookie-settings-radio.html +0 -8
  139. package/package/frontend/template-partials/views/partials/details-summary.html +0 -8
  140. package/package/frontend/template-partials/views/partials/external-link.html +0 -1
  141. package/package/frontend/template-partials/views/partials/form.html +0 -10
  142. package/package/frontend/template-partials/views/partials/gatag.html +0 -60
  143. package/package/frontend/template-partials/views/partials/head.html +0 -31
  144. package/package/frontend/template-partials/views/partials/heading.html +0 -11
  145. package/package/frontend/template-partials/views/partials/items-table.html +0 -32
  146. package/package/frontend/template-partials/views/partials/maincontent-left.html +0 -10
  147. package/package/frontend/template-partials/views/partials/navigation.html +0 -8
  148. package/package/frontend/template-partials/views/partials/page.html +0 -23
  149. package/package/frontend/template-partials/views/partials/panel-indent.html +0 -3
  150. package/package/frontend/template-partials/views/partials/session-cookies-table.html +0 -28
  151. package/package/frontend/template-partials/views/partials/session-timeout-warning.html +0 -38
  152. package/package/frontend/template-partials/views/partials/summary-table-row.html +0 -14
  153. package/package/frontend/template-partials/views/partials/summary-table.html +0 -8
  154. package/package/frontend/template-partials/views/partials/table.html +0 -18
  155. package/package/frontend/template-partials/views/partials/validation-list.html +0 -3
  156. package/package/frontend/template-partials/views/partials/validation-summary.html +0 -25
  157. package/package/frontend/template-partials/views/partials/warn.html +0 -7
  158. package/package/frontend/template-partials/views/rate-limit-error.html +0 -10
  159. package/package/frontend/template-partials/views/save-and-exit.html +0 -17
  160. package/package/frontend/template-partials/views/service-unavailable.html +0 -13
  161. package/package/frontend/template-partials/views/session-timeout.html +0 -7
  162. package/package/frontend/template-partials/views/step.html +0 -14
  163. package/package/frontend/template-partials/views/terms.html +0 -26
  164. package/package/frontend/themes/gov-uk/client-js/cookieSettings.js +0 -145
  165. package/package/frontend/themes/gov-uk/client-js/govuk-cookies.js +0 -121
  166. package/package/frontend/themes/gov-uk/client-js/index.js +0 -27
  167. package/package/frontend/themes/gov-uk/client-js/session-timeout-dialog.js +0 -348
  168. package/package/frontend/themes/gov-uk/client-js/skip-to-main.js +0 -19
  169. package/package/frontend/themes/gov-uk/index.js +0 -9
  170. package/package/frontend/themes/gov-uk/styles/_base.scss +0 -17
  171. package/package/frontend/themes/gov-uk/styles/_check_your_answers.scss +0 -155
  172. package/package/frontend/themes/gov-uk/styles/_cookie-banner.scss +0 -111
  173. package/package/frontend/themes/gov-uk/styles/_cookie-settings.scss +0 -33
  174. package/package/frontend/themes/gov-uk/styles/_govuk_frontend_toolkit.scss +0 -23
  175. package/package/frontend/themes/gov-uk/styles/_helpers.scss +0 -5
  176. package/package/frontend/themes/gov-uk/styles/_layout.scss +0 -125
  177. package/package/frontend/themes/gov-uk/styles/_panel-indent.scss +0 -27
  178. package/package/frontend/themes/gov-uk/styles/_pdf.scss +0 -42
  179. package/package/frontend/themes/gov-uk/styles/_session-timeout-dialog.scss +0 -121
  180. package/package/frontend/themes/gov-uk/styles/_typography.scss +0 -27
  181. package/package/frontend/themes/gov-uk/styles/_variables.scss +0 -11
  182. package/package/frontend/themes/gov-uk/styles/govuk.scss +0 -43
  183. package/package/frontend/themes/gov-uk/styles/mixins.scss +0 -16
  184. package/package/frontend/themes/gov-uk/styles/modules/_alerts.scss +0 -73
  185. package/package/frontend/themes/gov-uk/styles/modules/_buttons.scss +0 -5
  186. package/package/frontend/themes/gov-uk/styles/modules/_character-count.scss +0 -8
  187. package/package/frontend/themes/gov-uk/styles/modules/_confirm-page.scss +0 -20
  188. package/package/frontend/themes/gov-uk/styles/modules/_lists.scss +0 -5
  189. package/package/frontend/themes/gov-uk/styles/modules/_progressive-reveal.scss +0 -17
  190. package/package/frontend/themes/gov-uk/styles/modules/_validation.scss +0 -51
  191. package/package/frontend/themes/index.js +0 -5
  192. package/package/frontend/toolkit/assets/images/passports/new-window-link-blue.png +0 -0
  193. package/package/frontend/toolkit/assets/images/passports/new-window-link.png +0 -0
  194. package/package/frontend/toolkit/assets/images/spinner.gif +0 -0
  195. package/package/frontend/toolkit/assets/javascript/character-count.js +0 -99
  196. package/package/frontend/toolkit/assets/javascript/form-focus.js +0 -101
  197. package/package/frontend/toolkit/assets/javascript/helpers.js +0 -177
  198. package/package/frontend/toolkit/assets/javascript/progressive-reveal.js +0 -72
  199. package/package/frontend/toolkit/assets/javascript/validation.js +0 -71
  200. package/package/frontend/toolkit/assets/javascript/vendor/details.polyfill.js +0 -189
  201. package/package/frontend/toolkit/assets/javascript/vendor/indexof.polyfill.js +0 -39
  202. package/package/frontend/toolkit/assets/javascript/vendor/safari-cachebuster.js +0 -6
  203. package/package/frontend/toolkit/assets/stylesheets/_base.scss +0 -17
  204. package/package/frontend/toolkit/assets/stylesheets/_helpers.scss +0 -5
  205. package/package/frontend/toolkit/assets/stylesheets/_layout.scss +0 -118
  206. package/package/frontend/toolkit/assets/stylesheets/_typography.scss +0 -27
  207. package/package/frontend/toolkit/assets/stylesheets/_variables.scss +0 -11
  208. package/package/frontend/toolkit/assets/stylesheets/app.scss +0 -30
  209. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_buttons.scss +0 -47
  210. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_details.scss +0 -38
  211. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_elements-typography.scss +0 -175
  212. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_forms.scss +0 -167
  213. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_helpers.scss +0 -39
  214. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_layout.scss +0 -67
  215. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_lists.scss +0 -40
  216. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_panels.scss +0 -29
  217. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_reset.scss +0 -33
  218. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/_tables.scss +0 -33
  219. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-block-labels.scss +0 -63
  220. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-date.scss +0 -39
  221. package/package/frontend/toolkit/assets/stylesheets/govuk-elements/forms/_form-validation.scss +0 -63
  222. package/package/frontend/toolkit/assets/stylesheets/mixins.scss +0 -16
  223. package/package/frontend/toolkit/assets/stylesheets/modules/_alerts.scss +0 -73
  224. package/package/frontend/toolkit/assets/stylesheets/modules/_buttons.scss +0 -5
  225. package/package/frontend/toolkit/assets/stylesheets/modules/_confirm-page.scss +0 -20
  226. package/package/frontend/toolkit/assets/stylesheets/modules/_lists.scss +0 -5
  227. package/package/frontend/toolkit/assets/stylesheets/modules/_progressive-reveal.scss +0 -17
  228. package/package/frontend/toolkit/assets/stylesheets/modules/_validation.scss +0 -51
  229. package/package/frontend/toolkit/index.js +0 -10
  230. package/package/index.js +0 -351
  231. package/package/lib/deindex.js +0 -18
  232. package/package/lib/encryption.js +0 -23
  233. package/package/lib/ga-tag.js +0 -89
  234. package/package/lib/health.js +0 -26
  235. package/package/lib/helpers.js +0 -66
  236. package/package/lib/logger.js +0 -65
  237. package/package/lib/markdown.js +0 -46
  238. package/package/lib/router.js +0 -111
  239. package/package/lib/serve-static.js +0 -12
  240. package/package/lib/sessions.js +0 -82
  241. package/package/lib/settings.js +0 -74
  242. package/package/lib/which.js +0 -28
  243. package/package/middleware/cookies.js +0 -43
  244. package/package/middleware/deep-translate.js +0 -32
  245. package/package/middleware/errors.js +0 -119
  246. package/package/middleware/index.js +0 -10
  247. package/package/middleware/not-found.js +0 -38
  248. package/package/middleware/rate-limiter.js +0 -98
  249. package/package/middleware/service-unavailable.js +0 -64
  250. package/package/model/apis/axios-settings.js +0 -21
  251. package/package/model/apis/html-to-pdf-converter.js +0 -35
  252. package/package/model/apis/index.js +0 -5
  253. package/package/model/index.js +0 -348
  254. package/package/package.json +0 -147
  255. package/package/sandbox/README.md +0 -66
  256. package/package/sandbox/apps/sandbox/behaviours/clear-session.js +0 -8
  257. package/package/sandbox/apps/sandbox/behaviours/country-select.js +0 -10
  258. package/package/sandbox/apps/sandbox/behaviours/international-number.js +0 -22
  259. package/package/sandbox/apps/sandbox/fields.js +0 -128
  260. package/package/sandbox/apps/sandbox/index.js +0 -99
  261. package/package/sandbox/apps/sandbox/lib/staticAppealStages.js +0 -189
  262. package/package/sandbox/apps/sandbox/sections/summary-data-sections.js +0 -43
  263. package/package/sandbox/apps/sandbox/translations/src/en/errors.json +0 -5
  264. package/package/sandbox/apps/sandbox/translations/src/en/exit.json +0 -4
  265. package/package/sandbox/apps/sandbox/translations/src/en/fields.json +0 -101
  266. package/package/sandbox/apps/sandbox/translations/src/en/journey.json +0 -7
  267. package/package/sandbox/apps/sandbox/translations/src/en/pages.json +0 -72
  268. package/package/sandbox/apps/sandbox/translations/src/en/validation.json +0 -54
  269. package/package/sandbox/apps/sandbox/views/form-guidance-link.html +0 -8
  270. package/package/sandbox/apps/sandbox/views/save-and-exit.html +0 -19
  271. package/package/sandbox/assets/images/icons/icon-caret-left.png +0 -0
  272. package/package/sandbox/assets/images/icons/icon-complete.png +0 -0
  273. package/package/sandbox/assets/images/icons/icon-cross-remove-sign.png +0 -0
  274. package/package/sandbox/assets/js/index.js +0 -70
  275. package/package/sandbox/assets/scss/app.scss +0 -27
  276. package/package/sandbox/codecept.conf.js +0 -15
  277. package/package/sandbox/config.js +0 -17
  278. package/package/sandbox/package.json +0 -26
  279. package/package/sandbox/server.js +0 -23
  280. package/package/sandbox/yarn.lock +0 -262
  281. package/package/transpiler/index.js +0 -2
  282. package/package/transpiler/lib/aggregate.js +0 -32
  283. package/package/transpiler/lib/build.js +0 -15
  284. package/package/transpiler/lib/compile.js +0 -12
  285. package/package/transpiler/lib/expand-dirs.js +0 -14
  286. package/package/transpiler/lib/write-files.js +0 -24
  287. package/package/utilities/autofill/index.js +0 -189
  288. package/package/utilities/autofill/inputs.js +0 -60
  289. package/package/utilities/countries.js +0 -12
  290. package/package/utilities/helpers/index.js +0 -189
  291. package/package/utilities/index.js +0 -9
  292. package/package/utilities/reqres/index.js +0 -18
  293. package/package/utilities/test-data/data/domain.json +0 -7
  294. package/package/utilities/test-data/data/firstname.json +0 -16
  295. package/package/utilities/test-data/data/lastname.json +0 -10
  296. package/package/utilities/test-data/data/postcode.json +0 -12
  297. package/package/utilities/test-data/data/streetname.json +0 -8
  298. package/package/utilities/test-data/data/streetsuffix.json +0 -7
  299. package/package/utilities/test-data/data/town.json +0 -9
  300. package/package/utilities/test-data/index.js +0 -67
  301. package/package/wizard/behaviours/complete.js +0 -20
  302. package/package/wizard/behaviours/index.js +0 -5
  303. package/package/wizard/index.js +0 -124
  304. package/package/wizard/middleware/back-links.js +0 -68
  305. package/package/wizard/middleware/check-complete.js +0 -13
  306. package/package/wizard/middleware/check-progress.js +0 -139
  307. package/package/wizard/middleware/check-session.js +0 -17
  308. package/package/wizard/middleware/csrf.js +0 -47
  309. package/package/wizard/middleware/session-model.js +0 -11
  310. package/package/wizard/middleware/session.js +0 -9
  311. package/package/wizard/model.js +0 -29
  312. package/package/wizard/util/constants.js +0 -5
  313. package/package/wizard/util/helpers.js +0 -19
@@ -1,348 +0,0 @@
1
- /* eslint max-len: 0 */
2
- 'use strict';
3
-
4
- const $ = require('jquery');
5
- window.dialogPolyfill = require('dialog-polyfill');
6
-
7
- // Modal dialog prototype
8
- window.GOVUK.sessionDialog = {
9
- el: document.getElementById('js-modal-dialog'),
10
- $el: $('#js-modal-dialog'),
11
- $lastFocusedEl: null,
12
- $closeButton: $('.modal-dialog .js-dialog-close'),
13
- $fallBackElement: $('.govuk-timeout-warning-fallback'),
14
- dialogIsOpenClass: 'dialog-is-open',
15
- timers: [],
16
- warningTextPrefix: $('.dialog-text-prefix').text(),
17
- warningTextSuffix: '.',
18
- warningText: $('.dialog-text').text(),
19
- warningTextExtra: '',
20
-
21
- // Timer specific markup. If these are not present, timeout and redirection are disabled
22
- $timer: $('#js-modal-dialog .timer'),
23
- $accessibleTimer: $('#js-modal-dialog .at-timer'),
24
-
25
- secondsSessionTimeout: parseInt($('#js-modal-dialog').data('session-timeout'), 10 || 1800),
26
- secondsTimeoutWarning: parseInt($('#js-modal-dialog').data('session-timeout-warning'), 10 || 300),
27
- timeoutRedirectUrl: $('#js-modal-dialog').data('url-redirect'),
28
- timeSessionRefreshed: new Date(),
29
-
30
- bindUIElements: function () {
31
- window.GOVUK.sessionDialog.$closeButton.on('click', function (e) {
32
- e.preventDefault();
33
- window.GOVUK.sessionDialog.closeDialog();
34
- });
35
-
36
- // Close modal when ESC pressed
37
- $(document).keydown(function (e) {
38
- if (window.GOVUK.sessionDialog.isDialogOpen() && e.keyCode === 27) {
39
- window.GOVUK.sessionDialog.closeDialog();
40
- }
41
- });
42
- },
43
-
44
- isDialogOpen: function () {
45
- return window.GOVUK.sessionDialog.el && window.GOVUK.sessionDialog.el.open;
46
- },
47
-
48
- isConfigured: function () {
49
- return window.GOVUK.sessionDialog.$timer.length > 0 &&
50
- window.GOVUK.sessionDialog.$accessibleTimer.length > 0 &&
51
- window.GOVUK.sessionDialog.secondsSessionTimeout &&
52
- window.GOVUK.sessionDialog.secondsTimeoutWarning &&
53
- window.GOVUK.sessionDialog.timeoutRedirectUrl;
54
- },
55
-
56
- openDialog: function () {
57
- if (!window.GOVUK.sessionDialog.isDialogOpen()) {
58
- $('html, body').addClass(window.GOVUK.sessionDialog.dialogIsOpenClass);
59
- window.GOVUK.sessionDialog.saveLastFocusedEl();
60
- window.GOVUK.sessionDialog.makePageContentInert();
61
- window.GOVUK.sessionDialog.el.showModal();
62
- window.GOVUK.sessionDialog.el.open = true;
63
- }
64
- },
65
-
66
- closeDialog: function () {
67
- if (window.GOVUK.sessionDialog.isDialogOpen()) {
68
- $('html, body').removeClass(window.GOVUK.sessionDialog.dialogIsOpenClass);
69
- window.GOVUK.sessionDialog.el.close();
70
- window.GOVUK.sessionDialog.el.open = false;
71
- window.GOVUK.sessionDialog.setFocusOnLastFocusedEl();
72
- window.GOVUK.sessionDialog.removeInertFromPageContent();
73
- window.GOVUK.sessionDialog.refreshSession();
74
- }
75
- },
76
-
77
- saveLastFocusedEl: function () {
78
- window.GOVUK.sessionDialog.$lastFocusedEl = document.activeElement;
79
- if (!window.GOVUK.sessionDialog.$lastFocusedEl || window.GOVUK.sessionDialog.$lastFocusedEl === document.body) {
80
- window.GOVUK.sessionDialog.$lastFocusedEl = null;
81
- } else if (document.querySelector) {
82
- window.GOVUK.sessionDialog.$lastFocusedEl = document.querySelector(':focus');
83
- }
84
- },
85
-
86
- // Set focus back on last focused el when modal closed
87
- setFocusOnLastFocusedEl: function () {
88
- if (window.GOVUK.sessionDialog.$lastFocusedEl) {
89
- window.setTimeout(function () {
90
- window.GOVUK.sessionDialog.$lastFocusedEl.focus();
91
- }, 0);
92
- }
93
- },
94
-
95
- // Set page content to inert to indicate to screenreaders it's inactive
96
- // NB: This will look for #content for toggling inert state
97
- makePageContentInert: function () {
98
- if (document.querySelector('#content')) {
99
- document.querySelector('#content').inert = true;
100
- document.querySelector('#content').setAttribute('aria-hidden', 'true');
101
- }
102
- },
103
-
104
- // Make page content active when modal is not open
105
- // NB: This will look for #content for toggling inert state
106
- removeInertFromPageContent: function () {
107
- if (document.querySelector('#content')) {
108
- document.querySelector('#content').inert = false;
109
- document.querySelector('#content').setAttribute('aria-hidden', 'false');
110
- }
111
- },
112
-
113
- numberToWords: function (n) {
114
- const string = n.toString();
115
- let start;
116
- let end;
117
- let chunk;
118
- let ints;
119
- let i;
120
- let words = 'and';
121
-
122
- if (parseInt(string, 10) === 0) {
123
- return 'zero';
124
- }
125
-
126
- /* Array of units as words */
127
- const units = ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'];
128
-
129
- /* Array of tens as words */
130
- const tens = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'];
131
-
132
- /* Array of scales as words */
133
- const scales = ['', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quatttuor-decillion', 'quindecillion', 'sexdecillion', 'septen-decillion', 'octodecillion', 'novemdecillion', 'vigintillion', 'centillion'];
134
-
135
- /* Split user argument into 3 digit chunks from right to left */
136
- start = string.length;
137
- const chunks = [];
138
- while (start > 0) {
139
- end = start;
140
- chunks.push(string.slice((start = Math.max(0, start - 3)), end));
141
- }
142
-
143
- /* Check if function has enough scale words to be able to stringify the user argument */
144
- const chunksLen = chunks.length;
145
- if (chunksLen > scales.length) {
146
- return '';
147
- }
148
-
149
- /* Stringify each integer in each chunk */
150
- words = [];
151
- for (i = 0; i < chunksLen; i++) {
152
- chunk = parseInt(chunks[i], 10);
153
-
154
- if (chunk) {
155
- /* Split chunk into array of individual integers */
156
- ints = chunks[i].split('').reverse().map(parseFloat);
157
-
158
- /* If tens integer is 1, i.e. 10, then add 10 to units integer */
159
- if (ints[1] === 1) {
160
- ints[0] += 10;
161
- }
162
-
163
- /* Add scale word if chunk array item exists */
164
- if (scales[i]) {
165
- words.push(scales[i]);
166
- }
167
-
168
- /* Add unit word if array item exists */
169
- if (units[ints[0]]) {
170
- words.push(units[ints[0]]);
171
- }
172
-
173
- /* Add tens word if array item exists */
174
- if (tens[ints[1]]) {
175
- words.push(tens[ints[1]]);
176
- }
177
-
178
- /* Add hundreds word if array item exists */
179
- if (units[ints[2]]) {
180
- words.push(units[ints[2]] + ' hundred');
181
- }
182
- }
183
- }
184
- return words.reverse().join(' ');
185
- },
186
-
187
- // Attempt to convert numerics into text as OS VoiceOver
188
- // occasionally stalled when encountering numbers
189
- timeToWords: function (t, unit) {
190
- let words;
191
- if (t > 0) {
192
- try {
193
- words = window.GOVUK.sessionDialog.numberToWords(t);
194
- } catch (e) {
195
- words = t;
196
- }
197
- words = words + ' ' + window.GOVUK.sessionDialog.pluralise(t, unit);
198
- } else {
199
- words = '';
200
- }
201
- return words;
202
- },
203
-
204
- pluralise: function (n, unit) {
205
- return n === 1 ? unit : unit + 's';
206
- },
207
-
208
- numericSpan: function (n, unit) {
209
- return '<span class="tabular-numbers">' + n + '</span> ' + window.GOVUK.sessionDialog.pluralise(n, unit);
210
- },
211
-
212
- countdownText: function (minutes, seconds) {
213
- const minutesText = window.GOVUK.sessionDialog.numericSpan(minutes, 'minute');
214
- const secondsText = window.GOVUK.sessionDialog.numericSpan(seconds, 'second');
215
- return minutes > 0 ? minutesText : secondsText;
216
- },
217
-
218
- countdownAtText: function (minutes, seconds) {
219
- const minutesText = window.GOVUK.sessionDialog.timeToWords(minutes, 'minute');
220
- const secondsText = window.GOVUK.sessionDialog.timeToWords(seconds, 'second');
221
- return minutes > 0 ? minutesText : secondsText;
222
- },
223
-
224
- startCountdown: function () {
225
- const $timer = window.GOVUK.sessionDialog.$timer;
226
- const $accessibleTimer = window.GOVUK.sessionDialog.$accessibleTimer;
227
- let timerRunOnce = false;
228
- const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
229
-
230
- const seconds = window.GOVUK.sessionDialog.secondsUntilSessionTimeout();
231
- const minutes = seconds / 60;
232
-
233
- $timer.text(minutes + ' minute' + (minutes > 1 ? 's' : ''));
234
-
235
- (function countdown() {
236
- const secondsUntilSessionTimeout = window.GOVUK.sessionDialog.secondsUntilSessionTimeout();
237
- const timerExpired = secondsUntilSessionTimeout <= 0;
238
-
239
- if (!timerExpired) {
240
- const minutesLeft = parseInt(secondsUntilSessionTimeout / 60, 10);
241
- const secondsLeft = parseInt(secondsUntilSessionTimeout % 60, 10);
242
-
243
- // Below string will get read out by screen readers every time
244
- // the timeout refreshes.
245
- // Add additional information in extraText which will get announced to AT the
246
- // first time the time out opens
247
- const countdownText = window.GOVUK.sessionDialog.countdownText(minutesLeft, secondsLeft);
248
- const text = window.GOVUK.sessionDialog.warningTextPrefix + '<strong>' + countdownText + '</strong>' + window.GOVUK.sessionDialog.warningTextSuffix + '<p>' + window.GOVUK.sessionDialog.warningText + '</p>';
249
- const countdownAtText = window.GOVUK.sessionDialog.countdownAtText(minutesLeft, secondsLeft);
250
- const atText = window.GOVUK.sessionDialog.warningTextPrefix + countdownAtText + window.GOVUK.sessionDialog.warningTextSuffix + ' ' + window.GOVUK.sessionDialog.warningText;
251
- const extraText = '\n' + window.GOVUK.sessionDialog.warningTextExtra;
252
-
253
- $timer.html(text + ' ' + extraText);
254
-
255
- // Update screen reader friendly content every 20 secs
256
- if (secondsLeft % 20 === 0) {
257
- // Read out the extra content only once.
258
- // Don't read out on iOS VoiceOver which stalls on the longer text
259
- if (!timerRunOnce && !iOS) {
260
- $accessibleTimer.text(atText + extraText);
261
- timerRunOnce = true;
262
- } else {
263
- $accessibleTimer.text(atText);
264
- }
265
- }
266
-
267
- window.GOVUK.sessionDialog.addTimer(countdown, 20);
268
- }
269
- })();
270
- },
271
-
272
- // Clears all timers
273
- clearTimers: function () {
274
- for (let i = 0; i < window.GOVUK.sessionDialog.timers.length; i++) {
275
- clearInterval(window.GOVUK.sessionDialog.timers[i]);
276
- }
277
- },
278
-
279
- refreshSession: function () {
280
- $.get('');
281
- window.GOVUK.sessionDialog.timeSessionRefreshed = new Date();
282
- window.GOVUK.sessionDialog.controller();
283
- },
284
-
285
- redirect: function () {
286
- window.location = window.GOVUK.sessionDialog.timeoutRedirectUrl;
287
- },
288
-
289
- // JS doesn't allow resetting timers globally so timers need
290
- // to be retained for resetting.
291
- addTimer: function (f, seconds) {
292
- window.GOVUK.sessionDialog.timers.push(setInterval(f, seconds * 1000));
293
- },
294
-
295
- secondsSinceRefresh: function () {
296
- return Math.round(Math.abs((window.GOVUK.sessionDialog.timeSessionRefreshed - new Date()) / 1000));
297
- },
298
-
299
- secondsUntilSessionTimeout: function () {
300
- return window.GOVUK.sessionDialog.secondsSessionTimeout - window.GOVUK.sessionDialog.secondsSinceRefresh();
301
- },
302
-
303
- secondsUntilTimeoutWarning: function () {
304
- return window.GOVUK.sessionDialog.secondsUntilSessionTimeout() - window.GOVUK.sessionDialog.secondsTimeoutWarning;
305
- },
306
-
307
- // countdown controller logic
308
- controller: function () {
309
- window.GOVUK.sessionDialog.clearTimers();
310
-
311
- const secondsUntilSessionTimeout = window.GOVUK.sessionDialog.secondsUntilSessionTimeout();
312
-
313
- if (secondsUntilSessionTimeout <= 0) {
314
- // timed out - redirect
315
- window.GOVUK.sessionDialog.redirect();
316
- } else if (secondsUntilSessionTimeout <= window.GOVUK.sessionDialog.secondsTimeoutWarning) {
317
- // timeout warning - show countdown and schedule redirect
318
- window.GOVUK.sessionDialog.openDialog();
319
- window.GOVUK.sessionDialog.startCountdown();
320
- window.GOVUK.sessionDialog.addTimer(window.GOVUK.sessionDialog.controller, window.GOVUK.sessionDialog.secondsUntilSessionTimeout());
321
- } else {
322
- // wait for warning
323
- window.GOVUK.sessionDialog.addTimer(window.GOVUK.sessionDialog.controller, window.GOVUK.sessionDialog.secondsUntilTimeoutWarning());
324
- }
325
- },
326
-
327
- init: function (options) {
328
- $.extend(window.GOVUK.sessionDialog, options);
329
- if (window.GOVUK.sessionDialog.el && window.GOVUK.sessionDialog.isConfigured()) {
330
- // Native dialog is not supported by some browsers so use polyfill
331
- if (typeof HTMLDialogElement !== 'function') {
332
- try {
333
- window.dialogPolyfill.registerDialog(window.GOVUK.sessionDialog.el);
334
- return true;
335
- } catch (error) {
336
- // Doesn't support polyfill (IE8) - display fallback element
337
- window.GOVUK.sessionDialog.$fallBackElement.classList.add('govuk-!-display-block');
338
- return false;
339
- }
340
- }
341
- window.GOVUK.sessionDialog.bindUIElements();
342
- window.GOVUK.sessionDialog.controller();
343
- return true;
344
- }
345
- return false;
346
- }
347
- };
348
- window.GOVUK.sessionDialog.init();
@@ -1,19 +0,0 @@
1
- const skipToMain = function () {
2
- const skipToMainLink = document.getElementById('skip-to-main');
3
- const firstControlId = skipToMainLink.hash.split('#')[1] ? skipToMainLink.hash.split('#')[1] : 'main-content';
4
- if(firstControlId === 'main-content') {
5
- skipToMainLink.setAttribute('href', '#main-content');
6
- }
7
- if(firstControlId) {
8
- // eslint-disable-next-line no-unused-vars
9
- skipToMainLink.onclick = function (e) {
10
- // here timeout added just to make this functionality asynchronous
11
- // to focus on form as well as non form contents
12
- setTimeout(() => {
13
- const firstControl = document.getElementById(firstControlId);
14
- firstControl.focus();
15
- }, 10);
16
- };
17
- }
18
- };
19
- skipToMain();
@@ -1,9 +0,0 @@
1
- const template = require('../../govuk-template');
2
- const path = require('path');
3
-
4
- const partials = require('../../template-partials');
5
-
6
- module.exports = options => template(options);
7
-
8
- module.exports.views = [path.resolve(__dirname, './views'), partials.views];
9
- module.exports.translations = partials.resources();
@@ -1,17 +0,0 @@
1
- html {
2
- background: $grey-3;
3
- }
4
- body {
5
- background: $white;
6
- }
7
- .main-content {
8
- img {
9
- max-width: 100%;
10
- }
11
- .svg {
12
- width: 100%;
13
- }
14
- }
15
- .hmpo {
16
- white-space: nowrap;
17
- }
@@ -1,155 +0,0 @@
1
-
2
- .phase-banner {
3
- @include phase-banner(beta);
4
- }
5
-
6
- .govuk-table {
7
- margin-bottom: 30px;
8
- }
9
-
10
- .table-details {
11
- width: 100%;
12
- margin-bottom: 3em;
13
-
14
- tbody {
15
- tr.spacer {
16
- height: 3em;
17
- }
18
-
19
- td:nth-child(1) {
20
- width: 40%;
21
- }
22
- td:nth-child(2) {
23
- width: 60%;
24
- }
25
- td:nth-child(3) {
26
- text-align: right;
27
- padding-right: 0;
28
- }
29
- }
30
-
31
- .button {
32
- margin: 0;
33
- background: #dde0e1;
34
- color: #000;
35
- }
36
- }
37
-
38
- .form-textarea--revealed {
39
- @media (max-width: 40.0525em) {
40
- width: 100%;
41
- }
42
- @media (min-width: 40.0625em){
43
- width: 95%;
44
- }
45
- }
46
-
47
- button.govuk-link {
48
- background: none!important;
49
- border: none;
50
- padding: 0!important;
51
- font-size: arial, sans-serif;
52
- /* color: #069; */
53
- text-decoration: underline;
54
- cursor: pointer;
55
- display: block;
56
- margin-bottom: 1em;
57
- color: #1d70b8;
58
- font-size: 1em;
59
- }
60
-
61
- .govuk-font-weight-bold {
62
- font-weight: 700!important;
63
- }
64
-
65
- .govuk-panel--confirmation {
66
- color: #ffffff;
67
- background: #00703c;
68
- }
69
-
70
- .govuk-panel {
71
- font-family: "GDS Transport", Arial, sans-serif;
72
- -webkit-font-smoothing: antialiased;
73
- -moz-osx-font-smoothing: grayscale;
74
- font-weight: 400;
75
- font-size: 16px;
76
- font-size: 1rem;
77
- line-height: 1.25;
78
- box-sizing: border-box;
79
- margin-bottom: 15px;
80
- padding: 35px;
81
- border: 5px solid transparent;
82
- text-align: center;
83
- @media (max-width: 40.0525em) {
84
- padding: 25px;
85
- }
86
- @media (min-width: 40.0625em){
87
- font-size: 19px;
88
- font-size: 1.1875rem;
89
- line-height: 1.31579;
90
- }
91
- }
92
-
93
- .alert-complete {
94
- @media (min-width: 40em) {
95
- margin-left: 28.33%;
96
- margin-right: -28.33%;
97
- }
98
- }
99
-
100
- .action-col {
101
- text-align: right;
102
- vertical-align: top
103
- }
104
-
105
- .data-col {
106
- min-width: 150px;
107
- width: 300px;
108
- }
109
-
110
- details {
111
- margin-top: 34px;
112
- }
113
-
114
- span.form-hint {
115
- display: block;
116
- padding-top: 0.75em;
117
- margin-bottom: 0.75em;
118
- }
119
-
120
- .govuk-details__text {
121
- padding: 15px;
122
- padding-left: 20px;
123
- border-left: 5px solid #b1b4b6;
124
- }
125
-
126
- .error-summary ul li a { color: #B00E1F; }
127
-
128
- // Check your answers page styles
129
- .confirm-label {
130
- font-weight: bold;
131
- width: 40%;
132
- }
133
-
134
- .confirm-value {
135
- width: 60%;
136
- word-break: break-word;
137
- }
138
-
139
- .confirm-row {
140
- display: table-row;
141
- > * {
142
- border-bottom: 1px solid $grey-2;
143
- display: table-cell;
144
- }
145
- .confirm-label, .confirm-value {
146
- padding: 10px 20px 10px 0;
147
- }
148
- }
149
-
150
- dl {
151
- margin-bottom: 40px;
152
- @media (min-width: 641px) {
153
- margin-bottom: 60px;
154
- }
155
- }
@@ -1,111 +0,0 @@
1
- #global-cookie-message {
2
- background: $panel-colour;
3
- padding: 0;
4
- .js-enabled {
5
- display: none;
6
- }
7
- }
8
-
9
- #cookie-banner {
10
- margin: 0 15px;
11
- p {
12
- margin: 0;
13
- }
14
- .column-two-thirds {
15
- padding: 0;
16
- }
17
- .heading-medium {
18
- font-weight: 700;
19
- font-size: 18px;
20
- line-height: 1.2;
21
- margin: 0.5em 0;
22
- }
23
- #cookie-banner-actions {
24
- display: flex;
25
- justify-content: space-between;
26
- align-items: center;
27
- flex-wrap: wrap;
28
- padding: 15px 0;
29
- button {
30
- flex-grow: 1;
31
- margin: 0 15px 15px 0;
32
- }
33
- }
34
- @media (min-width: 641px) {
35
- margin: 0 30px;
36
- .heading-medium {
37
- font-size: 24px;
38
- line-height: 1.25;
39
- margin: 0.83333em 0;
40
- }
41
- #cookie-banner-actions {
42
- .button {
43
- margin: 0 15px 0 0;
44
- }
45
- }
46
- }
47
- @media (min-width: 1020px) {
48
- margin: 0 auto;
49
- }
50
- }
51
-
52
- #cookie-banner-submitted {
53
- display: none;
54
- justify-content: space-between;
55
- align-items: center;
56
- button {
57
- margin: 0.5em 0;
58
- height: fit-content;
59
- }
60
- }
61
-
62
- // the following are additional hof specific govuk cookie banner styling
63
- .govuk-banner--success {
64
- border-color: #00703c;
65
- color: #00703c;
66
- }
67
-
68
- .govuk-banner {
69
- border: 5px solid #1d70b8;
70
- font-size: 0;
71
- margin-bottom: 30px;
72
- padding: 10px;
73
- }
74
-
75
- .govuk-banner__icon{
76
- display: inline-block;
77
- }
78
-
79
- .govuk-banner__message {
80
- font-family: "GDS Transport", Arial, sans-serif;
81
- -webkit-font-smoothing: antialiased;
82
- font-weight: 400;
83
- font-size: 1rem;
84
- line-height: 1.25;
85
- color: #0b0c0c;
86
- display: block;
87
- overflow: hidden;
88
- display: inline-block;
89
- margin-left: 10px;
90
- }
91
-
92
- .govuk-banner__assistive {
93
- position: absolute !important;
94
- width: 1px !important;
95
- height: 1px !important;
96
- margin: 0 !important;
97
- padding: 0 !important;
98
- overflow: hidden !important;
99
- clip: rect(0 0 0 0) !important;
100
- clip-path: inset(50%) !important;
101
- border: 0 !important;
102
- white-space: nowrap !important;
103
- }
104
-
105
- .cookie-table-holder > table > tbody > tr > td:first-child{
106
- font-weight:bold;
107
- }
108
-
109
- .js-enabled #global-cookie-message {
110
- display: none;
111
- }
@@ -1,33 +0,0 @@
1
- #cookie-settings {
2
- .js-enabled {
3
- display: none;
4
- }
5
- }
6
-
7
- #cookie-notification {
8
- border: 4px solid $govuk-blue;
9
- margin-top: 15px;
10
- margin-bottom: 15px;
11
- padding: 15px 10px;
12
- display: none;
13
- .heading-medium {
14
- margin-top: 0;
15
- }
16
- p {
17
- font-size: 16px;
18
- margin-bottom: 10px;
19
- }
20
- @media (min-width: 641px) {
21
- border: 5px solid $govuk-blue;
22
- margin-top: 30px;
23
- margin-bottom: 30px;
24
- padding: 20px 15px 15px;
25
- p {
26
- font-size: 19px;
27
- }
28
- }
29
- }
30
-
31
- #cookie-notification:focus {
32
- outline: 3px solid #ffbf47;
33
- }