@hmcts/rpx-xui-common-lib 2.1.6-angular-upgrade-11-welsh → 2.1.6-javascript-void

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 (361) hide show
  1. package/README.md +1 -1
  2. package/esm2022/hmcts-rpx-xui-common-lib.mjs +5 -0
  3. package/esm2022/lib/components/accessibility/accessibility.component.mjs +833 -0
  4. package/esm2022/lib/components/checkbox-list/checkbox-list.component.mjs +232 -0
  5. package/esm2022/lib/components/contact-details/contact-details.component.mjs +123 -0
  6. package/esm2022/lib/components/cookie-banner/cookie-banner.component.mjs +151 -0
  7. package/esm2022/lib/components/due-date/due-date.component.mjs +141 -0
  8. package/esm2022/lib/components/exui-main-wrapper/exui-page-wrapper.component.mjs +80 -0
  9. package/esm2022/lib/components/find-location/find-location.component.mjs +220 -0
  10. package/esm2022/lib/components/find-person/find-person.component.mjs +234 -0
  11. package/esm2022/lib/components/find-service/find-service.component.mjs +193 -0
  12. package/esm2022/lib/components/find-task-name/find-task-name.component.mjs +200 -0
  13. package/esm2022/lib/components/generic-filter/generic-filter-utils.mjs +21 -0
  14. package/esm2022/lib/components/generic-filter/generic-filter.component.mjs +1224 -0
  15. package/esm2022/lib/components/hmcts-session-dialog/hmcts-session-dialog.component.mjs +56 -0
  16. package/esm2022/lib/components/invite-user-form/invite-user-form.component.mjs +51 -0
  17. package/esm2022/lib/components/invite-user-permissions/invite-user-permission.component.mjs +54 -0
  18. package/esm2022/lib/components/loading-spinner/loading-spinner.component.mjs +33 -0
  19. package/esm2022/lib/components/pagination/pagination.component.mjs +92 -0
  20. package/esm2022/lib/components/public_api.mjs +39 -0
  21. package/esm2022/lib/components/search-judicials/search-judicials.component.mjs +185 -0
  22. package/esm2022/lib/components/search-location/search-location.component.mjs +240 -0
  23. package/esm2022/lib/components/search-service/search-service.component.mjs +94 -0
  24. package/esm2022/lib/components/search-venue/search-venue.component.mjs +188 -0
  25. package/esm2022/lib/components/selected-case/selected-case.component.mjs +381 -0
  26. package/esm2022/lib/components/selected-case-confirm/selected-case-confirm.component.mjs +135 -0
  27. package/esm2022/lib/components/selected-case-list/selected-case-list.component.mjs +98 -0
  28. package/esm2022/lib/components/service-message/service-message.component.mjs +62 -0
  29. package/esm2022/lib/components/service-messages/service-messages.component.mjs +163 -0
  30. package/esm2022/lib/components/share-case/share-case.component.mjs +427 -0
  31. package/esm2022/lib/components/share-case-confirm/share-case-confirm.component.mjs +85 -0
  32. package/esm2022/lib/components/tab/tab.component.mjs +40 -0
  33. package/esm2022/lib/components/tc-confirm/tc-confirm.component.mjs +66 -0
  34. package/esm2022/lib/components/terms-and-conditions/tc-display/tc-display-html/tc-display-html.component.mjs +17 -0
  35. package/esm2022/lib/components/terms-and-conditions/tc-display/tc-display-plain/tc-display-plain.component.mjs +17 -0
  36. package/esm2022/lib/components/terms-and-conditions/terms-and-conditions.component.mjs +58 -0
  37. package/esm2022/lib/components/user-details/user-details.component.mjs +276 -0
  38. package/esm2022/lib/components/user-list/user-list.component.mjs +100 -0
  39. package/esm2022/lib/components/user-select/user-select.component.mjs +94 -0
  40. package/esm2022/lib/components/write-address/write-address.component.mjs +342 -0
  41. package/esm2022/lib/components/write-address-inputs/write-address-inputs.component.mjs +165 -0
  42. package/esm2022/lib/directives/feature-toggle/feature-toggle.directive.mjs +41 -0
  43. package/esm2022/lib/directives/let/let.directive.mjs +29 -0
  44. package/esm2022/lib/exui-common-lib.module.mjs +313 -0
  45. package/esm2022/lib/gov-ui/components/gov-uk-checkbox/gov-uk-checkbox.component.mjs +55 -0
  46. package/esm2022/lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.mjs +137 -0
  47. package/esm2022/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.mjs +127 -0
  48. package/esm2022/lib/gov-ui/components/gov-uk-error-message/gov-uk-error-message.component.mjs +46 -0
  49. package/esm2022/lib/gov-ui/components/gov-uk-fieldset/gov-uk-fieldset.component.mjs +79 -0
  50. package/esm2022/lib/gov-ui/components/gov-uk-file-upload/gov-uk-file-upload.component.mjs +79 -0
  51. package/esm2022/lib/gov-ui/components/gov-uk-form-group-wrapper/gov-uk-form-group-wrapper.component.mjs +45 -0
  52. package/esm2022/lib/gov-ui/components/gov-uk-input/gov-uk-input.component.mjs +71 -0
  53. package/esm2022/lib/gov-ui/components/gov-uk-label/gov-uk-label.component.mjs +84 -0
  54. package/esm2022/lib/gov-ui/components/gov-uk-radio/gov-uk-radio.component.mjs +48 -0
  55. package/esm2022/lib/gov-ui/components/gov-uk-radios/gov-uk-radios.component.mjs +42 -0
  56. package/esm2022/lib/gov-ui/components/gov-uk-select/gov-uk-select.component.mjs +80 -0
  57. package/esm2022/lib/gov-ui/components/gov-uk-table/gov-uk-table.component.mjs +185 -0
  58. package/esm2022/lib/gov-ui/components/gov-uk-textarea/gov-uk-textarea.component.mjs +57 -0
  59. package/esm2022/lib/gov-ui/components/hmcts-banner/hmcts-banner-info.interface.mjs +2 -0
  60. package/esm2022/lib/gov-ui/components/hmcts-banner/hmcts-banner.component.mjs +111 -0
  61. package/esm2022/lib/gov-ui/components/hmcts-error-summary/hmcts-error-summary.component.mjs +140 -0
  62. package/esm2022/lib/gov-ui/components/hmcts-identity-bar/hmcts-identity-bar.component.mjs +34 -0
  63. package/esm2022/lib/gov-ui/components/hmcts-main-wrapper/hmcts-main-wrapper.component.mjs +129 -0
  64. package/esm2022/lib/gov-ui/components/hmcts-pagination/hmcts-pagination.component.mjs +204 -0
  65. package/esm2022/lib/gov-ui/components/hmcts-primary-navigation/hmcts-primary-navigation.component.mjs +60 -0
  66. package/esm2022/lib/gov-ui/components/hmcts-sub-navigation/hmcts-sub-navigation.component.mjs +58 -0
  67. package/esm2022/lib/gov-ui/directives/remove-host.directive.mjs +30 -0
  68. package/esm2022/lib/gov-ui/gov-ui.service.mjs +14 -0
  69. package/esm2022/lib/gov-ui/models/checkboxes-model.mjs +2 -0
  70. package/{esm2015/lib/gov-ui/models/gov-ui-config-model.js → esm2022/lib/gov-ui/models/gov-ui-config-model.mjs} +1 -1
  71. package/{esm2015/lib/gov-ui/models/public_api.js → esm2022/lib/gov-ui/models/public_api.mjs} +1 -2
  72. package/esm2022/lib/gov-ui/models/radio-buttons.model.mjs +2 -0
  73. package/esm2022/lib/gov-ui/util/helpers/html-templates.helper.mjs +22 -0
  74. package/{esm2015/lib/gov-ui/validators/checkboxes-be-checked.validator.js → esm2022/lib/gov-ui/validators/checkboxes-be-checked.validator.mjs} +1 -1
  75. package/{esm2015/lib/gov-ui/validators/date.validator.js → esm2022/lib/gov-ui/validators/date.validator.mjs} +1 -1
  76. package/esm2022/lib/gov-ui/validators/radio-group.validator.mjs +15 -0
  77. package/esm2022/lib/models/address-message.enum.mjs +11 -0
  78. package/esm2022/lib/models/address-option.model.mjs +21 -0
  79. package/esm2022/lib/models/address.model.mjs +4 -0
  80. package/{esm2015/lib/models/contact-details.model.js → esm2022/lib/models/contact-details.model.mjs} +1 -1
  81. package/esm2022/lib/models/feature-user.mjs +5 -0
  82. package/esm2022/lib/models/filter.model.mjs +3 -0
  83. package/esm2022/lib/models/index.mjs +19 -0
  84. package/esm2022/lib/models/location.model.mjs +7 -0
  85. package/esm2022/lib/models/person.model.mjs +21 -0
  86. package/{esm2015/lib/models/public_api.js → esm2022/lib/models/public_api.mjs} +2 -1
  87. package/{esm2015/lib/models/search-options.model.js → esm2022/lib/models/search-options.model.mjs} +1 -1
  88. package/esm2022/lib/models/service-message.model.mjs +2 -0
  89. package/esm2022/lib/models/task-name.model.mjs +2 -0
  90. package/esm2022/lib/models/user-access-type.model.mjs +2 -0
  91. package/esm2022/lib/models/user-details.model.mjs +2 -0
  92. package/esm2022/lib/pipes/capitalize/capitalize.pipe.mjs +15 -0
  93. package/esm2022/lib/pipes/index.mjs +2 -0
  94. package/esm2022/lib/services/address/address-parser.mjs +76 -0
  95. package/esm2022/lib/services/address/address-type.enum.mjs +7 -0
  96. package/esm2022/lib/services/address/address.service.mjs +55 -0
  97. package/esm2022/lib/services/case-sharing-state/case-sharing-state.service.mjs +170 -0
  98. package/esm2022/lib/services/cookie/cookie.service.mjs +48 -0
  99. package/esm2022/lib/services/feature-toggle/feature-toggle.guard.mjs +37 -0
  100. package/esm2022/lib/services/feature-toggle/feature-toggle.service.mjs +33 -0
  101. package/esm2022/lib/services/feature-toggle/launch-darkly.service.mjs +65 -0
  102. package/esm2022/lib/services/filter/filter.service.mjs +95 -0
  103. package/esm2022/lib/services/find-person/find-person.service.mjs +92 -0
  104. package/esm2022/lib/services/google-analytics/google-analytics.service.mjs +73 -0
  105. package/esm2022/lib/services/google-tag-manager/google-tag-manager.service.mjs +85 -0
  106. package/{esm2015/lib/services/loading/loading.service.js → esm2022/lib/services/loading/loading.service.mjs} +8 -6
  107. package/esm2022/lib/services/locations/location.service.mjs +38 -0
  108. package/{esm2015/lib/services/manage-session/manage-session.services.js → esm2022/lib/services/manage-session/manage-session.services.mjs} +8 -10
  109. package/esm2022/lib/services/public-api.mjs +18 -0
  110. package/esm2022/lib/services/ref-data/index.mjs +4 -0
  111. package/esm2022/lib/services/ref-data/models/ref-data-htmcs-service.model.mjs +2 -0
  112. package/esm2022/lib/services/ref-data/models/ref-data-region.model.mjs +2 -0
  113. package/esm2022/lib/services/ref-data/ref-data-data-access/models/ref-data-locations-by-service-code-response.model.mjs +2 -0
  114. package/esm2022/lib/services/ref-data/ref-data-data-access/ref-data-data-access.service.mjs +33 -0
  115. package/esm2022/lib/services/ref-data/ref-data.service.mjs +34 -0
  116. package/esm2022/lib/services/role-guard/role.guard.mjs +43 -0
  117. package/esm2022/lib/services/role-guard/role.service.mjs +22 -0
  118. package/esm2022/lib/services/storage/session-storage/session-storage.service.mjs +43 -0
  119. package/esm2022/lib/services/task-name/task-name.service.mjs +35 -0
  120. package/esm2022/lib/services/timeout-notifications/timeout-notifications.service.mjs +103 -0
  121. package/{esm2015/public-api.js → esm2022/public-api.mjs} +2 -1
  122. package/fesm2022/hmcts-rpx-xui-common-lib.mjs +10377 -0
  123. package/fesm2022/hmcts-rpx-xui-common-lib.mjs.map +1 -0
  124. package/index.d.ts +5 -0
  125. package/lib/components/accessibility/accessibility.component.d.ts +7 -1
  126. package/lib/components/checkbox-list/checkbox-list.component.d.ts +8 -2
  127. package/lib/components/contact-details/contact-details.component.d.ts +3 -0
  128. package/lib/components/cookie-banner/cookie-banner.component.d.ts +5 -1
  129. package/lib/components/due-date/due-date.component.d.ts +8 -2
  130. package/lib/components/exui-main-wrapper/exui-page-wrapper.component.d.ts +3 -0
  131. package/lib/components/find-location/find-location.component.d.ts +12 -6
  132. package/lib/components/find-person/find-person.component.d.ts +5 -2
  133. package/lib/components/find-service/find-service.component.d.ts +24 -9
  134. package/lib/components/find-task-name/find-task-name.component.d.ts +44 -0
  135. package/lib/components/generic-filter/generic-filter-utils.d.ts +2 -5
  136. package/lib/components/generic-filter/generic-filter.component.d.ts +25 -6
  137. package/lib/components/hmcts-session-dialog/hmcts-session-dialog.component.d.ts +3 -0
  138. package/lib/components/invite-user-form/invite-user-form.component.d.ts +3 -0
  139. package/lib/components/invite-user-permissions/invite-user-permission.component.d.ts +3 -0
  140. package/lib/components/loading-spinner/loading-spinner.component.d.ts +8 -1
  141. package/lib/components/pagination/pagination.component.d.ts +3 -0
  142. package/lib/components/public_api.d.ts +6 -0
  143. package/lib/components/search-judicials/search-judicials.component.d.ts +3 -0
  144. package/lib/components/search-location/search-location.component.d.ts +25 -20
  145. package/lib/components/search-service/search-service.component.d.ts +16 -9
  146. package/lib/components/search-venue/search-venue.component.d.ts +3 -1
  147. package/lib/components/selected-case/selected-case.component.d.ts +3 -0
  148. package/lib/components/selected-case-confirm/selected-case-confirm.component.d.ts +3 -0
  149. package/lib/components/selected-case-list/selected-case-list.component.d.ts +3 -0
  150. package/lib/components/service-message/service-message.component.d.ts +9 -4
  151. package/lib/components/service-messages/service-messages.component.d.ts +15 -5
  152. package/lib/components/share-case/share-case.component.d.ts +4 -0
  153. package/lib/components/share-case-confirm/share-case-confirm.component.d.ts +3 -0
  154. package/lib/components/tab/tab.component.d.ts +3 -0
  155. package/lib/components/tc-confirm/tc-confirm.component.d.ts +3 -0
  156. package/lib/components/terms-and-conditions/tc-display/tc-display-html/tc-display-html.component.d.ts +3 -0
  157. package/lib/components/terms-and-conditions/tc-display/tc-display-plain/tc-display-plain.component.d.ts +3 -0
  158. package/lib/components/terms-and-conditions/terms-and-conditions.component.d.ts +3 -0
  159. package/lib/components/user-details/user-details.component.d.ts +4 -0
  160. package/lib/components/user-list/user-list.component.d.ts +3 -0
  161. package/lib/components/user-select/user-select.component.d.ts +5 -3
  162. package/lib/components/write-address/write-address.component.d.ts +45 -0
  163. package/lib/components/write-address-inputs/write-address-inputs.component.d.ts +16 -0
  164. package/lib/directives/feature-toggle/feature-toggle.directive.d.ts +3 -0
  165. package/lib/directives/let/let.directive.d.ts +3 -0
  166. package/lib/exui-common-lib.module.d.ts +83 -4
  167. package/lib/gov-ui/components/gov-uk-checkbox/gov-uk-checkbox.component.d.ts +3 -0
  168. package/lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.d.ts +17 -5
  169. package/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.d.ts +3 -0
  170. package/lib/gov-ui/components/gov-uk-error-message/gov-uk-error-message.component.d.ts +3 -0
  171. package/lib/gov-ui/components/gov-uk-fieldset/gov-uk-fieldset.component.d.ts +3 -0
  172. package/lib/gov-ui/components/gov-uk-file-upload/gov-uk-file-upload.component.d.ts +3 -0
  173. package/lib/gov-ui/components/gov-uk-form-group-wrapper/gov-uk-form-group-wrapper.component.d.ts +3 -0
  174. package/lib/gov-ui/components/gov-uk-input/gov-uk-input.component.d.ts +4 -2
  175. package/lib/gov-ui/components/gov-uk-label/gov-uk-label.component.d.ts +4 -0
  176. package/lib/gov-ui/components/gov-uk-radio/gov-uk-radio.component.d.ts +3 -0
  177. package/lib/gov-ui/components/gov-uk-radios/gov-uk-radios.component.d.ts +5 -2
  178. package/lib/gov-ui/components/gov-uk-select/gov-uk-select.component.d.ts +3 -0
  179. package/lib/gov-ui/components/gov-uk-table/gov-uk-table.component.d.ts +3 -0
  180. package/lib/gov-ui/components/gov-uk-textarea/gov-uk-textarea.component.d.ts +3 -0
  181. package/lib/gov-ui/components/hmcts-banner/hmcts-banner-info.interface.d.ts +7 -0
  182. package/lib/gov-ui/components/hmcts-banner/hmcts-banner.component.d.ts +7 -2
  183. package/lib/gov-ui/components/hmcts-error-summary/hmcts-error-summary.component.d.ts +3 -0
  184. package/lib/gov-ui/components/hmcts-identity-bar/hmcts-identity-bar.component.d.ts +3 -0
  185. package/lib/gov-ui/components/hmcts-main-wrapper/hmcts-main-wrapper.component.d.ts +6 -3
  186. package/lib/gov-ui/components/hmcts-pagination/hmcts-pagination.component.d.ts +3 -0
  187. package/lib/gov-ui/components/hmcts-primary-navigation/hmcts-primary-navigation.component.d.ts +3 -0
  188. package/lib/gov-ui/components/hmcts-sub-navigation/hmcts-sub-navigation.component.d.ts +3 -0
  189. package/lib/gov-ui/directives/remove-host.directive.d.ts +3 -0
  190. package/lib/gov-ui/gov-ui.service.d.ts +3 -0
  191. package/lib/gov-ui/models/checkboxes-model.d.ts +4 -7
  192. package/lib/gov-ui/models/gov-ui-config-model.d.ts +2 -0
  193. package/lib/gov-ui/models/public_api.d.ts +0 -1
  194. package/lib/gov-ui/models/radio-buttons.model.d.ts +9 -0
  195. package/lib/models/address-message.enum.d.ts +9 -0
  196. package/lib/models/address-option.model.d.ts +9 -0
  197. package/lib/models/address.model.d.ts +9 -0
  198. package/lib/models/contact-details.model.d.ts +4 -0
  199. package/lib/models/feature-user.d.ts +4 -6
  200. package/lib/models/filter.model.d.ts +42 -9
  201. package/lib/models/index.d.ts +4 -0
  202. package/lib/models/location.model.d.ts +12 -12
  203. package/lib/models/person.model.d.ts +5 -3
  204. package/lib/models/public_api.d.ts +1 -0
  205. package/lib/models/search-options.model.d.ts +1 -1
  206. package/lib/models/service-message.model.d.ts +8 -0
  207. package/lib/models/task-name.model.d.ts +4 -0
  208. package/lib/models/user-access-type.model.d.ts +6 -0
  209. package/lib/models/user-details.model.d.ts +2 -0
  210. package/lib/pipes/capitalize/capitalize.pipe.d.ts +7 -0
  211. package/lib/pipes/index.d.ts +1 -0
  212. package/lib/services/address/address-parser.d.ts +17 -0
  213. package/lib/services/address/address-type.enum.d.ts +5 -0
  214. package/lib/services/address/address.service.d.ts +15 -0
  215. package/lib/services/case-sharing-state/case-sharing-state.service.d.ts +3 -0
  216. package/lib/services/cookie/cookie.service.d.ts +3 -0
  217. package/lib/services/feature-toggle/feature-toggle.guard.d.ts +8 -2
  218. package/lib/services/feature-toggle/feature-toggle.service.d.ts +4 -0
  219. package/lib/services/feature-toggle/launch-darkly.service.d.ts +14 -10
  220. package/lib/services/filter/filter.service.d.ts +6 -0
  221. package/lib/services/find-person/find-person.service.d.ts +5 -2
  222. package/lib/services/google-analytics/google-analytics.service.d.ts +4 -1
  223. package/lib/services/google-tag-manager/google-tag-manager.service.d.ts +5 -1
  224. package/lib/services/loading/loading.service.d.ts +3 -0
  225. package/lib/services/locations/location.service.d.ts +4 -1
  226. package/lib/services/manage-session/manage-session.services.d.ts +3 -0
  227. package/lib/services/public-api.d.ts +2 -0
  228. package/lib/services/ref-data/index.d.ts +3 -0
  229. package/lib/services/ref-data/models/ref-data-htmcs-service.model.d.ts +13 -0
  230. package/lib/services/ref-data/models/ref-data-region.model.d.ts +4 -0
  231. package/lib/services/ref-data/ref-data-data-access/models/ref-data-locations-by-service-code-response.model.d.ts +8 -0
  232. package/lib/services/ref-data/ref-data-data-access/ref-data-data-access.service.d.ts +18 -0
  233. package/lib/services/ref-data/ref-data.service.d.ts +17 -0
  234. package/lib/services/role-guard/role.guard.d.ts +7 -3
  235. package/lib/services/role-guard/role.service.d.ts +8 -4
  236. package/lib/services/{session-storage → storage/session-storage}/session-storage.service.d.ts +3 -0
  237. package/lib/services/task-name/task-name.service.d.ts +17 -0
  238. package/lib/services/timeout-notifications/timeout-notifications.service.d.ts +8 -2
  239. package/package.json +21 -11
  240. package/public-api.d.ts +1 -0
  241. package/bundles/hmcts-rpx-xui-common-lib.umd.js +0 -5139
  242. package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +0 -1
  243. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +0 -2
  244. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +0 -1
  245. package/esm2015/hmcts-rpx-xui-common-lib.js +0 -70
  246. package/esm2015/lib/components/accessibility/accessibility.component.js +0 -14
  247. package/esm2015/lib/components/checkbox-list/checkbox-list.component.js +0 -177
  248. package/esm2015/lib/components/contact-details/contact-details.component.js +0 -17
  249. package/esm2015/lib/components/cookie-banner/cookie-banner.component.js +0 -68
  250. package/esm2015/lib/components/due-date/due-date.component.js +0 -115
  251. package/esm2015/lib/components/exui-main-wrapper/exui-page-wrapper.component.js +0 -28
  252. package/esm2015/lib/components/find-location/find-location.component.js +0 -124
  253. package/esm2015/lib/components/find-person/find-person.component.js +0 -118
  254. package/esm2015/lib/components/find-service/find-service.component.js +0 -31
  255. package/esm2015/lib/components/generic-filter/generic-filter-utils.js +0 -21
  256. package/esm2015/lib/components/generic-filter/generic-filter.component.js +0 -387
  257. package/esm2015/lib/components/hmcts-session-dialog/hmcts-session-dialog.component.js +0 -27
  258. package/esm2015/lib/components/invite-user-form/invite-user-form.component.js +0 -25
  259. package/esm2015/lib/components/invite-user-permissions/invite-user-permission.component.js +0 -25
  260. package/esm2015/lib/components/loading-spinner/loading-spinner.component.js +0 -18
  261. package/esm2015/lib/components/pagination/pagination.component.js +0 -28
  262. package/esm2015/lib/components/public_api.js +0 -33
  263. package/esm2015/lib/components/search-judicials/search-judicials.component.js +0 -126
  264. package/esm2015/lib/components/search-location/search-location.component.js +0 -133
  265. package/esm2015/lib/components/search-service/search-service.component.js +0 -31
  266. package/esm2015/lib/components/search-venue/search-venue.component.js +0 -123
  267. package/esm2015/lib/components/selected-case/selected-case.component.js +0 -158
  268. package/esm2015/lib/components/selected-case-confirm/selected-case-confirm.component.js +0 -36
  269. package/esm2015/lib/components/selected-case-list/selected-case-list.component.js +0 -49
  270. package/esm2015/lib/components/service-message/service-message.component.js +0 -22
  271. package/esm2015/lib/components/service-messages/service-messages.component.js +0 -48
  272. package/esm2015/lib/components/share-case/share-case.component.js +0 -205
  273. package/esm2015/lib/components/share-case-confirm/share-case-confirm.component.js +0 -34
  274. package/esm2015/lib/components/tab/tab.component.js +0 -21
  275. package/esm2015/lib/components/tc-confirm/tc-confirm.component.js +0 -22
  276. package/esm2015/lib/components/terms-and-conditions/tc-display/tc-display-html/tc-display-html.component.js +0 -13
  277. package/esm2015/lib/components/terms-and-conditions/tc-display/tc-display-plain/tc-display-plain.component.js +0 -13
  278. package/esm2015/lib/components/terms-and-conditions/terms-and-conditions.component.js +0 -16
  279. package/esm2015/lib/components/user-details/user-details.component.js +0 -41
  280. package/esm2015/lib/components/user-list/user-list.component.js +0 -33
  281. package/esm2015/lib/components/user-select/user-select.component.js +0 -58
  282. package/esm2015/lib/directives/feature-toggle/feature-toggle.directive.js +0 -42
  283. package/esm2015/lib/directives/let/let.directive.js +0 -30
  284. package/esm2015/lib/exui-common-lib.module.js +0 -160
  285. package/esm2015/lib/gov-ui/components/gov-uk-checkbox/gov-uk-checkbox.component.js +0 -31
  286. package/esm2015/lib/gov-ui/components/gov-uk-checkboxes/gov-uk-checkboxes.component.js +0 -21
  287. package/esm2015/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.js +0 -64
  288. package/esm2015/lib/gov-ui/components/gov-uk-error-message/gov-uk-error-message.component.js +0 -22
  289. package/esm2015/lib/gov-ui/components/gov-uk-fieldset/gov-uk-fieldset.component.js +0 -28
  290. package/esm2015/lib/gov-ui/components/gov-uk-file-upload/gov-uk-file-upload.component.js +0 -35
  291. package/esm2015/lib/gov-ui/components/gov-uk-form-group-wrapper/gov-uk-form-group-wrapper.component.js +0 -23
  292. package/esm2015/lib/gov-ui/components/gov-uk-input/gov-uk-input.component.js +0 -34
  293. package/esm2015/lib/gov-ui/components/gov-uk-label/gov-uk-label.component.js +0 -21
  294. package/esm2015/lib/gov-ui/components/gov-uk-radio/gov-uk-radio.component.js +0 -33
  295. package/esm2015/lib/gov-ui/components/gov-uk-radios/gov-uk-radios.component.js +0 -21
  296. package/esm2015/lib/gov-ui/components/gov-uk-select/gov-uk-select.component.js +0 -27
  297. package/esm2015/lib/gov-ui/components/gov-uk-table/gov-uk-table.component.js +0 -39
  298. package/esm2015/lib/gov-ui/components/gov-uk-textarea/gov-uk-textarea.component.js +0 -27
  299. package/esm2015/lib/gov-ui/components/hmcts-banner/hmcts-banner.component.js +0 -23
  300. package/esm2015/lib/gov-ui/components/hmcts-error-summary/hmcts-error-summary.component.js +0 -48
  301. package/esm2015/lib/gov-ui/components/hmcts-identity-bar/hmcts-identity-bar.component.js +0 -19
  302. package/esm2015/lib/gov-ui/components/hmcts-main-wrapper/hmcts-main-wrapper.component.js +0 -41
  303. package/esm2015/lib/gov-ui/components/hmcts-pagination/hmcts-pagination.component.js +0 -28
  304. package/esm2015/lib/gov-ui/components/hmcts-primary-navigation/hmcts-primary-navigation.component.js +0 -23
  305. package/esm2015/lib/gov-ui/components/hmcts-sub-navigation/hmcts-sub-navigation.component.js +0 -15
  306. package/esm2015/lib/gov-ui/directives/remove-host.directive.js +0 -29
  307. package/esm2015/lib/gov-ui/gov-ui.service.js +0 -13
  308. package/esm2015/lib/gov-ui/models/banner-data-model.js +0 -2
  309. package/esm2015/lib/gov-ui/models/checkboxes-model.js +0 -2
  310. package/esm2015/lib/gov-ui/models/isession-storage.interface.js +0 -2
  311. package/esm2015/lib/gov-ui/util/helpers/html-templates.helper.js +0 -22
  312. package/esm2015/lib/gov-ui/util/session-storage/session-storage-utils.js +0 -22
  313. package/esm2015/lib/gov-ui/validators/radio-group.validator.js +0 -15
  314. package/esm2015/lib/models/feature-user.js +0 -5
  315. package/esm2015/lib/models/filter.model.js +0 -3
  316. package/esm2015/lib/models/index.js +0 -15
  317. package/esm2015/lib/models/location.model.js +0 -7
  318. package/esm2015/lib/models/person.model.js +0 -19
  319. package/esm2015/lib/models/user-details.model.js +0 -2
  320. package/esm2015/lib/services/case-sharing-state/case-sharing-state.service.js +0 -157
  321. package/esm2015/lib/services/cookie/cookie.service.js +0 -47
  322. package/esm2015/lib/services/feature-toggle/feature-toggle.guard.js +0 -35
  323. package/esm2015/lib/services/feature-toggle/feature-toggle.service.js +0 -27
  324. package/esm2015/lib/services/feature-toggle/launch-darkly.service.js +0 -59
  325. package/esm2015/lib/services/filter/filter.service.js +0 -64
  326. package/esm2015/lib/services/find-person/find-person.service.js +0 -106
  327. package/esm2015/lib/services/google-analytics/google-analytics.service.js +0 -68
  328. package/esm2015/lib/services/google-tag-manager/google-tag-manager.service.js +0 -71
  329. package/esm2015/lib/services/locations/location.service.js +0 -39
  330. package/esm2015/lib/services/public-api.js +0 -16
  331. package/esm2015/lib/services/role-guard/role.guard.js +0 -37
  332. package/esm2015/lib/services/role-guard/role.service.js +0 -20
  333. package/esm2015/lib/services/session-storage/session-storage.service.js +0 -41
  334. package/esm2015/lib/services/timeout-notifications/timeout-notifications.service.js +0 -92
  335. package/fesm2015/hmcts-rpx-xui-common-lib.js +0 -4172
  336. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +0 -1
  337. package/hmcts-rpx-xui-common-lib.d.ts +0 -69
  338. package/hmcts-rpx-xui-common-lib.metadata.json +0 -1
  339. package/lib/gov-ui/models/banner-data-model.d.ts +0 -4
  340. package/lib/gov-ui/models/isession-storage.interface.d.ts +0 -4
  341. package/lib/gov-ui/util/session-storage/session-storage-utils.d.ts +0 -6
  342. /package/{esm2015/lib/components/index.js → esm2022/lib/components/index.mjs} +0 -0
  343. /package/{esm2015/lib/directives/index.js → esm2022/lib/directives/index.mjs} +0 -0
  344. /package/{esm2015/lib/directives/public-api.js → esm2022/lib/directives/public-api.mjs} +0 -0
  345. /package/{esm2015/lib/gov-ui/components/index.js → esm2022/lib/gov-ui/components/index.mjs} +0 -0
  346. /package/{esm2015/lib/gov-ui/components/public_api.js → esm2022/lib/gov-ui/components/public_api.mjs} +0 -0
  347. /package/{esm2015/lib/gov-ui/index.js → esm2022/lib/gov-ui/index.mjs} +0 -0
  348. /package/{esm2015/lib/gov-ui/models/error-messages-model.js → esm2022/lib/gov-ui/models/error-messages-model.mjs} +0 -0
  349. /package/{esm2015/lib/gov-ui/models/index.js → esm2022/lib/gov-ui/models/index.mjs} +0 -0
  350. /package/{esm2015/lib/gov-ui/public_api.js → esm2022/lib/gov-ui/public_api.mjs} +0 -0
  351. /package/{esm2015/lib/gov-ui/validators/index.js → esm2022/lib/gov-ui/validators/index.mjs} +0 -0
  352. /package/{esm2015/lib/gov-ui/validators/public_api.js → esm2022/lib/gov-ui/validators/public_api.mjs} +0 -0
  353. /package/{esm2015/lib/models/case-share.model.js → esm2022/lib/models/case-share.model.mjs} +0 -0
  354. /package/{esm2015/lib/models/due-date.model.js → esm2022/lib/models/due-date.model.mjs} +0 -0
  355. /package/{esm2015/lib/models/idle-config.model.js → esm2022/lib/models/idle-config.model.mjs} +0 -0
  356. /package/{esm2015/lib/models/pagination.model.js → esm2022/lib/models/pagination.model.mjs} +0 -0
  357. /package/{esm2015/lib/models/tcDocument.model.js → esm2022/lib/models/tcDocument.model.mjs} +0 -0
  358. /package/{esm2015/lib/models/timeout-notification.model.js → esm2022/lib/models/timeout-notification.model.mjs} +0 -0
  359. /package/{esm2015/lib/models/user.model.js → esm2022/lib/models/user.model.mjs} +0 -0
  360. /package/{esm2015/lib/services/index.js → esm2022/lib/services/index.mjs} +0 -0
  361. /package/{esm2015/lib/window.js → esm2022/lib/window.mjs} +0 -0
@@ -1,4172 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, EventEmitter, ViewEncapsulation, Input, Output, Injectable, ChangeDetectionStrategy, ViewChild, Inject, InjectionToken, ChangeDetectorRef, ElementRef, Directive, ViewContainerRef, TemplateRef, NgModule } from '@angular/core';
3
- import * as i4 from '@angular/common';
4
- import { formatDate, DOCUMENT, CommonModule } from '@angular/common';
5
- import { Validators, FormArray, FormGroup, FormControl, FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
6
- import { BehaviorSubject, Subject, of, zip, combineLatest } from 'rxjs';
7
- import { distinctUntilChanged, map, tap, filter, debounceTime, mergeMap, switchMap, catchError, delay } from 'rxjs/operators';
8
- import * as i1$1 from '@angular/router';
9
- import { Router, RouterModule, NavigationEnd } from '@angular/router';
10
- import * as i1 from '@angular/common/http';
11
- import { HttpClient } from '@angular/common/http';
12
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
13
- import { MatInputModule } from '@angular/material/input';
14
- import { MatTabsModule } from '@angular/material/tabs';
15
- import { NgxPaginationModule, PaginatePipe } from 'ngx-pagination';
16
- import * as LDClient from 'launchdarkly-js-client-sdk';
17
- import * as i2 from '@angular/platform-browser';
18
- import { Title } from '@angular/platform-browser';
19
- import * as i1$2 from '@ng-idle/core';
20
- import { DocumentInterruptSource, Idle } from '@ng-idle/core';
21
- import * as i2$1 from '@ng-idle/keepalive';
22
- import { Keepalive } from '@ng-idle/keepalive';
23
-
24
- class AccessibilityComponent {
25
- constructor() {
26
- }
27
- }
28
- AccessibilityComponent.decorators = [
29
- { type: Component, args: [{
30
- selector: 'xuilib-accessibility',
31
- template: "<h1 class=\"govuk-heading-xl\" id=\"Accessibility-statement-for-Expert-UI\">Accessibility statement for Expert UI</h1>\n\n<ul class=\"govuk-list\">\n <li><a href=\"accessibility#immigration\">Immigration and Asylum</a></li>\n <li><a href=\"accessibility#family\">Family Public Law </a></li>\n</ul>\n\n<p class=\"govuk-body\">This website is run by HM Courts & Tribunals Service. We want as many people as possible to be\n able to use this website. For example, you should be able to:</p>\n\n<ul class=\"govuk-list govuk-list--bullet\">\n <li>change colours, contrast levels and fonts</li>\n <li>zoom in up to 300% without the text spilling off the screen</li>\n <li>navigate most of the website using just a keyboard</li>\n <li>navigate most of the website using speech recognition software</li>\n <li>listen to most of the website using a screen reader (including the most recent versions of JAWS, NVDA and\n VoiceOver)\n </li>\n</ul>\n\n<p class=\"govuk-body\">We\u2019ve also made the website text as simple as possible to understand.</p>\n\n<p class=\"govuk-body\"><a rel=\"noopener noreferrer\" target=\"_blank\" href=\"https://mcmw.abilitynet.org.uk/\">AbilityNet</a>\n has advice on making your device easier to use if you have a disability.</p>\n\n<h2 class=\"govuk-heading-l\" id=\"How-accessible-this-website-is\">How accessible this website is</h2>\n\n<p class=\"govuk-body\">We know some parts of the website are not fully accessible:</p>\n\n<ul class=\"govuk-list govuk-list--bullet\">\n <li>some pages are difficult to navigate using just a keyboard</li>\n <li>some pages can\u2019t be listened to in full using a screen reader</li>\n <li>some pages have problems with colour contrasts between text and background</li>\n <li>some PDFs may not be fully accessible to a screen reader</li>\n</ul>\n\n<h2 class=\"govuk-heading-l\" id=\"What-to-do-if-you-cannot-access-parts-of-this-website\">Feedback and contact\n information</h2>\n\n<p class=\"govuk-body\">If you need information on this website in a different format like accessible PDF, large print,\n easy read, audio recording or braille, you can:</p>\n\n<ul class=\"govuk-list govuk-list--bullet\">\n <li>email: <a href=\"mailto:HMCTSforms@justice.gov.uk\"> HMCTSforms@justice.gov.uk</a></li>\n <li>call: +44 (0) 300 123 1711</li>\n <li>contact your service representative</li>\n</ul>\n\n<p class=\"govuk-body\">We\u2019ll consider your request and get back to you in 10 working days.</p>\n\n<h2 class=\"govuk-heading-l\" id=\"Reporting-accessibility-problems-with-this-website\">Reporting accessibility problems\n with this website</h2>\n\n<p class=\"govuk-body\">We\u2019re always looking to improve the accessibility of this website. If you find any problems not\n listed on this page or think we\u2019re not meeting accessibility requirements, contact:</p>\n\n<ul class=\"govuk-list govuk-list--bullet\">\n <li>email: <a href=\"mailto:customer.service@justice.gov.uk\"> customer.service@justice.gov.uk</a></li>\n <li>telephone: +44 (0) 300 123 1711</li>\n</ul>\n\n<h2 class=\"govuk-heading-l\" id=\"Enforcement-procedure \">Enforcement procedure</h2>\n\n<p class=\"govuk-body\">The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector\n Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the \u2018accessibility\n regulations\u2019). </p>\n\n<p class=\"govuk-body\">If you\u2019re not happy with how we respond to your complaint, <a rel=\"noopener noreferrer\"\n target=\"_blank\"\n href=\"https://www.equalityadvisoryservice.com/\">contact\n the Equality Advisory and Support Service (EASS).</a></p>\n\n<h1 class=\"govuk-heading-l\" id=\"Contacting-us-by-phone-or-visiting-us-in-person\">Contacting us by phone or visiting us\n in person</h1>\n\n<p class=\"govuk-body\">We provide a text relay service for people who are D/deaf, hearing impaired or have a speech\n impediment.</p>\n\n<p class=\"govuk-body\">Our offices and tribunal venues have audio induction loops, or if you contact us before your visit\n we can arrange a British Sign Language (BSL) interpreter. You can also request step-free access or a foreign language\n interpreter.</p>\n\n<p class=\"govuk-body\">If you have a question about accessibility in our Tribunal venues, you can contact the First-tier\n Tribunal enquiry line: +44 (0) 300 123 1711. You can <a target=\"_blank\"\n href=\"https://courttribunalfinder.service.gov.uk/search/\">find\n the contact details for court and tribunal venues</a>. </p>\n\n<p class=\"govuk-body\">You can also contact your service representative for more information.</p>\n\n<h1 class=\"govuk-heading-l\" id=\"Technical-information-about-this-website\u2019s-accessibility\">Technical information about\n this website\u2019s accessibility</h1>\n\n<p class=\"govuk-body\">HMCTS is committed to making its website accessible, in accordance with the Public Sector Bodies\n (Websites and Mobile Applications) (No.2) Accessibility Regulations 2018.</p>\n\n<p class=\"govuk-body\">This website is partially compliant with the <a rel=\"noopener noreferrer\" target=\"_blank\"\n href=\"https://www.w3.org/TR/WCAG21/\">Web Content\n Accessibility Guidelines version 2.1</a>, due to the non-compliances listed below.</p>\n\n<h1 class=\"govuk-heading-l\" id=\"Non-accessible-content\">Non-accessible content </h1>\n\n<p class=\"govuk-body\">The content listed below is non-compliant for the following reasons.</p>\n\n<h2 class=\"govuk-heading-l\" id=\"Non-compliance-with-the-accessibility-regulations\">Non-compliance with the accessibility\n regulations</h2>\n\n<p class=\"govuk-body\">Some pages cannot be navigated completely using just a keyboard, so some people won\u2019t be able to\n tab through the pages. This fails WCAG 2.1 success criterion 2.1 (keyboard accessible).</p>\n\n<p class=\"govuk-body\">Some pages can\u2019t be listened to in full using a screen reader, so some people won\u2019t be able to\n access the information. This fails WCAG 2.1 success criterion 1.2.5 (audio description \u2013 prerecorded).</p>\n\n<p class=\"govuk-body\">Some of the contrast ratios don\u2019t meet the current accessibility requirements. This fails WCAG 2.1\n success criterion 1.4.3 (contrast \u2013 minimum).</p>\n\n<h3 class=\"govuk-heading-m\" id=\"immigration\">Immigration and Asylum</h3>\n\n<p class=\"govuk-body\">Some of the images on the service include text and are not accessible for some low vision users.\n We have identified a solution for this issue that we will implement as soon as possible.</p>\n\n<h3 class=\"govuk-heading-m\" id=\"family\">Family Public Law </h3>\n\n<ol class=\"govuk-list govuk-list--alpha\">\n <li>The navigation system used in family public law cannot be rendered well by screen readers, so features can\u2019t be\n listened to in full\n </li>\n <li>Some essential functions within the family public law digital service cannot be accessed properly using screen\n readers\n </li>\n <li>Some complex forms within the service will not be rendered correctly or cannot be listened to by screen readers\n </li>\n</ol>\n\n<h2 class=\"govuk-heading-m\" id=\"Disproportionate burden \">Disproportionate burden </h2>\n\n<p class=\"govuk-body\">For Manage organisation, Register organisation, Approve organisations and Manage cases, we found\n the following issues that are currently being triaged to find out if there is a disproportionate burden:</p>\n\n<ol class=\"govuk-list govuk-list--alpha\">\n <li>Screen readers can\u2019t switch between headers, read content in tabs and buttons</li>\n <li>Screen readers can\u2019t tab between radio buttons, read links or content</li>\n <li>Colour contrast ratios uneven between page background and content</li>\n <li>Some labels, fields, error messages and other content can\u2019t be clearly identified by screen readers and voice\n activation software\n </li>\n <li>Some page headings and titles don\u2019t follow a logical structure for screen readers</li>\n <li>The navigation of some pages isn\u2019t clear</li>\n <li>Some headings, links and button labels aren\u2019t clearly descriptive</li>\n</ol>\n\n<h2 class=\"govuk-heading-m\" id=\"Content-that\u2019s-not-within-the-scope-of-the-accessibility-regulations\">Content that\u2019s not\n within the scope of the accessibility regulations </h2>\n\n<p class=\"govuk-body\">PDFs, documents and attachments to email notifications published before 23 September 2018 may not\n meet accessibility standards. For example, they may not be structured so they\u2019re accessible to a screen reader.</p>\n\n<p class=\"govuk-body\">Any new PDFs or Word documents we publish will meet accessibility standards.</p>\n\n<h1 class=\"govuk-heading-l\" id=\"what-to-improve-accessibility\">What we\u2019re doing to improve accessibility</h1>\n\n<p class=\"govuk-body\">We\u2019re committed to ensuring our services are accessible to all our users and that they comply with\n level AA of the Web Content Accessibility Guidelines \u2013 WCAG 2.1.</p>\n\n<p class=\"govuk-body\">We\u2019re actively working to improve the identified issues and make them AA-compliant by 23 September\n 2020. We\u2019re also continuing to improve all other AAA-level accessibility issues as we iterate the service.</p>\n\n<h1 class=\"govuk-heading-l\" id=\"preparation-of-this-accessibility-statement\">Preparation of this accessibility\n statement</h1>\n\n<p class=\"govuk-body\">This statement was prepared on 16 September 2019. It was last reviewed on 16 September 2020.</p>\n\n<p class=\"govuk-body\">This website was last tested on 19 May 2020. The test was carried out by the <a target=\"_blank\"\n href=\"https://digitalaccessibilitycentre.org/\">Digital\n Accessibility Centre (DAC)</a>.</p>\n\n<h3 class=\"govuk-heading-m\">Family Private Law:</h3>\n\n<p class=\"govuk-body\">This service has not yet been tested for accessibility issues. In the future, we will conduct an\n accessibility audit in order to find out if there are any accessibility issues. The accessibility statement will be\n updated with any relevant changes that we find.</p>\n\n<p class=\"govuk-body\">If there are any issues with accessing information or using this website please contact:</p>\n\n<ol class=\"govuk-list govuk-list--bullet\">\n <li>Nicola Whitcher - 02380 384324</li>\n <li>Hannah Townley - 02380 384313</li>\n</ol>",
32
- styles: [".govuk-list--alpha{padding-left:20px;list-style-type:lower-alpha}"]
33
- },] }
34
- ];
35
- AccessibilityComponent.ctorParameters = () => [];
36
-
37
- class CheckboxListComponent {
38
- constructor() {
39
- /**
40
- * The options to show checkboxes for. Note that the type
41
- * within the array corresponds to the one for the component.
42
- */
43
- this.options = [];
44
- /**
45
- * Whenever the selection changes, this event fires. What is dispatched
46
- * is the current selection, also retrievable from .selection.
47
- */
48
- this.selectionChange = new EventEmitter();
49
- }
50
- /**
51
- * The currently selected values.
52
- * Note: This array is immutable, which means pushing and popping will
53
- * have no effect on which checkboxes are selected.
54
- */
55
- get selection() {
56
- return this.pSelection ? [...this.pSelection] : [];
57
- }
58
- set selection(value) {
59
- this.pSelection = this.getSelection(value);
60
- }
61
- /**
62
- * Indicates whether or not all of the items are selected.
63
- */
64
- get allSelected() {
65
- return this.selection.length === this.options.length;
66
- }
67
- // Catch any changes to any of the Input() properties.
68
- ngOnChanges() {
69
- // Set up the pre-selected values.
70
- this.setupPreselection();
71
- // Now check the current selection to make sure it's valid.
72
- this.checkSelection();
73
- }
74
- /**
75
- * Indicates whether or not there are any options to render.
76
- */
77
- get hasOptions() {
78
- return this.options && this.options.length > 0;
79
- }
80
- get isFunctional() {
81
- return this.labelFunction && this.hasOptions;
82
- }
83
- /**
84
- * Indicates whether or not an item is part of the current selection.
85
- * @param item The item in question.
86
- */
87
- isSelected(item) {
88
- return this.selection.includes(item);
89
- }
90
- /**
91
- * If an item is already selected, it will be removed from the selection.
92
- * Otherwise, it will be added to the selection..
93
- */
94
- toggleItemSelection(item) {
95
- if (this.pSelection === undefined) {
96
- // If we don't have any selection at all yet, make it just this item.
97
- this.pSelection = [item];
98
- }
99
- else if (this.isSelected(item)) {
100
- // If this item is already selected, remove it.
101
- this.pSelection.splice(this.pSelection.indexOf(item), 1);
102
- }
103
- else {
104
- // If it's not selected, add it.
105
- this.pSelection.push(item);
106
- }
107
- // Indicate that the user has now made an active selection.
108
- this.pSelectionMade = true;
109
- // Now emit an event so any containers know about the change to selection.
110
- this.selectionChange.emit(this.selection);
111
- }
112
- /**
113
- * If all of the items are selected, deselect them all.
114
- * Otherwise, select them all.
115
- */
116
- toggleSelectAll() {
117
- // Do we already have them all selected?
118
- if (this.allSelected) {
119
- // If so, clear out the selection.
120
- this.pSelection = [];
121
- }
122
- else {
123
- // If not, select all of them.
124
- this.pSelection = [...this.options];
125
- }
126
- // Indicate that the user has now made an active selection.
127
- this.pSelectionMade = true;
128
- // Now emit an event so any containers know about the change to selection.
129
- this.selectionChange.emit(this.pSelection);
130
- }
131
- /**
132
- * Use the labelFunction to determine whether the options include the item.
133
- * This is to handle partial objects being set in the pre-selection where
134
- * they may not be available by the same mechanism as the options.
135
- *
136
- * @param items The array of items in which to look for the item.
137
- * @param item The item to check in the options.
138
- */
139
- containsItem(items, item) {
140
- if (this.isFunctional) {
141
- const itemLabel = this.labelFunction(item);
142
- return items.some(opt => {
143
- return this.labelFunction(opt) === itemLabel;
144
- });
145
- }
146
- return false;
147
- }
148
- // Simple utility function to indicate whether there is an active preselection.
149
- get hasPreselection() {
150
- return this.preselection && this.preselection.length > 0;
151
- }
152
- // Set up the initially selected values.
153
- // NOTE: If the preselection changes and the user has NOT made an active selection,
154
- // the current selection will also be changed. As soon as the user has made an
155
- // active selection, however, the preselection is no longer relevant.
156
- setupPreselection() {
157
- if (this.isFunctional && !this.pSelectionMade && this.hasPreselection) {
158
- let changed = true; // Assume this is a change.
159
- if (this.pSelection) {
160
- // If there is no difference between the arrays, this is not a change.
161
- changed = this.pSelection.filter((item) => {
162
- return !this.containsItem(this.preselection, item);
163
- }).length > 0;
164
- }
165
- // If this is a change, update the selection and then emit an
166
- // event so any containers know about the change to selection.
167
- if (changed) {
168
- this.pSelection = this.getSelection(this.preselection);
169
- this.selectionChange.emit(this.selection);
170
- }
171
- }
172
- }
173
- getSelection(items) {
174
- return [
175
- ...this.options.filter(opt => {
176
- return this.containsItem(items, opt);
177
- })
178
- ];
179
- }
180
- // The options have changed. Let's make sure the selection
181
- // doesn't contain anything that's not currently an option.
182
- checkSelection() {
183
- if (this.isFunctional) {
184
- // Check which of the currently selected items are actually options.
185
- const allowedSelection = this.selection.filter((item) => {
186
- return this.containsItem(this.options, item);
187
- });
188
- // If any have dropped out, change the selection.
189
- if (allowedSelection.length !== this.selection.length) {
190
- this.pSelection = [...allowedSelection];
191
- // And emit an event so any containers know about the change to selection.
192
- this.selectionChange.emit(this.selection);
193
- }
194
- }
195
- }
196
- }
197
- CheckboxListComponent.decorators = [
198
- { type: Component, args: [{
199
- selector: 'xuilib-checkbox-list',
200
- template: "<div class=\"xui-checkbox-list govuk-checkboxes govuk-checkboxes--small\" *ngIf=\"isFunctional\">\n <div class=\"select-all govuk-checkboxes__item\">\n <input type=\"checkbox\" id=\"select_all\" class=\"govuk-checkboxes__input\" [checked]=\"allSelected\"\n (change)=\"toggleSelectAll()\" />\n <label for=\"select_all\" class=\"govuk-label govuk-checkboxes__label\">Select all / Deselect all</label>\n </div>\n <div class=\"checkbox-items\">\n <div *ngFor=\"let item of options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" [id]=\"'select_' + i\" class=\"govuk-checkboxes__input\" [checked]=\"isSelected(item)\"\n (change)=\"toggleItemSelection(item)\" />\n <label [for]=\"'select_' + i\" class=\"govuk-label govuk-checkboxes__label\">{{labelFunction(item)}}</label>\n </div>\n </div>\n</div>\n",
201
- encapsulation: ViewEncapsulation.None,
202
- styles: [".xui-checkbox-list .select-all{margin-bottom:10px}.xui-checkbox-list .checkbox-items{display:flex;flex-direction:column;flex-wrap:wrap;height:100%;max-height:100%;align-items:flex-start;align-content:flex-start;width:100%;max-width:100%;overflow-x:scroll}"]
203
- },] }
204
- ];
205
- CheckboxListComponent.propDecorators = {
206
- options: [{ type: Input }],
207
- preselection: [{ type: Input }],
208
- labelFunction: [{ type: Input }],
209
- selectionChange: [{ type: Output }],
210
- selection: [{ type: Input }]
211
- };
212
-
213
- class ContactDetailsComponent {
214
- constructor() {
215
- }
216
- }
217
- ContactDetailsComponent.decorators = [
218
- { type: Component, args: [{
219
- selector: 'xuilib-contact-details',
220
- template: "<div class=\"contact-details\" *ngIf=\"data\">\n <h3 class=\"govuk-heading-m\" *ngIf=\"data.title\">{{ data.title }}</h3>\n <p *ngIf=\"data.badgeText\"><span [className]=\"'hmcts-badge ' + data.badgeColour\">{{ data.badgeText }}</span></p>\n <div class=\"email\" *ngIf=\"data.email\"><span class=\"govuk-!-font-weight-bold\">Email: </span> <a href=\"mailto:{{ data.email }}\">{{ data.email }}</a></div>\n <div class=\"phone\" *ngIf=\"data.phone\"><span class=\"govuk-!-font-weight-bold\">Phone: </span>{{ data.phone }}</div>\n <div class=\"opening-times\" *ngIf=\"data.openingTimes\"><span class=\"govuk-!-font-weight-bold\">Opening times: </span>{{ data.openingTimes}}</div>\n</div>\n\n",
221
- styles: [".contact-details{margin-top:30px}.contact-details h3,.contact-details p{margin-bottom:10px}"]
222
- },] }
223
- ];
224
- ContactDetailsComponent.ctorParameters = () => [];
225
- ContactDetailsComponent.propDecorators = {
226
- data: [{ type: Input }]
227
- };
228
-
229
- var DateBadgeColour;
230
- (function (DateBadgeColour) {
231
- DateBadgeColour["RED"] = "hmcts-badge--red";
232
- DateBadgeColour["ORANGE"] = "hmcts-badge--orange";
233
- DateBadgeColour["GREEN"] = "hmcts-badge--green";
234
- })(DateBadgeColour || (DateBadgeColour = {}));
235
- const SECONDS_IN_A_DAY = 60 * 60 * 24;
236
-
237
- class DueDateComponent {
238
- constructor() {
239
- /**
240
- * This should be considered HIGH urgency if there are fewer than this
241
- * many days until the due date.
242
- * * Set to 0 if you want it to show HIGH if it was due yesterday.
243
- * * Set to 1 if you want it to show HIGH if it's due today.
244
- * * Set to 2 if you want it to show HIGH if it's due tomorrow.
245
- *
246
- * Defaults to 0 (ZERO), which means it won't show as HIGH urgency until the
247
- * due date is in the past.
248
- *
249
- * NOTE: If this is higher than the mediumUrgencyCutoff value, MEDIUM urgency
250
- * will never be shown.
251
- *
252
- * ALSO NOTE: Anything overdue is automatically considered HIGH urgency.
253
- */
254
- this.highUrgencyCutoff = 0; // Default
255
- /**
256
- * This should be considered MEDIUM urgency if there are fewer than this
257
- * many days until the due date.
258
- * * Set to 1 if you want it to show MEDIUM if it's due today.
259
- * * Set to 2 if you want it to show MEDIUM if it's due tomorrow.
260
- * * Set to 3 if you want it to show MEDIUM if it's due the day after tomorrow.
261
- *
262
- * Defaults to 2, which means it won't show as MEDIUM urgency unless the
263
- * due date is today or tomorrow.
264
- *
265
- * NOTE: If this is lower than the highUrgencyCutoff value, MEDIUM urgency
266
- * will never be shown.
267
- */
268
- this.mediumUrgencyCutoff = 2;
269
- }
270
- get badge() {
271
- return this.pBadge;
272
- }
273
- get label() {
274
- return this.pLabel;
275
- }
276
- get accessibleLabel() {
277
- return this.pAccessibleLabel;
278
- }
279
- get daysDiff() {
280
- return this.pDaysDiff;
281
- }
282
- // Catch any changes to any of the Input() properties.
283
- ngOnChanges() {
284
- this.handleInputChanges();
285
- }
286
- // Set up the label, urgency class, and accessibility fields.
287
- handleInputChanges() {
288
- // If we don't have a dueDate, skip out of here.
289
- if (!this.dueDate) {
290
- return;
291
- }
292
- // How many days from today is the due date?
293
- // Already happened means daysDiff > 0;
294
- // Today means daysDiff = 0;
295
- // Yet to come means daysDiff < 0;
296
- this.pDaysDiff = this.getDaysDifference(this.dueDate, new Date());
297
- // Is it overdue?
298
- if (this.daysDiff > 0) {
299
- this.pBadge = DateBadgeColour.RED;
300
- const daysLabel = this.daysDiff === 1 ? 'day' : 'days';
301
- this.pLabel = `+${this.daysDiff} ${daysLabel}`;
302
- this.pAccessibleLabel = `This task is ${this.daysDiff} ${daysLabel} past its due date`;
303
- }
304
- else {
305
- // Special label for "Today".
306
- if (this.daysDiff === 0) {
307
- this.pLabel = 'TODAY';
308
- this.pAccessibleLabel = 'This task is due to be completed today';
309
- }
310
- else {
311
- this.pLabel = `${formatDate(this.dueDate, 'd MMM', 'en-GB')}`;
312
- this.pAccessibleLabel = `This task is due to be completed by ${formatDate(this.dueDate, 'd MMMM y', 'en-GB')}`;
313
- }
314
- if (this.daysDiff + this.highUrgencyCutoff > 0) {
315
- this.pBadge = DateBadgeColour.RED;
316
- }
317
- else if (this.daysDiff + this.mediumUrgencyCutoff > 0) {
318
- this.pBadge = DateBadgeColour.ORANGE;
319
- }
320
- else {
321
- this.pBadge = DateBadgeColour.GREEN;
322
- }
323
- }
324
- }
325
- // This will return the difference between two dates.
326
- // If fromDate is BEFORE toDate, it will be a positive number.
327
- // If fromDate is AFTER toDate, it will be a negative number.
328
- getDaysDifference(fromDate, toDate) {
329
- const fromEpoch = fromDate.getTime();
330
- const toEpoch = toDate.getTime();
331
- const diffSecs = Math.floor((toEpoch - fromEpoch) / 1000);
332
- return Math.floor(diffSecs / SECONDS_IN_A_DAY);
333
- }
334
- }
335
- DueDateComponent.decorators = [
336
- { type: Component, args: [{
337
- selector: 'xuilib-due-date',
338
- template: "<span *ngIf=\"dueDate\" class=\"due-date hmcts-badge\" [ngClass]=\"badge\"\n [title]=\"accessibleLabel\" [attr.aria-label]=\"accessibleLabel\">\n {{label}}\n</span>",
339
- encapsulation: ViewEncapsulation.None,
340
- styles: [".due-date{white-space:nowrap}.due-date.hmcts-badge--orange{color:#f47738;border-color:#f47738}"]
341
- },] }
342
- ];
343
- DueDateComponent.propDecorators = {
344
- dueDate: [{ type: Input }],
345
- highUrgencyCutoff: [{ type: Input }],
346
- mediumUrgencyCutoff: [{ type: Input }]
347
- };
348
-
349
- class FilterService {
350
- constructor() {
351
- this.givenErrors = new BehaviorSubject(null);
352
- this.isInitialSetting = false;
353
- this.filterSettings = {};
354
- this.streams = {};
355
- }
356
- persist(setting, persistence) {
357
- switch (persistence) {
358
- case 'local':
359
- this.persistLocal(setting);
360
- break;
361
- case 'session':
362
- this.persistSession(setting);
363
- break;
364
- default:
365
- break;
366
- }
367
- this.persistMemory(setting);
368
- this.updateStreams(setting);
369
- }
370
- get(id) {
371
- if (this.filterSettings[id]) {
372
- return this.filterSettings[id];
373
- }
374
- if (sessionStorage.getItem(id)) {
375
- return JSON.parse(window.sessionStorage.getItem(id));
376
- }
377
- if (localStorage.getItem(id)) {
378
- return JSON.parse(window.localStorage.getItem(id));
379
- }
380
- return null;
381
- }
382
- getStream(id) {
383
- if (!this.streams[id]) {
384
- this.streams[id] = new BehaviorSubject(this.get(id));
385
- }
386
- return this.streams[id].asObservable();
387
- }
388
- persistLocal(setting) {
389
- window.localStorage.setItem(setting.id, JSON.stringify(setting));
390
- }
391
- persistSession(setting) {
392
- window.sessionStorage.setItem(setting.id, JSON.stringify(setting));
393
- }
394
- persistMemory(setting) {
395
- this.filterSettings[setting.id] = setting;
396
- }
397
- updateStreams(setting) {
398
- if (this.streams[setting.id]) {
399
- this.streams[setting.id].next(setting);
400
- }
401
- }
402
- }
403
- FilterService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FilterService_Factory() { return new FilterService(); }, token: FilterService, providedIn: "root" });
404
- FilterService.decorators = [
405
- { type: Injectable, args: [{
406
- providedIn: 'root'
407
- },] }
408
- ];
409
-
410
- function minSelectedValidator(min) {
411
- return (control) => {
412
- const values = control.value;
413
- return values.length && values.filter(value => value).length >= min ? null : { minLength: true };
414
- };
415
- }
416
- function maxSelectedValidator(max) {
417
- return (control) => {
418
- const values = control.value;
419
- return values.length && values.filter(value => value).length <= max ? null : { maxLength: true };
420
- };
421
- }
422
- function getValues(options, values) {
423
- return options.reduce((acc, option, index) => {
424
- if (values[index]) {
425
- return [...acc, option.key];
426
- }
427
- return acc;
428
- }, []);
429
- }
430
-
431
- class GenericFilterComponent {
432
- constructor(filterService, fb) {
433
- this.filterService = filterService;
434
- this.fb = fb;
435
- this.submitted = false;
436
- }
437
- get config() {
438
- return this._config;
439
- }
440
- set config(value) {
441
- this._config = Object.assign(Object.assign({}, value), { fields: value.fields.map(field => (Object.assign(Object.assign({}, field), { displayMinSelectedError: false, displayMaxSelectedError: false }))) });
442
- this._config = value;
443
- }
444
- get settings() {
445
- return this._settings;
446
- }
447
- set settings(value) {
448
- if (!value) {
449
- this.getSettings();
450
- }
451
- if (value && value.fields) {
452
- this.mergeDefaultFields(value);
453
- }
454
- this._settings = value;
455
- }
456
- static addFormValidators(field) {
457
- const validators = [];
458
- if (field && field.minSelected) {
459
- validators.push(minSelectedValidator(field.minSelected));
460
- }
461
- if (field && field.maxSelected) {
462
- validators.push(maxSelectedValidator(field.maxSelected));
463
- }
464
- return validators;
465
- }
466
- ngOnInit() {
467
- if (!this.settings) {
468
- this.getSettings();
469
- }
470
- this.mergeDefaultFields(this.settings);
471
- this.buildForm(this.config, this.settings);
472
- this.formSub = this.form.valueChanges.subscribe(() => this.submitted = false);
473
- }
474
- ngOnDestroy() {
475
- if (this.formSub) {
476
- this.formSub.unsubscribe();
477
- }
478
- }
479
- hidden(field, form) {
480
- if (!field.showCondition) {
481
- return false;
482
- }
483
- if (typeof field.showCondition === 'string') {
484
- const control = form.get(field.name);
485
- const [name, value] = field.showCondition.split('=');
486
- if (form.value && form.value[name] === value) {
487
- if (field.type === 'find-person') {
488
- control.get('email').setValidators(Validators.required);
489
- control.get('email').updateValueAndValidity();
490
- }
491
- else {
492
- control.setValidators(Validators.required);
493
- control.updateValueAndValidity();
494
- }
495
- return false;
496
- }
497
- else {
498
- if (field.type === 'find-person') {
499
- control.get('email').clearValidators();
500
- control.get('email').updateValueAndValidity();
501
- }
502
- else {
503
- control.clearValidators();
504
- control.updateValueAndValidity();
505
- }
506
- }
507
- }
508
- return true;
509
- }
510
- disabled(field, form) {
511
- if (!field.enableCondition) {
512
- return null;
513
- }
514
- if (typeof field.enableCondition === 'string') {
515
- const control = form.get(field.name);
516
- const [name, value] = field.enableCondition.split('=');
517
- if (form.value && form.value[name] === value) {
518
- if (field.type === 'find-person') {
519
- control.get('email').setValidators(Validators.required);
520
- control.get('email').updateValueAndValidity();
521
- }
522
- else {
523
- control.setValidators(Validators.required);
524
- control.updateValueAndValidity();
525
- }
526
- return null;
527
- }
528
- else {
529
- if (field.type === 'find-person') {
530
- control.get('email').clearValidators();
531
- control.get('email').updateValueAndValidity();
532
- }
533
- else {
534
- control.clearValidators();
535
- control.updateValueAndValidity();
536
- }
537
- }
538
- }
539
- // find-location is special case where need to reset textbox (by existing disabling functionality)
540
- // field.disable referred to component itself
541
- if (field.type === 'find-location') {
542
- return true;
543
- }
544
- // Note: field.disable decides whether to actually disable or not
545
- return field.disable ? field.disable : null;
546
- }
547
- applyFilter(form) {
548
- this.submitted = true;
549
- form.markAsTouched();
550
- if (form.valid) {
551
- this._settings = {
552
- id: this.config.id,
553
- fields: this.getSelectedValues(form.value, this.config)
554
- };
555
- this.filterService.givenErrors.next(null);
556
- const settings = Object.assign(Object.assign({}, this.settings), { reset: false });
557
- this.filterService.persist(settings, this.config.persistence);
558
- }
559
- else {
560
- this.emitFormErrors(form);
561
- }
562
- }
563
- // when domain changes ensure that person field is reset
564
- fieldChanged(field, form) {
565
- // TODO - Do similar with jurisdiction/service for caseworkers by services
566
- if (field.changeResetFields && field.changeResetFields.length) {
567
- for (const resetField of field.changeResetFields) {
568
- this.resetField(resetField, form);
569
- }
570
- }
571
- }
572
- // when user enters input change radio button
573
- inputChanged(field) {
574
- if (field.radioSelectionChange && typeof field.radioSelectionChange === 'string') {
575
- const [name, value] = field.enableCondition.split('=');
576
- this.form.get(name).patchValue(value);
577
- }
578
- }
579
- cancelFilter() {
580
- this.buildForm(this.config, this.settings, true);
581
- if (this.config && this.config.cancelSetting) {
582
- this._settings.fields = JSON.parse(JSON.stringify(this.config.cancelSetting.fields));
583
- }
584
- const settings = Object.assign(Object.assign({}, this.settings), { reset: true });
585
- this.filterService.persist(settings, this.config.persistence);
586
- this.filterService.givenErrors.next(null);
587
- this.submitted = false;
588
- }
589
- updatePersonControls(values, field) {
590
- let keys;
591
- if (!values) {
592
- keys = Object.keys(this.form.get(field.name).value);
593
- }
594
- else {
595
- keys = Object.keys(values);
596
- }
597
- for (const key of keys) {
598
- if (this.form.get(field.name) && this.form.get(field.name).get(key)) {
599
- const value = values && values[key] ? values[key] : null;
600
- this.form.get(field.name).get(key).patchValue(value);
601
- }
602
- }
603
- }
604
- toggleSelectAll(event, form, item, field) {
605
- const isChecked = event.target.checked;
606
- const formArray = form.get(field.name);
607
- if (!item.selectAll) {
608
- const allChecked = formArray.controls.every((control) => control.value);
609
- let index = null;
610
- const hasSelectAllOption = field.options.find((option, i) => {
611
- if (option.hasOwnProperty('selectAll')) {
612
- index = i;
613
- return true;
614
- }
615
- return false;
616
- });
617
- // tslint:disable-next-line:variable-name
618
- const isAllCheckedExcludingTheSelectAllOption = formArray.controls.filter((_control, i) => i !== index)
619
- .every((control) => control.value);
620
- if (!allChecked && hasSelectAllOption && !isChecked) {
621
- formArray.controls.forEach((control, i) => {
622
- if (index === i) {
623
- control.patchValue(false);
624
- return;
625
- }
626
- });
627
- }
628
- else if (hasSelectAllOption && !allChecked && isChecked && isAllCheckedExcludingTheSelectAllOption) {
629
- formArray.controls[index].patchValue(true);
630
- }
631
- }
632
- else {
633
- formArray.controls.forEach((control) => {
634
- if (isChecked) {
635
- control.patchValue(true);
636
- }
637
- else {
638
- control.patchValue(false);
639
- }
640
- });
641
- }
642
- if (field.changeResetFields && field.changeResetFields.length) {
643
- for (const resetField of field.changeResetFields) {
644
- this.resetField(resetField, form);
645
- }
646
- }
647
- }
648
- resetField(resetField, form) {
649
- const control = form.get(resetField);
650
- const defaultValue = this.config.cancelSetting.fields.find((f) => f.name === resetField);
651
- if (control instanceof FormArray) {
652
- for (let i = 0; i < control.length; i++) {
653
- control.removeAt(i);
654
- }
655
- }
656
- else if (control instanceof FormGroup) {
657
- const keys = Object.keys(control.value);
658
- for (const key of keys) {
659
- this.resetField(key, control);
660
- }
661
- }
662
- else if (control instanceof FormControl) {
663
- const value = defaultValue && defaultValue.value && defaultValue.value.length ? defaultValue.value[0] : null;
664
- control.setValue(value);
665
- }
666
- }
667
- mergeDefaultFields(filter) {
668
- if (filter) {
669
- filter.fields = this.filterService.get(this.config.id) ? this.filterService.get(this.config.id).fields : filter.fields;
670
- }
671
- else if (this.config && this.config.cancelSetting) {
672
- this._settings = {
673
- id: this.config.id,
674
- fields: JSON.parse(JSON.stringify(this.config.cancelSetting.fields))
675
- };
676
- }
677
- }
678
- getSettings() {
679
- this._settings = this.filterService.get(this.config.id);
680
- }
681
- buildForm(config, settings, reset) {
682
- const findPersonControl = this.form ? this.form.get('findPersonControl') : null;
683
- this.form = this.fb.group({});
684
- if (findPersonControl) {
685
- // in order to maintain find person component, control needs to be kept
686
- this.form.addControl('findPersonControl', findPersonControl);
687
- }
688
- for (const field of config.fields) {
689
- if (field.type === 'checkbox' || field.type === 'checkbox-large') {
690
- const formArray = this.buildCheckBoxFormArray(field, settings);
691
- this.form.addControl(field.name, formArray);
692
- }
693
- else if (field.type === 'find-location') {
694
- const formArray = this.buildFindLocationFormArray(field, settings);
695
- this.form.addControl(field.name, formArray);
696
- }
697
- else {
698
- const validators = [];
699
- if (field.minSelected && field.minSelected > 0) {
700
- validators.push(Validators.required);
701
- }
702
- let defaultValue = null;
703
- if (reset && config.cancelSetting) {
704
- const cancelField = config.cancelSetting.fields.find((f) => f.name === field.name);
705
- defaultValue = cancelField && cancelField.value ? cancelField.value[0] : '';
706
- }
707
- else if (settings && settings.fields) {
708
- const lastSavedValue = settings.fields.find((f) => f.name === field.name);
709
- defaultValue = lastSavedValue && lastSavedValue ? lastSavedValue.value[0] : '';
710
- }
711
- // if field is find-person build a form group;
712
- if (field.type === 'find-person') {
713
- const formGroup = new FormGroup({
714
- domain: new FormControl(''),
715
- email: new FormControl(defaultValue && defaultValue.hasOwnProperty('email') ? defaultValue.email : '', validators),
716
- id: new FormControl(''),
717
- name: new FormControl(''),
718
- knownAs: new FormControl(''),
719
- });
720
- this.form.addControl(field.name, formGroup);
721
- }
722
- else {
723
- const control = new FormControl(defaultValue, validators);
724
- this.form.addControl(field.name, control);
725
- }
726
- // if field updates find person component set the initial domain
727
- if (field.findPersonField) {
728
- this.fieldChanged(field, this.form);
729
- }
730
- }
731
- }
732
- }
733
- buildCheckBoxFormArray(field, settings) {
734
- const validators = GenericFilterComponent.addFormValidators(field);
735
- const formArray = this.fb.array([], validators);
736
- let defaultValues;
737
- if (settings && settings.fields) {
738
- defaultValues = settings.fields.find((f) => f.name === field.name);
739
- }
740
- for (const option of field.options) {
741
- let checked = false;
742
- if (defaultValues && Array.isArray(defaultValues.value)) {
743
- checked = !!defaultValues.value.find((value) => value === option.key);
744
- }
745
- formArray.push(new FormControl(checked));
746
- }
747
- return formArray;
748
- }
749
- buildFindLocationFormArray(field, settings) {
750
- const validators = GenericFilterComponent.addFormValidators(field);
751
- const formArray = this.fb.array([], validators);
752
- let defaultValues;
753
- if (settings && settings.fields) {
754
- defaultValues = settings.fields.find((f) => f.name === field.name);
755
- if (defaultValues && defaultValues.value && defaultValues.value.length > 0) {
756
- for (const defaultValue of defaultValues.value) {
757
- formArray.push(new FormControl(defaultValue));
758
- }
759
- }
760
- }
761
- return formArray;
762
- }
763
- getSelectedValues(formValues, config) {
764
- return Object.keys(formValues).map((name) => {
765
- const values = formValues[name];
766
- if (Array.isArray(values)) {
767
- const field = config.fields.find(f => f.name === name);
768
- if (field.type === 'find-location') {
769
- return { value: values, name };
770
- }
771
- else {
772
- return { value: getValues(field.options, values), name };
773
- }
774
- }
775
- else {
776
- return { value: [values], name };
777
- }
778
- });
779
- }
780
- emitFormErrors(form) {
781
- const errors = [];
782
- for (const field of this.config.fields) {
783
- const formGroup = form.get(field.name);
784
- if (formGroup && formGroup.errors && formGroup.errors.minLength) {
785
- errors.push({ name: field.name, error: field.minSelectedError });
786
- }
787
- if (formGroup && formGroup.errors && formGroup.errors.maxLength) {
788
- errors.push({ name: field.name, error: field.minSelectedError });
789
- }
790
- }
791
- if (errors.length) {
792
- this.filterService.givenErrors.next(errors);
793
- }
794
- }
795
- }
796
- GenericFilterComponent.decorators = [
797
- { type: Component, args: [{
798
- selector: 'xuilib-generic-filter',
799
- template: "<form [formGroup]=\"form\" (ngSubmit)=\"applyFilter(form)\">\n <div class=\"contain-classes\" *ngFor=\"let field of config.fields\">\n <hr *ngIf=\"field.lineBreakBefore\" class=\"govuk-section-break govuk-section-break--visible elevated-break\">\n <div class=\"govuk-form-group xui-generic-filter\"\n [hidden]=\"hidden(field, form)\"\n [id]=\"field.name\"\n [ngClass]=\"{'form-group-error': submitted && (form.get(field.name).errors?.minLength || form.get(field.name).errors?.maxLength)}\">\n <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMinSelectedError && submitted && form.get(field.name).errors?.minLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option class=\"govuk-radios__item\" *ngFor=\"let item of field.options\" [value]=\"item.key\">{{item.label}}</option>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label\n [for]=\"'checkbox_' + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox-large'\">\n <div class=\"govuk-checkboxes\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label\n [for]=\"'checkbox_' + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radio'\">\n <div class=\"govuk-radios\">\n <div *ngFor=\"let item of field.options\" class=\"govuk-radios__item\">\n <input type=\"radio\"\n [formControlName]=\"field.name\"\n [id]=\"'radio_' + item.key\"\n [attr.disabled]=\"disabled(field, form)\"\n [checked]=\"item.key === form.get(field.name).value\"\n class=\"govuk-radios__input\"\n [value]=\"item.key\"\n (change)=\"fieldChanged(field, form)\"\n />\n <label [for]=\"'radio_' + item.key\" class=\"govuk-label govuk-radios__label\">{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-person'\">\n <xuilib-find-person subTitle=\"\" (personSelected)=\"updatePersonControls($event, field)\"\n (personFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location (locationFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [locationTitle]=\"field.locationTitle\"\n [enableAddLocationButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedLocations]=\"form.get(field.name)?.value\"\n [submitted]=\"submitted\"\n [services]=\"form.get(field.findLocationField)?.value\"\n [field]=\"field\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedServices]=\"form.get(field.name)?.value\" \n [field]=\"field\"\n ></xuilib-find-service>\n </ng-container>\n </div>\n </div>\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m govuk-section-break--visible\"/>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <button\n class=\"govuk-button govuk-!-margin-right-1 govuk-!-margin-bottom-0\"\n type=\"submit\"\n id=\"applyFilter\"\n [disabled]=\"config.enableDisabledButton && form.invalid\"\n >{{config.applyButtonText || 'Apply'}}</button>\n <button *ngIf=\"config.showCancelFilterButton\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n type=\"button\"\n id=\"cancelFilter\"\n (click)=\"cancelFilter()\">{{ config.cancelButtonText || 'Cancel'}}</button>\n </div>\n </div>\n</form>\n",
800
- changeDetection: ChangeDetectionStrategy.OnPush,
801
- encapsulation: ViewEncapsulation.None,
802
- styles: [".contain-classes .elevated-break{position:relative;top:-10px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}"]
803
- },] }
804
- ];
805
- GenericFilterComponent.ctorParameters = () => [
806
- { type: FilterService },
807
- { type: FormBuilder }
808
- ];
809
- GenericFilterComponent.propDecorators = {
810
- config: [{ type: Input }],
811
- settings: [{ type: Input }]
812
- };
813
-
814
- /*
815
- * Gov UK Dialog Component
816
- * Responsible for displaying dialog layout
817
- * using ng-content to display content from parent
818
- * */
819
- class HmctsSessionDialogComponent {
820
- constructor() {
821
- this.close = new EventEmitter();
822
- }
823
- onClose() {
824
- this.close.emit();
825
- }
826
- }
827
- HmctsSessionDialogComponent.decorators = [
828
- { type: Component, args: [{
829
- selector: 'xuilib-session-dialog',
830
- template: "<div class=\"gem-c-modal-dialogue\" data-module=\"modal-dialogue\" id=\"modal-default\" style=\"display: block;\">\n <div class=\"gem-c-modal-dialogue__overlay\"></div>\n <dialog class=\"gem-c-modal-dialogue__box\" aria-modal=\"true\" role=\"dialog\" tabindex=\"0\" [ngStyle]=\"{'margin-top': positionTop}\">\n <div class=\"gem-c-modal-dialogue__header\">\n <svg role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 38 38\" height=\"33\" width=\"33\">\n <style type=\"text/css\">\n .st0{fill:#FFFFFF;}\n </style>\n <g id=\"_4_-_granular_components_warning_icon\" transform=\"translate(0.5 0.5)\">\n <g id=\"Warning_icon\" transform=\"translate(0)\">\n <path id=\"Exclusion_1\" class=\"st0\" d=\"M18.5,37.5c-5.04,0.01-9.88-1.99-13.44-5.57C1.49,28.38-0.51,23.54-0.5,18.5\n c-0.01-5.04,1.99-9.88,5.56-13.43C8.62,1.49,13.46-0.51,18.5-0.5c5.04-0.01,9.88,1.99,13.44,5.56c3.57,3.56,5.58,8.39,5.56,13.44\n c0.01,5.04-1.99,9.88-5.56,13.44C28.38,35.51,23.54,37.51,18.5,37.5z M18.52,24.29c-0.4,0-0.8,0.08-1.17,0.23\n c-0.36,0.15-0.69,0.37-0.97,0.64c-0.28,0.27-0.5,0.59-0.65,0.95c-0.16,0.36-0.24,0.76-0.23,1.15c0,0.4,0.08,0.8,0.23,1.17\n c0.15,0.36,0.37,0.68,0.65,0.96c0.28,0.27,0.61,0.49,0.97,0.64c0.37,0.16,0.77,0.24,1.17,0.24c0.4,0,0.79-0.08,1.15-0.24\n c0.35-0.15,0.67-0.37,0.95-0.64c0.27-0.27,0.49-0.6,0.64-0.96c0.16-0.37,0.24-0.77,0.23-1.17c0-0.4-0.08-0.79-0.23-1.15\n c-0.15-0.35-0.37-0.67-0.64-0.95c-0.27-0.27-0.6-0.49-0.95-0.64C19.31,24.37,18.92,24.29,18.52,24.29L18.52,24.29z M16.11,7.5\n l0.42,14.87h3.91L20.86,7.5H16.11z\"/>\n </g>\n </g>\n </svg>\n <div class=\"gem-c-modal-dialogue__title\">We are about to sign you out</div>\n </div>\n <div class=\"gem-c-modal-dialogue__content\">\n <ng-content></ng-content>\n </div>\n </dialog>\n</div>\n",
831
- styles: [".gem-c-modal-dialogue{display:none;z-index:1000;overflow-x:hidden;overflow-y:scroll;outline:0}.gem-c-modal-dialogue,.gem-c-modal-dialogue__box{position:fixed;top:0;left:0;width:100%;height:100%}.gem-c-modal-dialogue__box{display:block;background:#fff;right:0;bottom:0;margin:0;padding:0;overflow-y:auto;border:0;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;color:#0b0c0c}.gem-c-modal-dialogue__box:focus{outline:3px solid #fd0}@media print{.gem-c-modal-dialogue__box{font-family:sans-serif}}@media (min-width:40.0625em){.gem-c-modal-dialogue__box{font-size:1.1875rem;line-height:1.3157894737}}@media print{.gem-c-modal-dialogue__box{font-size:14pt;line-height:1.15;color:#000}}@media (min-width:40.0625em){.gem-c-modal-dialogue__box{position:relative;top:inherit;right:inherit;bottom:inherit;left:inherit;width:auto;max-width:640px;height:auto;margin:30px auto;border:2px solid #0b0c0c}}@media (min-width:40.0625em){.gem-c-modal-dialogue__box--wide{max-width:960px}}@media (min-width:40.0625em) and (max-width:64em){.gem-c-modal-dialogue__box--wide{margin:30px}}.gem-c-modal-dialogue__overlay{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:.8;background:#0b0c0c;pointer-events:none;touch-action:none}@media screen{.gem-o-template--modal{overflow-y:inherit}}.gem-o-template__body--modal{overflow:hidden}.gem-o-template__body--blur .govuk-footer,.gem-o-template__body--blur .govuk-header,.gem-o-template__body--blur .govuk-main-wrapper,.gem-o-template__body--blur .govuk-phase-banner,.gem-o-template__body--blur .govuk-skip-link,.gem-o-template__body--blur .govuk-width-container .govuk-back-link{filter:blur(2px)}.govuk-warning-text__icon{margin:0 0 0 12px}.gem-c-modal-dialogue__header{padding:9px 15px 10px;color:#fff;background:#d4351d;display:flex}.gem-c-modal-dialogue__title{margin:5px 0 4px 12px}.gem-c-modal-dialogue__logotype-crown{fill:currentColor;vertical-align:middle}.gem-c-modal-dialogue__logotype-crown-fallback-image{width:30px;height:26px;border:0;vertical-align:middle}.gem-c-modal-dialogue__content{padding:15px;background:#fff}.gem-c-modal-dialogue__close-button{position:absolute;top:0;right:0;width:44px;height:44px;border:0;color:#fff;background:none;cursor:pointer;font-family:GDS Transport,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;font-size:1.5rem;line-height:1.3}@media print{.gem-c-modal-dialogue__close-button{font-family:sans-serif}}@media (min-width:40.0625em){.gem-c-modal-dialogue__close-button{font-size:2.25rem;line-height:1.3}}@media print{.gem-c-modal-dialogue__close-button{font-size:24pt;line-height:1.3}}@media (max-width:40.0525em){.gem-c-modal-dialogue__close-button{font-size:36px;line-height:1.3}}.gem-c-modal-dialogue__close-button:focus,.gem-c-modal-dialogue__close-button:hover{color:#0b0c0c;box-shadow:0 -2px #fd0,0 4px #0b0c0c;text-decoration:none;outline:none;background:#fd0}"]
832
- },] }
833
- ];
834
- HmctsSessionDialogComponent.ctorParameters = () => [];
835
- HmctsSessionDialogComponent.propDecorators = {
836
- positionTop: [{ type: Input }],
837
- close: [{ type: Output }]
838
- };
839
-
840
- class InviteUserFormComponent {
841
- constructor() {
842
- this.submitForm = new EventEmitter();
843
- }
844
- set errorMessages(value) {
845
- this.isInvalid = value || {};
846
- }
847
- onSubmit() {
848
- this.submitForm.emit();
849
- }
850
- }
851
- InviteUserFormComponent.decorators = [
852
- { type: Component, args: [{
853
- selector: 'xuilib-invite-user-form',
854
- template: "\n<form [formGroup]=\"inviteUserForm\" (ngSubmit)=\"onSubmit()\" >\n\n <xuilib-gov-uk-input\n [config]=\"{label: 'First name', hint: 'Include all middle names.', name: 'firstName', id: 'firstName', type: 'text', classes: 'testClass'}\"\n [errorMessage]=\"isInvalid.firstName\"\n [group]=\"inviteUserForm\">\n </xuilib-gov-uk-input>\n\n <xuilib-gov-uk-input\n [config]=\"{label: 'Last name', name: 'lastName', id: 'lastName', type: 'text'}\"\n [errorMessage]=\"isInvalid.lastName\"\n [group]=\"inviteUserForm\">\n </xuilib-gov-uk-input>\n\n <xuilib-gov-uk-input\n [config]=\"{label: 'Email address', name: 'email', id: 'email', type: 'email'}\"\n [errorMessage]=\"isInvalid.email\"\n [group]=\"inviteUserForm\">\n </xuilib-gov-uk-input>\n\n <xuilib-invite-permission-form [inviteUserForm]=\"inviteUserForm\" [errorMessages]=\"isInvalid.roles\">\n </xuilib-invite-permission-form>\n\n <button type=\"submit\" class=\"govuk-button\">\n Send invitation\n </button>\n</form>\n"
855
- },] }
856
- ];
857
- InviteUserFormComponent.propDecorators = {
858
- submitForm: [{ type: Output }],
859
- inviteUserForm: [{ type: Input }],
860
- errorMessages: [{ type: Input }]
861
- };
862
-
863
- class InviteUserPermissionComponent {
864
- constructor() {
865
- this.isPuiCaseManager = false;
866
- this.isPuiUserManager = false;
867
- this.isPuiOrganisationManager = false;
868
- this.isPuiFinanceManager = false;
869
- }
870
- }
871
- InviteUserPermissionComponent.decorators = [
872
- { type: Component, args: [{
873
- selector: 'xuilib-invite-permission-form',
874
- template: " <!--permissions -->\n <ng-container [formGroup]=\"inviteUserForm\">\n <xuilib-gov-uk-form-group-wrapper\n [config]=\"{hint: 'Choose what the user will be able to do. You can change this later.', legend: 'Permissions', key: 'roles'}\"\n [formGroupName]=\"'roles'\"\n [error]=\"errorMessages\">\n\n <div class=\"govuk-checkboxes\">\n <xuilib-gov-checkbox\n [group]=\"inviteUserForm.controls['roles']\"\n [isChecked]=\"isPuiCaseManager\"\n [config]=\"{value: 'pui-case-manager', label: 'Manage Cases', name: 'roles', hint: 'View, create and progress cases.', focusOn: 'roles'}\">\n </xuilib-gov-checkbox>\n\n <xuilib-gov-checkbox\n [group]=\"inviteUserForm.controls['roles']\"\n [isChecked]=\"isPuiUserManager\"\n [config]=\"{value: 'pui-user-manager', label: 'Manage Users', name: 'roles',\n hint: 'Invite users.'}\">\n </xuilib-gov-checkbox>\n\n <xuilib-gov-checkbox\n [group]=\"inviteUserForm.controls['roles']\"\n [isChecked]=\"isPuiOrganisationManager\"\n [config]=\"{value: 'pui-organisation-manager', label: 'Manage Organisation', name: 'roles',\n hint: 'View organisation name and addresses.'}\">\n </xuilib-gov-checkbox>\n\n <!-- <xuilib-gov-checkbox\n [group]=\"inviteUserForm.controls['roles']\"\n [isChecked]=\"isPuiFinanceManager\"\n [config]=\"{value: 'pui-finance-manager', label: 'Manage Payments', name: 'roles',\n hint: 'View account balances, available credit and transactions.'}\">\n </xuilib-gov-checkbox> -->\n </div>\n\n </xuilib-gov-uk-form-group-wrapper>\n</ng-container>"
875
- },] }
876
- ];
877
- InviteUserPermissionComponent.propDecorators = {
878
- inviteUserForm: [{ type: Input }],
879
- isPuiCaseManager: [{ type: Input }],
880
- isPuiUserManager: [{ type: Input }],
881
- isPuiOrganisationManager: [{ type: Input }],
882
- isPuiFinanceManager: [{ type: Input }],
883
- errorMessages: [{ type: Input }]
884
- };
885
-
886
- class LoadingSpinnerComponent {
887
- constructor() {
888
- this.loadingText = 'Loading';
889
- }
890
- }
891
- LoadingSpinnerComponent.decorators = [
892
- { type: Component, args: [{
893
- selector: 'xuilib-loading-spinner',
894
- template: "<div class=\"spinner-container\">\n <div class=\"spinner-inner-container\">\n <p>{{loadingText}}</p>\n <div class=\"spinner\" style=\"margin: auto;\"></div>\n </div>\n</div>\n",
895
- encapsulation: ViewEncapsulation.None,
896
- styles: [".spinner-container{position:fixed;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;background:hsla(0,0%,100%,.5);z-index:99}.spinner-container .spinner-inner-container p{text-align:center}.spinner-container .spinner-inner-container .spinner{border:10px solid #ddd;border-top-color:#000;border-radius:50%;width:40px;height:40px;-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}"]
897
- },] }
898
- ];
899
- LoadingSpinnerComponent.propDecorators = {
900
- loadingText: [{ type: Input }]
901
- };
902
-
903
- class CaseSharingStateService {
904
- constructor() {
905
- this.caseState = [];
906
- this.subject = new BehaviorSubject(this.caseState);
907
- }
908
- get state() {
909
- return this.subject.asObservable().pipe(distinctUntilChanged());
910
- }
911
- setCases(cases) {
912
- this.caseState = [];
913
- cases.forEach(aCase => {
914
- this.caseState.push({ caseId: aCase.caseId, caseTitle: aCase.caseTitle, caseTypeId: aCase.caseTypeId, roles: aCase.roles,
915
- sharedWith: aCase.sharedWith, pendingShares: aCase.pendingShares, pendingUnshares: aCase.pendingUnshares });
916
- });
917
- this.subject.next(this.caseState);
918
- }
919
- getCases() {
920
- return this.caseState;
921
- }
922
- requestShare(user) {
923
- const oldSharedCases = this.caseState.slice();
924
- const newSharedCases = [];
925
- for (const sharedCase of oldSharedCases) {
926
- if (!sharedCase.pendingShares) {
927
- sharedCase.pendingShares = [];
928
- }
929
- const newPendingShares = sharedCase.pendingShares.slice();
930
- if (!sharedCase.pendingUnshares) {
931
- sharedCase.pendingUnshares = [];
932
- }
933
- const newPendingUnshares = sharedCase.pendingUnshares.slice();
934
- if (!this.userHasAccess(sharedCase, user)) {
935
- if (!newPendingShares.some(u => u.email === user.email)) {
936
- newPendingShares.push(user);
937
- }
938
- }
939
- else {
940
- for (let u = 0, ul = newPendingUnshares.length; u < ul; u++) {
941
- if (newPendingUnshares[u].email === user.email) {
942
- newPendingUnshares.splice(u, 1);
943
- break;
944
- }
945
- }
946
- }
947
- const newSharedCase = Object.assign(Object.assign({}, sharedCase), { pendingUnshares: newPendingUnshares, pendingShares: newPendingShares });
948
- newSharedCases.push(newSharedCase);
949
- }
950
- this.subject.next(newSharedCases);
951
- return newSharedCases;
952
- }
953
- requestUnshare(user, caseId) {
954
- const newSharedCases = [];
955
- for (const sharedCase of this.caseState) {
956
- // If no caseId, then request unshare from all shared cases
957
- if (caseId === undefined || sharedCase.caseId === caseId) {
958
- if (!sharedCase.pendingUnshares) {
959
- sharedCase.pendingUnshares = [];
960
- }
961
- const newPendingUnshares = sharedCase.pendingUnshares.slice();
962
- // If the user is pending shared access, just remove them from pendingShares
963
- let newPendingShares;
964
- let indexOfPreviouslyAddedUser = -1;
965
- if (sharedCase.pendingShares) {
966
- indexOfPreviouslyAddedUser = sharedCase.pendingShares.findIndex(u => u.idamId === user.idamId);
967
- if (indexOfPreviouslyAddedUser > -1) {
968
- newPendingShares = sharedCase.pendingShares.slice();
969
- newPendingShares.splice(indexOfPreviouslyAddedUser, 1);
970
- }
971
- }
972
- // If the user does not exist in pendingShares, and already has shared access (i.e. exists in sharedWith),
973
- // request removal of shared access
974
- if (indexOfPreviouslyAddedUser === -1 && sharedCase.sharedWith && sharedCase.sharedWith.findIndex(u => u.idamId === user.idamId) > -1) {
975
- if (!newPendingUnshares.some(u => u.email === user.email)) {
976
- newPendingUnshares.push(user);
977
- }
978
- }
979
- const newSharedCase = Object.assign(Object.assign(Object.assign({}, sharedCase), { pendingUnshares: newPendingUnshares }), (newPendingShares && {
980
- pendingShares: newPendingShares
981
- }));
982
- newSharedCases.push(newSharedCase);
983
- }
984
- else {
985
- newSharedCases.push(sharedCase);
986
- }
987
- }
988
- this.subject.next(newSharedCases);
989
- return newSharedCases;
990
- }
991
- requestCancel(caseId, user) {
992
- const newSharedCases = [];
993
- for (const sharedCase of this.caseState) {
994
- if (sharedCase.caseId === caseId) {
995
- if (!sharedCase.pendingUnshares) {
996
- sharedCase.pendingUnshares = [];
997
- }
998
- const newPendingUnshares = sharedCase.pendingUnshares.slice();
999
- for (let iPendingUnshares = 0; iPendingUnshares < newPendingUnshares.length; iPendingUnshares++) {
1000
- if (newPendingUnshares[iPendingUnshares].email === user.email) {
1001
- newPendingUnshares.splice(iPendingUnshares, 1);
1002
- break;
1003
- }
1004
- }
1005
- if (!sharedCase.pendingShares) {
1006
- sharedCase.pendingShares = [];
1007
- }
1008
- const newPendingShares = sharedCase.pendingShares.slice();
1009
- for (let iPendingShares = 0; iPendingShares < newPendingShares.length; iPendingShares++) {
1010
- if (newPendingShares[iPendingShares].email === user.email) {
1011
- newPendingShares.splice(iPendingShares, 1);
1012
- break;
1013
- }
1014
- }
1015
- const newSharedCase = Object.assign(Object.assign({}, sharedCase), { pendingUnshares: newPendingUnshares, pendingShares: newPendingShares });
1016
- newSharedCases.push(newSharedCase);
1017
- }
1018
- else {
1019
- newSharedCases.push(sharedCase);
1020
- }
1021
- }
1022
- this.subject.next(newSharedCases);
1023
- return;
1024
- }
1025
- removeCase(caseId) {
1026
- if (this.caseState.length > 1) {
1027
- for (let i = 0, l = this.caseState.length; i < l; i++) {
1028
- if (this.caseState[i].caseId === caseId) {
1029
- this.caseState.splice(i, 1);
1030
- this.subject.next(this.caseState);
1031
- return;
1032
- }
1033
- }
1034
- }
1035
- }
1036
- userHasAccess(c, user) {
1037
- if (!c.sharedWith) {
1038
- return false;
1039
- }
1040
- for (let i = 0, l = c.sharedWith.length; i < l; i++) {
1041
- if (c.sharedWith[i].email === user.email) {
1042
- return true;
1043
- }
1044
- }
1045
- return false;
1046
- }
1047
- }
1048
- CaseSharingStateService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CaseSharingStateService_Factory() { return new CaseSharingStateService(); }, token: CaseSharingStateService, providedIn: "root" });
1049
- CaseSharingStateService.decorators = [
1050
- { type: Injectable, args: [{
1051
- providedIn: 'root'
1052
- },] }
1053
- ];
1054
- CaseSharingStateService.ctorParameters = () => [];
1055
-
1056
- class SelectedCaseConfirmComponent {
1057
- constructor(stateService) {
1058
- this.stateService = stateService;
1059
- this.changeLink = '';
1060
- }
1061
- ngOnInit() {
1062
- this.shareCases$ = this.stateService.state;
1063
- this.shareCases$.subscribe(shareCases => this.shareCases = shareCases);
1064
- }
1065
- trackByUserId(user) {
1066
- return user.idamId;
1067
- }
1068
- showUserAccessBlock() {
1069
- if (this.sharedCase.pendingShares && this.sharedCase.pendingShares.length > 0) {
1070
- return true;
1071
- }
1072
- return this.sharedCase.pendingUnshares && this.sharedCase.pendingUnshares.length > 0;
1073
- }
1074
- }
1075
- SelectedCaseConfirmComponent.decorators = [
1076
- { type: Component, args: [{
1077
- selector: 'xuilib-selected-case-confirm',
1078
- template: "<div id=\"user-access-block-{{ sharedCase.caseId }}\" *ngIf=\"showUserAccessBlock()\">\n <h2 class=\"govuk-heading-m case-share-confirm__title\">{{ sharedCase.caseTitle }}</h2>\n <div class=\"case-share-confirm__caption-area\">\n <div class=\"govuk-caption-m case-share-confirm__caption\">\n {{ sharedCase.caseId }}\n </div>\n <a [routerLink]=\"changeLink\" class=\"case-share-confirm__change-link govuk-link govuk-!-font-size-19\">Change</a>\n </div>\n <table class=\"govuk-table\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Name</th>\n <th class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Email address</th>\n <th class=\"govuk-table__header govuk-table-column-actions\" scope=\"col\">Actions</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let user of sharedCase.pendingShares; trackBy: trackByUserId\">\n <td class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <span class=\"hmcts-badge\">To be added</span>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngFor=\"let user of sharedCase.pendingUnshares; trackBy: trackByUserId\">\n <td class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <span class=\"hmcts-badge hmcts-badge--red\">To be removed</span>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n",
1079
- styles: [".case-share-confirm__title{margin-bottom:0}.case-share-confirm__caption-area{border-bottom:1px solid #b1b4b6;padding-bottom:10px;display:inline-block;width:100%;clear:both}.case-share-confirm__caption{float:left}.case-share-confirm__change-link{float:right}.govuk-table-column-header{width:45%}.govuk-table-column-actions{width:10%}"]
1080
- },] }
1081
- ];
1082
- SelectedCaseConfirmComponent.ctorParameters = () => [
1083
- { type: CaseSharingStateService }
1084
- ];
1085
- SelectedCaseConfirmComponent.propDecorators = {
1086
- sharedCase: [{ type: Input }],
1087
- changeLink: [{ type: Input }]
1088
- };
1089
-
1090
- class SelectedCaseListComponent {
1091
- constructor(stateService) {
1092
- this.stateService = stateService;
1093
- this.shareCases = [];
1094
- this.toConfirm = false;
1095
- this.changeLink = '';
1096
- this.unselect = new EventEmitter();
1097
- this.synchronizeStore = new EventEmitter();
1098
- }
1099
- ngOnInit() {
1100
- this.shareCases$ = this.stateService.state;
1101
- this.shareCases$.subscribe((shareCases) => {
1102
- this.shareCases = shareCases;
1103
- this.caseCount = this.shareCases.length;
1104
- });
1105
- }
1106
- onUnselect(sharedCase) {
1107
- this.unselect.emit(sharedCase);
1108
- this.caseCount = this.shareCases.length;
1109
- }
1110
- onSynchronizeStore(event) {
1111
- this.synchronizeStore.emit(event);
1112
- }
1113
- trackByCaseId(sharedCase) {
1114
- return sharedCase.caseId;
1115
- }
1116
- }
1117
- SelectedCaseListComponent.decorators = [
1118
- { type: Component, args: [{
1119
- selector: 'xuilib-selected-case-list',
1120
- template: "<ng-container *ngIf=\"!toConfirm\">\n <xuilib-selected-case\n *ngFor=\"let sharedCase of (shareCases$ | async); trackBy: trackByCaseId\"\n [sharedCase]=\"sharedCase\"\n [caseCount]=\"caseCount\"\n [removeUserFromCaseToggleOn]=\"removeUserFromCaseToggleOn\"\n (unselect)=\"onUnselect($event)\"\n (synchronizeStore)=\"onSynchronizeStore($event)\"\n >\n </xuilib-selected-case>\n</ng-container>\n\n<ng-container *ngIf=\"toConfirm\">\n <xuilib-selected-case-confirm\n *ngFor=\"let sharedCase of (shareCases$ | async); trackBy: trackByCaseId\"\n [sharedCase]=\"sharedCase\"\n [changeLink]=\"changeLink\">\n </xuilib-selected-case-confirm>\n</ng-container>\n",
1121
- styles: [""]
1122
- },] }
1123
- ];
1124
- SelectedCaseListComponent.ctorParameters = () => [
1125
- { type: CaseSharingStateService }
1126
- ];
1127
- SelectedCaseListComponent.propDecorators = {
1128
- shareCases$: [{ type: Input }],
1129
- removeUserFromCaseToggleOn: [{ type: Input }],
1130
- toConfirm: [{ type: Input }],
1131
- changeLink: [{ type: Input }],
1132
- unselect: [{ type: Output }],
1133
- synchronizeStore: [{ type: Output }]
1134
- };
1135
-
1136
- class SelectedCaseComponent {
1137
- constructor(stateService) {
1138
- this.stateService = stateService;
1139
- this.opened = false;
1140
- this.unselect = new EventEmitter();
1141
- this.synchronizeStore = new EventEmitter();
1142
- }
1143
- ngOnInit() {
1144
- this.shareCases$ = this.stateService.state;
1145
- this.shareCases$.subscribe(shareCases => this.shareCases = shareCases);
1146
- }
1147
- ngOnChanges(changes) {
1148
- if (changes.sharedCase) {
1149
- const sharedWith = this.sharedCase.sharedWith ? this.sharedCase.sharedWith : [];
1150
- const pendingShares = this.sharedCase.pendingShares ? this.sharedCase.pendingShares : [];
1151
- this.combinedSortedShares = this.combineAndSortShares(sharedWith, pendingShares);
1152
- }
1153
- }
1154
- onDeselect(c) {
1155
- this.unselect.emit(c);
1156
- }
1157
- trackByUserId(user) {
1158
- return user.idamId;
1159
- }
1160
- canRemove(caseId, user) {
1161
- return this.shareCases$.pipe(map(cases => {
1162
- if (this.removeUserFromCaseToggleOn) {
1163
- for (const aCase of cases) {
1164
- if (aCase.caseId === caseId) {
1165
- if (aCase.pendingUnshares && aCase.pendingUnshares.some(u => u.idamId === user.idamId)) {
1166
- return false;
1167
- }
1168
- if (aCase.sharedWith && aCase.sharedWith.some(u => u.idamId === user.idamId)) {
1169
- return true;
1170
- }
1171
- }
1172
- }
1173
- }
1174
- return false;
1175
- }));
1176
- }
1177
- canCancel(caseId, user) {
1178
- return this.shareCases$.pipe(map(cases => {
1179
- for (const aCase of cases) {
1180
- if (aCase.caseId === caseId) {
1181
- if (aCase.pendingShares && aCase.pendingShares.some(u => u.idamId === user.idamId)) {
1182
- return true;
1183
- }
1184
- if (aCase.pendingUnshares && aCase.pendingUnshares.some(u => u.idamId === user.idamId)) {
1185
- return true;
1186
- }
1187
- return false;
1188
- }
1189
- }
1190
- }));
1191
- }
1192
- isToBeRemoved(caseId, user) {
1193
- return this.shareCases$.pipe(map(cases => {
1194
- for (const aCase of cases) {
1195
- if (aCase.caseId === caseId) {
1196
- return aCase.pendingUnshares && aCase.pendingUnshares.some(u => u.idamId === user.idamId);
1197
- }
1198
- }
1199
- }));
1200
- }
1201
- isToBeAdded(caseId, user) {
1202
- return this.shareCases$.pipe(map(cases => {
1203
- for (const aCase of cases) {
1204
- if (aCase.caseId === caseId) {
1205
- return aCase.pendingShares && aCase.pendingShares.some(u => u.idamId === user.idamId);
1206
- }
1207
- }
1208
- }));
1209
- }
1210
- onRemove(user, sharedCase) {
1211
- this.stateService.requestUnshare(user, sharedCase.caseId);
1212
- this.synchronizeStore.emit(this.shareCases);
1213
- }
1214
- onCancel(user, sharedCase) {
1215
- this.stateService.requestCancel(sharedCase.caseId, user);
1216
- this.synchronizeStore.emit(this.shareCases);
1217
- }
1218
- showNoUsersAccessInfo() {
1219
- // A user is added to a case
1220
- if (this.sharedCase.pendingShares) {
1221
- if (this.sharedCase.pendingShares.length > 0) {
1222
- return false;
1223
- }
1224
- }
1225
- // A case has 0 users with access to it
1226
- if (this.sharedCase.sharedWith) {
1227
- if (this.sharedCase.sharedWith.length === 0) {
1228
- return true;
1229
- }
1230
- }
1231
- // Access to the last user is removed
1232
- if (this.sharedCase.sharedWith && this.sharedCase.pendingUnshares) {
1233
- if (this.sharedCase.pendingUnshares.length > 0
1234
- && this.sharedCase.sharedWith.length === this.sharedCase.pendingUnshares.length) {
1235
- return true;
1236
- }
1237
- }
1238
- return false;
1239
- }
1240
- showUserHasAccessInfo() {
1241
- return !this.showNoUsersAccessInfo();
1242
- }
1243
- showUserAccessTable() {
1244
- if (this.sharedCase.pendingShares) {
1245
- if (this.sharedCase.pendingShares.length > 0) {
1246
- return true;
1247
- }
1248
- }
1249
- if (this.sharedCase.sharedWith) {
1250
- if (this.sharedCase.sharedWith.length > 0) {
1251
- return true;
1252
- }
1253
- }
1254
- return false;
1255
- }
1256
- combineAndSortShares(sharedWith, pendingShares) {
1257
- return [
1258
- ...sharedWith,
1259
- ...pendingShares
1260
- ].sort((user1, user2) => {
1261
- return user1.firstName.toLowerCase() > user2.firstName.toLowerCase() ? 1 : (user2.firstName.toLowerCase() > user1.firstName.toLowerCase() ? -1 : 0);
1262
- });
1263
- }
1264
- userIdSetter(isPending, id) {
1265
- return isPending ? `pendingShares-${id}` : `${id}`;
1266
- }
1267
- buildElementId(elementName) {
1268
- return `${elementName}-${this.sharedCase.caseId}`;
1269
- }
1270
- }
1271
- SelectedCaseComponent.decorators = [
1272
- { type: Component, args: [{
1273
- selector: 'xuilib-selected-case',
1274
- template: "<div id=\"{{buildElementId('govuk-accordion__section')}}\" class=\"govuk-accordion__section\">\n <div class=\"govuk-grid-row govuk-case-header\">\n <div class=\"govuk-grid-column-three-quarters\">\n <h3 id=\"{{buildElementId('case-title')}}\" class=\"govuk-case-title\">{{ sharedCase.caseTitle }}</h3>\n <h1 id=\"{{buildElementId('case-id')}}\" class=\"govuk-case-sub-title\">{{ sharedCase.caseId }}</h1>\n </div>\n <div class=\"govuk-grid-column-twenty-percent\">\n <button *ngIf=\"caseCount > 1\"\n id=\"{{buildElementId('btn-deselect-case')}}\" \n class=\"govuk-button hmcts-button--secondary\" \n (click)=\"onDeselect(sharedCase)\" \n title=\"Deselect case\">Deselect case\n </button>\n </div>\n <div class=\"govuk-accordion__section-header govuk-grid-column-five-percent\">\n <div class=\"govuk-accordion__section-heading\">\n <button type=\"button\" id=\"{{buildElementId('accordion-with-summary-sections-heading')}}\"\n aria-controls=\"accordion-with-summary-sections-content-1\" class=\"govuk-accordion__section-button\"\n aria-describedby=\"accordion-with-summary-sections-summary-1\" aria-expanded=\"false\" title=\"Expand or Collapse\">\n <span class=\"govuk-accordion__icon\" aria-hidden=\"true\"></span></button>\n </div>\n </div>\n </div>\n <div id=\"{{buildElementId('accordion-with-summary-sections-content')}}\" class=\"govuk-accordion__section-content\"\n aria-labelledby=\"buildElementId('accordion-with-summary-sections-heading')\" >\n <div class=\"govuk-grid-row\" *ngIf=\"showNoUsersAccessInfo()\">\n <span id=\"{{buildElementId('access-info-no-user')}}\" class=\"govuk-div-align-left\">No users from your organisation currently have access to this case.</span>\n </div>\n <div class=\"govuk-grid-row\" *ngIf=\"showUserHasAccessInfo()\">\n <span id=\"{{buildElementId('access-info-has-users')}}\" class=\"govuk-div-align-left\">Users from your organisation with access to this case.</span>\n </div>\n <table class=\"govuk-table\" *ngIf=\"showUserAccessTable()\">\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th id=\"{{buildElementId('name-heading')}}\" class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Name</th>\n <th id=\"{{buildElementId('email-heading')}}\" class=\"govuk-table__header govuk-table-column-header\" scope=\"col\">Email address</th>\n <th id=\"{{buildElementId('action-heading')}}\" class=\"govuk-table__header govuk-table-column-actions\" scope=\"col\">Actions</th>\n <th id=\"{{buildElementId('label-heading')}}\" class=\"govuk-table__header govuk-table-column-label\" scope=\"col\">Status</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let user of combinedSortedShares; index as idx; trackBy: trackByUserId\">\n <td id=\"user-full-name-{{ userIdSetter(canCancel(sharedCase.caseId, user) | async, idx) }}\" class=\"govuk-table__cell\">{{ user.firstName + ' ' + user.lastName }}</td>\n <td id=\"user-email-{{ userIdSetter(canCancel(sharedCase.caseId, user) | async, idx) }}\" class=\"govuk-table__cell\">{{ user.email }}</td>\n <td class=\"govuk-table__cell\">\n <a *ngIf=\"canRemove(sharedCase.caseId, user) | async\" (click)=\"onRemove(user, sharedCase)\" href=\"javascript:void(0);\">Remove <span class=\"govuk-visually-hidden\">{{ user.firstName + ' ' + user.lastName }} from case</span></a>\n <a *ngIf=\"canCancel(sharedCase.caseId, user) | async\" (click)=\"onCancel(user, sharedCase)\" href=\"javascript:void(0);\">Cancel <span class=\"govuk-visually-hidden\">adding {{ user.firstName + ' ' + user.lastName }} to case</span></a>\n </td>\n <td class=\"govuk-table__cell\">\n <span *ngIf=\"isToBeRemoved(sharedCase.caseId, user) | async\" class=\"hmcts-badge hmcts-badge--red\">To be removed</span>\n <span *ngIf=\"isToBeAdded(sharedCase.caseId, user) | async\" class=\"hmcts-badge\">To be added</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n",
1275
- styles: [".govuk-case-header{border-top:1px solid #bfc1c3}.govuk-case-title{font-size:24px;color:#005ea5;font-weight:700}.govuk-case-sub-title,.govuk-case-title{font-family:nta,Arial,sans-serif;padding-left:0}.govuk-case-sub-title{font-size:1rem!important;color:#6f777b;font-weight:400}.govuk-grid-row{margin-left:0;margin-right:0}.govuk-grid-column-three-quarters{padding-top:5px;padding-left:0}.govuk-grid-column-twenty-percent{box-sizing:border-box;padding-top:10px;width:20%;float:left}.govuk-grid-column-five-percent{box-sizing:border-box;padding-top:15px;width:5%;float:left}.govuk-table-column-header{width:38%}.govuk-table-column-actions,.govuk-table-column-label{width:12%}.govuk-div-align-left{font-family:nta,Arial,sans-serif;font-size:1.1875rem!important;line-height:1.31579!important;text-align:left;margin-bottom:20px;padding-left:0;color:#0b0c0c}.govuk-accordion__section-header{border-top:0}.govuk-accordion__section-content{padding-top:0}"]
1276
- },] }
1277
- ];
1278
- SelectedCaseComponent.ctorParameters = () => [
1279
- { type: CaseSharingStateService }
1280
- ];
1281
- SelectedCaseComponent.propDecorators = {
1282
- sharedCase: [{ type: Input }],
1283
- selectedUser: [{ type: Input }],
1284
- opened: [{ type: Input }],
1285
- removeUserFromCaseToggleOn: [{ type: Input }],
1286
- caseCount: [{ type: Input }],
1287
- unselect: [{ type: Output }],
1288
- synchronizeStore: [{ type: Output }]
1289
- };
1290
-
1291
- class ServiceMessageComponent {
1292
- constructor() {
1293
- this.hideMessage = new EventEmitter();
1294
- }
1295
- onHideMessageEvent(key) {
1296
- this.hideMessage.emit(key);
1297
- }
1298
- }
1299
- ServiceMessageComponent.decorators = [
1300
- { type: Component, args: [{
1301
- selector: 'xuilib-service-message',
1302
- template: "<div class=\"hmcts-banner hmcts-banner--warning\">\n\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" />\n </svg>\n\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">Warning</span>\n <h2 class=\"govuk-heading-s\" [innerHTML]=\"message\"></h2>\n <a [routerLink]=\"\" class=\"govuk-link--no-visited-state\" (click)=\"onHideMessageEvent(key)\">Hide message</a>\n </div>\n\n</div>"
1303
- },] }
1304
- ];
1305
- ServiceMessageComponent.ctorParameters = () => [];
1306
- ServiceMessageComponent.propDecorators = {
1307
- message: [{ type: Input }],
1308
- key: [{ type: Input }],
1309
- hideMessage: [{ type: Output }]
1310
- };
1311
-
1312
- class FeatureToggleService {
1313
- // tslint:disable-next-line: variable-name
1314
- initialize(_user, _clientId) {
1315
- throw new Error('Not implemented');
1316
- }
1317
- // tslint:disable-next-line: variable-name
1318
- isEnabled(_feature) {
1319
- throw new Error('Not implemented');
1320
- }
1321
- // tslint:disable-next-line: variable-name
1322
- getValue(_key, _defaultValue) {
1323
- throw new Error('Not implemented');
1324
- }
1325
- // tslint:disable-next-line: variable-name
1326
- getValueOnce(_key, _defaultValue) {
1327
- throw new Error('Not implemented');
1328
- }
1329
- }
1330
- FeatureToggleService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FeatureToggleService_Factory() { return new FeatureToggleService(); }, token: FeatureToggleService, providedIn: "root" });
1331
- FeatureToggleService.decorators = [
1332
- { type: Injectable, args: [{
1333
- providedIn: 'root'
1334
- },] }
1335
- ];
1336
-
1337
- class ServiceMessagesComponent {
1338
- constructor(featureToggleService) {
1339
- this.featureToggleService = featureToggleService;
1340
- this.filteredMessages = new Map();
1341
- }
1342
- ngOnInit() {
1343
- this.getServiceMessages();
1344
- }
1345
- getServiceMessages() {
1346
- this.featureToggleService.getValue(this.featureToggleKey, null)
1347
- .subscribe(messages => {
1348
- if (!!messages) {
1349
- this.createFilteredMessages(messages);
1350
- }
1351
- });
1352
- }
1353
- createFilteredMessages(messages) {
1354
- this.hiddenBanners = JSON.parse(window.sessionStorage.getItem(this.serviceMessageCookie)) || [];
1355
- Object.keys(messages).forEach(key => {
1356
- const regEx = new RegExp(key);
1357
- if (this.userRoles.some(e => regEx.test(e)) && this.hiddenBanners.indexOf(key) === -1) {
1358
- this.filteredMessages.set(key, messages[key]);
1359
- }
1360
- });
1361
- }
1362
- hideMessage(key) {
1363
- this.filteredMessages.delete(key);
1364
- this.hiddenBanners.push(key);
1365
- window.sessionStorage.setItem(this.serviceMessageCookie, JSON.stringify(this.hiddenBanners));
1366
- }
1367
- }
1368
- ServiceMessagesComponent.decorators = [
1369
- { type: Component, args: [{
1370
- selector: 'xuilib-service-messages',
1371
- template: "<div *ngIf=\"filteredMessages?.size > 0\" class=\"govuk-width-container govuk-!-margin-top-6\">\n <xuilib-service-message *ngFor=\"let message of filteredMessages | keyvalue\" [key]=\"message.key\"\n [message]=\"message.value\" (hideMessage)=\"hideMessage($event)\"></xuilib-service-message>\n</div>"
1372
- },] }
1373
- ];
1374
- ServiceMessagesComponent.ctorParameters = () => [
1375
- { type: FeatureToggleService }
1376
- ];
1377
- ServiceMessagesComponent.propDecorators = {
1378
- userRoles: [{ type: Input }],
1379
- featureToggleKey: [{ type: Input }],
1380
- serviceMessageCookie: [{ type: Input }]
1381
- };
1382
-
1383
- class ShareCaseConfirmComponent {
1384
- constructor(stateService) {
1385
- this.stateService = stateService;
1386
- this.shareCases = []; // cases selected for sharing
1387
- this.changeLink = '';
1388
- this.completeLink = '';
1389
- }
1390
- ngOnInit() {
1391
- this.shareCases$.subscribe(shareCases => {
1392
- this.shareCases = shareCases;
1393
- this.stateService.setCases(shareCases);
1394
- });
1395
- this.shareCases$ = this.stateService.state;
1396
- }
1397
- }
1398
- ShareCaseConfirmComponent.decorators = [
1399
- { type: Component, args: [{
1400
- selector: 'xuilib-share-case-confirm',
1401
- template: "<div id=\"casesToConfirm\">\n <h3 class=\"govuk-heading-l\">Cases</h3>\n <div *ngIf=\"shareCases && shareCases.length > 0\" id=\"summarySections\">\n <xuilib-selected-case-list\n [shareCases$]=\"shareCases$\"\n [toConfirm]=\"true\"\n [changeLink]=\"changeLink\">\n </xuilib-selected-case-list>\n </div>\n\n <div id=\"noCaseDisplay\" *ngIf=\"shareCases && shareCases.length === 0\" class=\"govuk-hint\">\n No cases to display.\n </div>\n\n</div>\n\n<div id=\"share-case-nav\" *ngIf=\"shareCases && shareCases.length > 0\">\n <button class=\"govuk-button\" title=\"Confirm\" [routerLink]=\"completeLink\">Confirm</button>\n</div>\n",
1402
- styles: [""]
1403
- },] }
1404
- ];
1405
- ShareCaseConfirmComponent.ctorParameters = () => [
1406
- { type: CaseSharingStateService }
1407
- ];
1408
- ShareCaseConfirmComponent.propDecorators = {
1409
- shareCases$: [{ type: Input }],
1410
- changeLink: [{ type: Input }],
1411
- completeLink: [{ type: Input }]
1412
- };
1413
-
1414
- var SharedCaseErrorMessages;
1415
- (function (SharedCaseErrorMessages) {
1416
- SharedCaseErrorMessages["OneCaseMustBeSelected"] = "At least one case must be selected";
1417
- SharedCaseErrorMessages["NoChangesRequested"] = "You have not requested any changes to case sharing";
1418
- SharedCaseErrorMessages["OnePersonMustBeAssigned"] = "At least one person must be assigned to each case";
1419
- })(SharedCaseErrorMessages || (SharedCaseErrorMessages = {}));
1420
-
1421
- class UserSelectComponent {
1422
- constructor() {
1423
- this.selected = new EventEmitter();
1424
- this.control = new FormControl();
1425
- }
1426
- ngOnInit() {
1427
- this.filteredUsers = this.control.valueChanges.pipe(map(value => typeof value === typeof 'string' ? this.filterUsers(value) : this.users));
1428
- this.selected.emit(null);
1429
- }
1430
- displayValue(user) {
1431
- return user ? `${user.firstName} ${user.lastName} - ${user.email}` : '';
1432
- }
1433
- onSelected(e) {
1434
- this.selected.emit(e.option.value);
1435
- }
1436
- clear() {
1437
- this.control.setValue(null);
1438
- }
1439
- onUserChange(newUserValue) {
1440
- if (!newUserValue || !newUserValue.email) {
1441
- this.selected.emit(null);
1442
- }
1443
- }
1444
- filterUsers(value) {
1445
- if (value) {
1446
- value = value.toLowerCase();
1447
- return this.users.filter(user => {
1448
- if (user.firstName.toLowerCase().includes(value)) {
1449
- return true;
1450
- }
1451
- if (user.lastName.toLowerCase().includes(value)) {
1452
- return true;
1453
- }
1454
- if (user.email.toLowerCase().includes(value)) {
1455
- return true;
1456
- }
1457
- return false;
1458
- });
1459
- }
1460
- return [];
1461
- }
1462
- }
1463
- UserSelectComponent.decorators = [
1464
- { type: Component, args: [{
1465
- selector: 'xuilib-user-select',
1466
- template: "<input class=\"govuk-input\" type=\"text\" [matAutocomplete]=\"dropdown\" [formControl]=\"control\" (ngModelChange)=\"onUserChange($event)\" aria-labelledby=\"add-user-hint\">\n\n<mat-autocomplete #dropdown=\"matAutocomplete\" [displayWith]=\"displayValue\" autoActiveFirstOption (optionSelected)=\"onSelected($event)\">\n <mat-option *ngFor=\"let user of filteredUsers | async\" [value]=\"user\">\n {{ user.firstName }} {{ user.lastName }} - {{ user.email }}\n </mat-option>\n</mat-autocomplete>",
1467
- styles: [""]
1468
- },] }
1469
- ];
1470
- UserSelectComponent.ctorParameters = () => [];
1471
- UserSelectComponent.propDecorators = {
1472
- users: [{ type: Input }],
1473
- selected: [{ type: Output }]
1474
- };
1475
-
1476
- class ShareCaseComponent {
1477
- constructor(stateService, router) {
1478
- this.stateService = stateService;
1479
- this.router = router;
1480
- this.shareCases = []; // cases selected for sharing
1481
- this.continueAllowed = false;
1482
- this.selectedUserToRemove = null;
1483
- this.removeUserFromCaseToggleOn = false;
1484
- this.users = []; // users of this organisation the cases can be shared with
1485
- this.confirmLink = '';
1486
- this.cancelLink = '';
1487
- this.showRemoveUsers = false;
1488
- this.fnTitle = '';
1489
- this.title = '';
1490
- this.unselect = new EventEmitter();
1491
- this.synchronizeStore = new EventEmitter();
1492
- this.validationErrors = [];
1493
- }
1494
- ngOnInit() {
1495
- this.shareCases$
1496
- .pipe(tap(sharedCases => {
1497
- // Update the list of users assigned to at least one case
1498
- this.getAssignedUsers(sharedCases.filter(sharedCase => sharedCase.sharedWith && sharedCase.sharedWith.length > 0));
1499
- }))
1500
- .subscribe(shareCases => {
1501
- this.shareCases = shareCases;
1502
- this.stateService.setCases(shareCases);
1503
- // Set the config to be used by the xuilib-gov-uk-error-message component, in particular the element ID to
1504
- // which the error message is associated
1505
- if (shareCases) {
1506
- this.selectedCasesErrorMessageConfig = {
1507
- id: shareCases.length > 0 ? 'cases' : 'noCaseDisplay'
1508
- };
1509
- }
1510
- });
1511
- this.shareCases$ = this.stateService.state;
1512
- this.shareCaseErrorMessage = { isInvalid: false, messages: [] };
1513
- }
1514
- onUnselect(c) {
1515
- this.validationErrors = [];
1516
- if (this.stateService.getCases().length === 1) {
1517
- this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.OneCaseMustBeSelected });
1518
- this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.OneCaseMustBeSelected] };
1519
- window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
1520
- }
1521
- else {
1522
- this.unselect.emit(c);
1523
- this.stateService.removeCase(c.caseId);
1524
- }
1525
- }
1526
- onSynchronizeStore(event) {
1527
- this.synchronizeStore.emit(event);
1528
- }
1529
- onSelectedUser(user) {
1530
- this.selectedUser = user;
1531
- }
1532
- addUser() {
1533
- const newSharedCases = this.stateService.requestShare(this.selectedUser);
1534
- this.selectedUser = null;
1535
- if (this.userSelect) {
1536
- this.userSelect.clear();
1537
- }
1538
- this.synchronizeStore.emit(newSharedCases);
1539
- // Update the list of assigned users (which includes pending users)
1540
- this.getAssignedUsers(newSharedCases);
1541
- }
1542
- removeUser() {
1543
- if (this.selectedUserToRemove) {
1544
- const newSharedCases = this.stateService.requestUnshare(this.selectedUserToRemove);
1545
- this.synchronizeStore.emit(newSharedCases);
1546
- }
1547
- }
1548
- isDisabledAdd() {
1549
- return this.selectedUser === null || this.shareCases.length === 0;
1550
- }
1551
- /**
1552
- * Function originally used to set disabled state of "Continue" button, now called by the button click handler to
1553
- * control whether navigation to the confirmation page is allowed. It is prevented if no changes have been made
1554
- */
1555
- setContinueAllowed() {
1556
- // Always start with continueAllowed = false. This covers the scenario where a user might add someone for sharing
1557
- // a case (so, continueAllowed = true), then removes the same user before trying to continue. This would
1558
- // erroneously leave continueAllowed as true
1559
- this.continueAllowed = false;
1560
- this.shareCases$.subscribe(shareCases => {
1561
- for (const caseState of shareCases) {
1562
- if (caseState.pendingShares && caseState.pendingShares.length > 0) {
1563
- this.continueAllowed = true;
1564
- break;
1565
- }
1566
- if (caseState.pendingUnshares && caseState.pendingUnshares.length > 0) {
1567
- this.continueAllowed = true;
1568
- break;
1569
- }
1570
- }
1571
- });
1572
- }
1573
- onDeselect(sharedCase) {
1574
- if (sharedCase !== null) {
1575
- const updated = [];
1576
- for (const element of this.shareCases) {
1577
- if (element.caseId !== sharedCase.caseId) {
1578
- updated.push(element);
1579
- }
1580
- }
1581
- this.shareCases = updated;
1582
- }
1583
- this.stateService.setCases(this.shareCases);
1584
- }
1585
- onContinue() {
1586
- this.setContinueAllowed();
1587
- // If continuation is not allowed, set an error message
1588
- if (!this.continueAllowed) {
1589
- this.validationErrors = [];
1590
- this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.NoChangesRequested });
1591
- this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.NoChangesRequested] };
1592
- window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
1593
- }
1594
- // Navigate to confirmation page only if allowed to continue
1595
- if (this.continueAllowed) {
1596
- // Check that no case is left unassigned; a user can be removed only if there is another current user, or if at
1597
- // least one user is to be added. Prevent navigation to confirmation page if there is at least one case left in
1598
- // an unassigned state
1599
- if (this.hasCasesLeftUnassigned(this.shareCases)) {
1600
- this.validationErrors = [];
1601
- this.validationErrors.push({ id: 'cases', message: SharedCaseErrorMessages.OnePersonMustBeAssigned });
1602
- this.shareCaseErrorMessage = { isInvalid: true, messages: [SharedCaseErrorMessages.OnePersonMustBeAssigned] };
1603
- window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
1604
- }
1605
- else {
1606
- this.router.navigate([this.confirmLink]);
1607
- }
1608
- }
1609
- }
1610
- /**
1611
- * Gets a unique list of all users that have been assigned, or are pending assigment to, at least one case
1612
- * @param sharedCases The list of shared cases from which to get users these are shared with, or are to be shared with
1613
- */
1614
- getAssignedUsers(sharedCases) {
1615
- const users = [];
1616
- sharedCases.forEach(sharedCase => {
1617
- if (sharedCase.sharedWith) {
1618
- sharedCase.sharedWith.forEach(user => {
1619
- if (!users.some(existingUser => user.idamId === existingUser.idamId)) {
1620
- users.push(user);
1621
- }
1622
- });
1623
- }
1624
- if (sharedCase.pendingShares) {
1625
- sharedCase.pendingShares.forEach(user => {
1626
- if (!users.some(existingUser => user.idamId === existingUser.idamId)) {
1627
- users.push(user);
1628
- }
1629
- });
1630
- }
1631
- });
1632
- this.assignedUsers = users;
1633
- }
1634
- /**
1635
- * Checks if any shared cases have been left unassigned. This occurs if a shared case has a number of pending
1636
- * unshares equal to the number of current shares, and there are no pending shares.
1637
- * @param sharedCases The array of shared cases to check
1638
- * @returns `true` if at least one case has the condition described above; `false` otherwise
1639
- */
1640
- hasCasesLeftUnassigned(sharedCases) {
1641
- return sharedCases.some(sharedCase => {
1642
- return sharedCase.pendingUnshares && sharedCase.sharedWith &&
1643
- sharedCase.pendingUnshares.length === sharedCase.sharedWith.length &&
1644
- (!sharedCase.pendingShares || sharedCase.pendingShares.length === 0);
1645
- });
1646
- }
1647
- }
1648
- ShareCaseComponent.decorators = [
1649
- { type: Component, args: [{
1650
- selector: 'xuilib-share-case',
1651
- template: "<xuilib-hmcts-error-summary\n [errorMessages]=\"validationErrors\"\n [header]=\"'There is a problem'\"\n></xuilib-hmcts-error-summary>\n<h1 *ngIf=\"title\" class=\"govuk-heading-xl govuk-!-margin-top-2\">\n <span *ngIf=\"fnTitle\" class=\"govuk-caption-xl\">{{fnTitle}}</span>\n {{title}}\n</h1>\n<div id=\"add-user\">\n <div class=\"govuk-form-group\">\n <label class=\"govuk-label govuk-!-font-weight-bold\" for=\"add-user-input\">{{addUserLabel}}</label>\n <span id=\"add-user-hint\" class=\"govuk-hint\">\n Search by name or email address. You can share access with as many people as you need.\n </span>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <xuilib-user-select\n id=\"add-user-input\"\n aria-describedby=\"add-user-hint\"\n [users]=\"users\"\n (selected)=\"onSelectedUser($event)\">\n </xuilib-user-select>\n </div>\n <div class=\"govuk-grid-column-one-thirds\">\n <button id=\"btn-add-user\" (click)=\"addUser()\" class=\"govuk-button govuk-button--secondary\" [disabled]=\"isDisabledAdd()\" title=\"Add user to selected cases\">Add</button>\n </div>\n </div>\n <details id=\"add-user-help\" class=\"govuk-details\" data-module=\"govuk-details\">\n <summary class=\"govuk-details__summary\">\n <span id=\"content-why-can-not-find-email\" class=\"govuk-details__summary-text\">\n Can't find an email address?\n </span>\n </summary>\n <div id=\"content-reason-can-not-find-email\" class=\"govuk-details__text\">\n If you can't find your colleague's email address, they will need to complete their registration. Contact your\n administrator for help.\n </div>\n </details>\n </div>\n <div class=\"govuk-form-group\" *ngIf=\"showRemoveUsers\">\n <label class=\"govuk-label govuk-!-font-weight-bold\" for=\"remove-user-input\">Remove a person from all cases</label>\n <span id=\"remove-user-hint\" class=\"govuk-hint\">\n Select a person to remove them from all selected cases.\n </span>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <select [(ngModel)]=\"selectedUserToRemove\" class=\"govuk-select\" id=\"remove-user-input\" aria-describedby=\"remove-user-hint\">\n <option [ngValue]=\"null\" selected>Select a person</option>\n <option *ngFor=\"let user of assignedUsers\" [ngValue]=\"user\">{{user.firstName}} {{user.lastName}} - {{user.email}}</option>\n </select>\n </div>\n <div class=\"govuk-grid-column-one-thirds\">\n <button id=\"btn-remove-user\" (click)=\"removeUser()\" class=\"govuk-button govuk-button--secondary\" title=\"Remove user from selected cases\">Remove</button>\n </div>\n </div>\n </div>\n</div>\n\n<div id=\"cases\" [ngClass]=\"{'govuk-form-group--error': shareCaseErrorMessage.messages && shareCaseErrorMessage.messages.length > 0}\">\n <h3 id=\"title-selected-cases\" class=\"govuk-heading-m\">Selected cases</h3>\n <xuilib-gov-uk-error-message [config]=\"selectedCasesErrorMessageConfig\" [errorMessage]=\"shareCaseErrorMessage\"></xuilib-gov-uk-error-message>\n <div *ngIf=\"shareCases && shareCases.length > 0\" class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-with-summary-sections\">\n <xuilib-selected-case-list\n [shareCases$]=\"shareCases$\"\n [removeUserFromCaseToggleOn]=\"removeUserFromCaseToggleOn\"\n (unselect)=\"onUnselect($event)\"\n (synchronizeStore)=\"onSynchronizeStore($event)\"\n >\n </xuilib-selected-case-list>\n </div>\n\n <div id=\"noCaseDisplay\" *ngIf=\"shareCases && shareCases.length === 0\" class=\"govuk-hint\"\n [ngClass]=\"{'govuk-form-group--error': shareCaseErrorMessage.messages && shareCaseErrorMessage.messages.length > 0}\">\n No cases to display.\n </div>\n\n</div>\n\n<div id=\"share-case-nav\" class=\"govuk-button-group\">\n <button id=\"btn-continue\" class=\"govuk-button\" data-module=\"govuk-button\" (click)=\"onContinue()\" title=\"Continue\">Continue</button>\n <button id=\"btn-cancel\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\" title=\"Cancel\" [routerLink]=\"cancelLink\">Cancel</button>\n</div>\n",
1652
- styles: ["select{width:100%}"]
1653
- },] }
1654
- ];
1655
- ShareCaseComponent.ctorParameters = () => [
1656
- { type: CaseSharingStateService },
1657
- { type: Router }
1658
- ];
1659
- ShareCaseComponent.propDecorators = {
1660
- removeUserFromCaseToggleOn: [{ type: Input }],
1661
- shareCases$: [{ type: Input }],
1662
- users: [{ type: Input }],
1663
- confirmLink: [{ type: Input }],
1664
- cancelLink: [{ type: Input }],
1665
- addUserLabel: [{ type: Input }],
1666
- showRemoveUsers: [{ type: Input }],
1667
- fnTitle: [{ type: Input }],
1668
- title: [{ type: Input }],
1669
- unselect: [{ type: Output }],
1670
- synchronizeStore: [{ type: Output }],
1671
- userSelect: [{ type: ViewChild, args: [UserSelectComponent, { static: true },] }]
1672
- };
1673
-
1674
- class TabComponent {
1675
- constructor() {
1676
- this.tabChange = new EventEmitter();
1677
- }
1678
- tabChanged(event) {
1679
- this.tabChange.emit(event);
1680
- }
1681
- }
1682
- TabComponent.decorators = [
1683
- { type: Component, args: [{
1684
- selector: 'xuilib-tab',
1685
- template: "<mat-tab-group animationDuration=\"0ms\" (selectedTabChange)=\"tabChanged($event)\">\n <mat-tab *ngFor=\"let tabItem of tabItems; let last = last;\" [label]=\"tabItem.text\">\n </mat-tab>\n</mat-tab-group>"
1686
- },] }
1687
- ];
1688
- TabComponent.ctorParameters = () => [];
1689
- TabComponent.propDecorators = {
1690
- tabItems: [{ type: Input }],
1691
- tabChange: [{ type: Output }]
1692
- };
1693
-
1694
- class TcConfirmComponent {
1695
- constructor() {
1696
- this.confirm = new EventEmitter();
1697
- }
1698
- onClick() {
1699
- this.confirm.emit();
1700
- }
1701
- }
1702
- TcConfirmComponent.decorators = [
1703
- { type: Component, args: [{
1704
- selector: 'xuilib-tc-confirm',
1705
- template: "<div class=\"govuk-width-container\">\n <main role=\"main\" class=\"govuk-main-wrapper\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <div class=\"column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Using this service</h1>\n <h2 class=\"govuk-heading-m\">Terms and conditions</h2>\n <p>We've recently updated the\n <a\n routerLink=\"/terms-and-conditions\"\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >terms and conditions</a\n >.\n </p>\n <p>You must review and accept them.\n </p>\n <p>\n <button class=\"govuk-button\" (click)=\"onClick()\">\n {{ buttonText }}\n </button>\n </p>\n </div>\n </div>\n </div>\n <div class=\"govuk-grid-column-one-third\"></div>\n </main>\n</div>\n",
1706
- styles: [""]
1707
- },] }
1708
- ];
1709
- TcConfirmComponent.ctorParameters = () => [];
1710
- TcConfirmComponent.propDecorators = {
1711
- buttonText: [{ type: Input }],
1712
- confirm: [{ type: Output }]
1713
- };
1714
-
1715
- class TcDisplayHtmlComponent {
1716
- constructor() { }
1717
- }
1718
- TcDisplayHtmlComponent.decorators = [
1719
- { type: Component, args: [{
1720
- selector: 'xuilib-tc-display-html',
1721
- template: "<ng-content></ng-content>",
1722
- styles: [":host{display:block;width:100%}"]
1723
- },] }
1724
- ];
1725
- TcDisplayHtmlComponent.ctorParameters = () => [];
1726
-
1727
- class TcDisplayPlainComponent {
1728
- constructor() { }
1729
- }
1730
- TcDisplayPlainComponent.decorators = [
1731
- { type: Component, args: [{
1732
- selector: 'xuilib-tc-display-plain',
1733
- template: "<ng-content></ng-content>",
1734
- styles: [":host{display:block;width:100%}"]
1735
- },] }
1736
- ];
1737
- TcDisplayPlainComponent.ctorParameters = () => [];
1738
-
1739
- class TermsAndConditionsComponent {
1740
- constructor() { }
1741
- }
1742
- TermsAndConditionsComponent.decorators = [
1743
- { type: Component, args: [{
1744
- selector: 'xuilib-terms-and-conditions',
1745
- template: "<ng-container [ngSwitch]=\"document.mimeType\">\n <xuilib-tc-display-html *ngSwitchCase=\"'text/html'\">\n <div [innerHTML]=\"document.content\"></div>\n </xuilib-tc-display-html>\n <xuilib-tc-display-plain *ngSwitchCase=\"'text/plain'\">\n {{ document.content }}\n </xuilib-tc-display-plain>\n <div *ngSwitchDefault>\n An error occured. Please try again.\n </div>\n</ng-container>\n",
1746
- styles: [":host{display:block;width:100%}"]
1747
- },] }
1748
- ];
1749
- TermsAndConditionsComponent.ctorParameters = () => [];
1750
- TermsAndConditionsComponent.propDecorators = {
1751
- document: [{ type: Input }]
1752
- };
1753
-
1754
- class UserDetailsComponent {
1755
- constructor() {
1756
- this.showEditLink = false;
1757
- this.showHelpLink = false;
1758
- this.suspendUserEvent = new EventEmitter();
1759
- this.showSuspendUserButton = false;
1760
- this.reinvite = new EventEmitter();
1761
- }
1762
- reinviteClick(user) {
1763
- this.reinvite.emit(user);
1764
- }
1765
- suspendUser(suspendUser) {
1766
- this.suspendUserEvent.emit(suspendUser);
1767
- }
1768
- userHasRole(theRole) {
1769
- if (this.user && this.user.roles) {
1770
- return this.user.roles.includes(theRole);
1771
- }
1772
- return false;
1773
- }
1774
- }
1775
- UserDetailsComponent.decorators = [
1776
- { type: Component, args: [{
1777
- selector: 'xuilib-user-details',
1778
- template: "<div class=\"govuk-warning-text\" *ngIf=\"warningTitle && warningTitle !== ''\">\n<span class=\"govuk-warning-text__icon\">!</span>\n<strong class=\"govuk-warning-text__text\">\n {{ warningTitle }}\n</strong>\n</div>\n<table class=\"govuk-table\" *ngIf=\"user\">\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"row\">Name</th>\n <td class=\"govuk-table__cell\">{{user.fullName}}</td>\n <td class=\"govuk-table__cell\"></td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"row\">Email address</th>\n <td class=\"govuk-table__cell\">{{user.email}}</td>\n <td class=\"govuk-table__cell\"></td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!user.resendInvite\">\n <th class=\"govuk-table__header\" scope=\"row\">Permissions</th>\n <td class=\"govuk-table__cell\">\n <div *ngIf=\"user.manageOrganisations === 'Yes'\">Manage organisations</div>\n <div *ngIf=\"user.manageUsers === 'Yes'\">Manage users</div>\n <div *ngIf=\"user.manageCases === 'Yes'\">Manage cases</div>\n <div *ngIf=\"userHasRole('pui-caa')\">Case access administrator</div>\n <div *ngIf=\"userHasRole('pui-finance-manager')\">Manage fee accounts</div>\n </td>\n <td class=\"govuk-table__cell\"><a *ngIf=\"editPermissionRouterLink && showEditLink\" [routerLink]=\"editPermissionRouterLink\">Change <span class=\"govuk-visually-hidden\">roles</span></a></td>\n </tr>\n </tbody>\n</table>\n<button *ngIf=\"showSuspendUserButton\" class=\"govuk-button govuk-button--warning\" (click)=\"suspendUser(user)\">\n Suspend account\n</button>\n<div *ngIf=\"user && user.resendInvite\">\n <div class=\"govuk-inset-text\">\n <p>This user has already been invited but has not activated their account.</p>\n <p>If you resend an invitation, they'll receive an email from HM Courts and Tribunals to finish setting up their account.</p>\n <p>You can't invite the same user more than once an hour.</p>\n </div>\n <a role=\"button\" draggable=\"false\" class=\"govuk-button\" (click)=\"reinviteClick(user)\" id=\"resend-invite-button\">\n Resend invitation\n </a>\n</div>\n<p class=\"govuk-body\" *ngIf=\"showHelpLink && suspendHelpLink\"><a [routerLink]=\"suspendHelpLink\" target=\"_blank\">Get help</a> to reactivate this account.</p>\n",
1779
- styles: [":host{display:block}"]
1780
- },] }
1781
- ];
1782
- UserDetailsComponent.propDecorators = {
1783
- user: [{ type: Input }],
1784
- editPermissionRouterLink: [{ type: Input }],
1785
- warningTitle: [{ type: Input }],
1786
- showEditLink: [{ type: Input }],
1787
- showHelpLink: [{ type: Input }],
1788
- suspendHelpLink: [{ type: Input }],
1789
- suspendUserEvent: [{ type: Output }],
1790
- showSuspendUserButton: [{ type: Input }],
1791
- reinvite: [{ type: Output }]
1792
- };
1793
-
1794
- class UserListComponent {
1795
- constructor() {
1796
- this.users = [];
1797
- this.userClick = new EventEmitter();
1798
- this.pageChange = new EventEmitter();
1799
- }
1800
- ngOnInit() {
1801
- this.pagination = { itemsPerPage: 50, currentPage: this.currentPageNumber, totalItems: this.pageTotalSize };
1802
- }
1803
- onUserClick(user) {
1804
- this.userClick.emit(user);
1805
- }
1806
- emitPageClickEvent(pageNumber) {
1807
- this.currentPageNumber = pageNumber;
1808
- this.pageChange.emit(pageNumber);
1809
- }
1810
- }
1811
- UserListComponent.decorators = [
1812
- { type: Component, args: [{
1813
- selector: 'xuilib-user-list',
1814
- template: "<table class=\"govuk-table\">\n\n <thead clas=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\">Name</th>\n <th class=\"govuk-table__header\" scope=\"col\">Email</th>\n <th class=\"govuk-table__header\" scope=\"col\">Status</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <ng-container *ngFor=\"let u of users | paginate: { itemsPerPage: pagination.itemsPerPage, currentPage: currentPageNumber, totalItems: pagination.totalItems }\">\n <tr class=\"govuk-table__row\" data-selector=\"table-row\">\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">\n <a class=\"govuk-link\" [attr.title]=\"u.routerLinkTitle\" [routerLink]=\"u.routerLink\" (click)=\"onUserClick(u)\">{{ u.fullName }}</a>\n </td>\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">{{ u.email }}</td>\n <td class=\"govuk-table__cell\" data-selector=\"table-cell\">{{ u.status }}</td>\n </tr>\n </ng-container>\n </tbody>\n</table>\n<xuilib-hmcts-pagination (pageChange)=\"emitPageClickEvent($event)\" [pageSize]=\"pagination.itemsPerPage\"></xuilib-hmcts-pagination>\n",
1815
- styles: [":host{display:block}"]
1816
- },] }
1817
- ];
1818
- UserListComponent.propDecorators = {
1819
- users: [{ type: Input }],
1820
- currentPageNumber: [{ type: Input }],
1821
- pageTotalSize: [{ type: Input }],
1822
- userClick: [{ type: Output }],
1823
- pageChange: [{ type: Output }]
1824
- };
1825
-
1826
- class CookieService {
1827
- constructor(doc) {
1828
- this.document = doc;
1829
- }
1830
- setCookie(key, value, expiryDate) {
1831
- const expiry = expiryDate ? ` expires=${expiryDate}` : '';
1832
- const cookie = `${key}=${value};${expiry}`;
1833
- this.document.cookie = cookie;
1834
- }
1835
- getCookie(key) {
1836
- const cookieValue = this.document.cookie
1837
- .split('; ')
1838
- .find(row => row.startsWith(`${key}=`))
1839
- .split('=')[1];
1840
- return cookieValue;
1841
- }
1842
- deleteCookie(key, path, domain) {
1843
- const pathValue = path ? `; path=${path}` : '';
1844
- const domainValue = domain ? `; domain=${domain}` : '';
1845
- this.document.cookie = `${key}=${pathValue}${domainValue}; expires=Thu, 01 Jan 1970 00:00:01 GMT; max-age=0`;
1846
- }
1847
- deleteCookieByPartialMatch(key, path, domain) {
1848
- this.document.cookie
1849
- .split('; ')
1850
- .filter(row => row.startsWith(`${key}`))
1851
- .forEach(element => {
1852
- this.deleteCookie(element.split('=')[0], path, domain);
1853
- });
1854
- }
1855
- checkCookie(key) {
1856
- return this.document.cookie.split('; ').some(item => item.trim().startsWith(`${key}=`));
1857
- }
1858
- }
1859
- CookieService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CookieService_Factory() { return new CookieService(i0.ɵɵinject(i4.DOCUMENT)); }, token: CookieService, providedIn: "root" });
1860
- CookieService.decorators = [
1861
- { type: Injectable, args: [{
1862
- providedIn: 'root'
1863
- },] }
1864
- ];
1865
- CookieService.ctorParameters = () => [
1866
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
1867
- ];
1868
-
1869
- const windowToken = new InjectionToken('Window');
1870
- function windowProvider() { return window; }
1871
-
1872
- class CookieBannerComponent {
1873
- constructor(cookieService, window) {
1874
- this.cookieService = cookieService;
1875
- this.rejectionNotifier = new EventEmitter();
1876
- this.acceptanceNotifier = new EventEmitter();
1877
- this.isCookieBannerVisible = false;
1878
- this.window = window;
1879
- }
1880
- ngOnInit() {
1881
- this.setState();
1882
- }
1883
- acceptCookie() {
1884
- this.cookieService.setCookie(this.identifier, 'true', this.getExpiryDate());
1885
- this.setState(true);
1886
- }
1887
- rejectCookie() {
1888
- this.cookieService.setCookie(this.identifier, 'false', this.getExpiryDate());
1889
- this.setState(true);
1890
- }
1891
- setState(reload = false) {
1892
- this.isCookieBannerVisible = !this.cookieService.checkCookie(this.identifier);
1893
- if (this.areCookiesAccepted()) {
1894
- this.notifyAcceptance();
1895
- }
1896
- else {
1897
- this.notifyRejection();
1898
- }
1899
- if (reload) { // reload if any of the buttons are pressed
1900
- this.window.location.reload();
1901
- }
1902
- }
1903
- areCookiesAccepted() {
1904
- return this.cookieService.checkCookie(this.identifier) && this.cookieService.getCookie(this.identifier) === 'true';
1905
- }
1906
- notifyRejection() {
1907
- this.rejectionNotifier.emit();
1908
- }
1909
- notifyAcceptance() {
1910
- this.acceptanceNotifier.emit();
1911
- }
1912
- getExpiryDate() {
1913
- const now = new Date();
1914
- const time = now.getTime();
1915
- const expireTime = time + 31536000000; // in 365 days = 3600 * 1000 * 24 * 365
1916
- now.setTime(expireTime);
1917
- return now.toUTCString();
1918
- }
1919
- }
1920
- CookieBannerComponent.decorators = [
1921
- { type: Component, args: [{
1922
- selector: 'xuilib-cookie-banner',
1923
- template: "<div class=\"govuk-cookie-banner \" role=\"region\" attr.aria-label=\"'Cookies on {{appName}}'\" *ngIf=\"isCookieBannerVisible\">\n <div class=\"govuk-cookie-banner__message govuk-width-container\">\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <h2 class=\"govuk-cookie-banner__heading govuk-heading-m\">Cookies on {{appName}}</h2>\n\n <div class=\"govuk-cookie-banner__content\">\n <p>We use some essential cookies to make this service work.</p>\n <p>We\u2019d also like to use analytics cookies so we can understand how you use the service and make improvements.</p>\n </div>\n </div>\n </div>\n\n <div class=\"govuk-button-group\">\n <button value=\"accept\" type=\"button\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\" (click)=\"acceptCookie()\">\n Accept analytics cookies\n </button>\n <button value=\"reject\" type=\"button\" name=\"cookies\" class=\"govuk-button\" data-module=\"govuk-button\" (click)=\"rejectCookie()\">\n Reject analytics cookies\n </button>\n <a class=\"govuk-link\" routerLink=\"/cookies\">View cookies</a>\n </div>\n </div>\n</div>"
1924
- },] }
1925
- ];
1926
- CookieBannerComponent.ctorParameters = () => [
1927
- { type: CookieService },
1928
- { type: undefined, decorators: [{ type: Inject, args: [windowToken,] }] }
1929
- ];
1930
- CookieBannerComponent.propDecorators = {
1931
- identifier: [{ type: Input }],
1932
- appName: [{ type: Input }],
1933
- rejectionNotifier: [{ type: Output }],
1934
- acceptanceNotifier: [{ type: Output }]
1935
- };
1936
-
1937
- var BadgeColour;
1938
- (function (BadgeColour) {
1939
- BadgeColour["BADGE_RED"] = "hmcts-badge--red";
1940
- BadgeColour["BADGE_BLUE"] = "hmcts-badge--blue";
1941
- BadgeColour["BADGE_GREEN"] = "hmcts-badge--green";
1942
- })(BadgeColour || (BadgeColour = {}));
1943
-
1944
- class AnonymousFeatureUser {
1945
- }
1946
- class LoggedInFeatureUser {
1947
- }
1948
-
1949
- var BookingCheckType;
1950
- (function (BookingCheckType) {
1951
- BookingCheckType["NO_CHECK"] = "NO_CHECK";
1952
- BookingCheckType["BOOKINGS_AND_BASE"] = "BOOKINGS_AND_BASE";
1953
- BookingCheckType["POSSIBLE_BOOKINGS"] = "POSSIBLE_BOOKINGS";
1954
- })(BookingCheckType || (BookingCheckType = {}));
1955
-
1956
- var PersonRole;
1957
- (function (PersonRole) {
1958
- PersonRole["JUDICIAL"] = "Judicial";
1959
- PersonRole["CASEWORKER"] = "Legal Ops";
1960
- PersonRole["ADMIN"] = "Admin";
1961
- PersonRole["CTSC"] = "CTSC User";
1962
- PersonRole["ALL"] = "All";
1963
- })(PersonRole || (PersonRole = {}));
1964
- // Note: RoleCategory could replace PersonRole possibly
1965
- // However a lot of webapp logic is based on current PersonRole understanding
1966
- var RoleCategory;
1967
- (function (RoleCategory) {
1968
- RoleCategory["JUDICIAL"] = "JUDICIAL";
1969
- RoleCategory["CASEWORKER"] = "LEGAL_OPERATIONS";
1970
- RoleCategory["ADMIN"] = "ADMIN";
1971
- RoleCategory["CTSC"] = "CTSC";
1972
- RoleCategory["ALL"] = "ALL";
1973
- })(RoleCategory || (RoleCategory = {}));
1974
-
1975
- class RadioFilterFieldConfig {
1976
- }
1977
-
1978
- class LocationService {
1979
- constructor(http) {
1980
- this.http = http;
1981
- }
1982
- /**
1983
- * @description getAllLocations from service Ids/location type/search term
1984
- * @param serviceIds: SSCS | SSCS,IA split with ','
1985
- * @param locationType: optional | hearing | case_management
1986
- * @param searchTerm: any search term for postcode | site name | venue name |court name | court address etc.
1987
- * @return Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
1988
- */
1989
- getAllLocations(serviceIds, locationType, searchTerm, userLocations, bookingLocations) {
1990
- return this.http.post(`api/locations/getLocations`, { serviceIds, locationType, searchTerm, userLocations, bookingLocations });
1991
- }
1992
- /**
1993
- * @description searchLocations from service Ids/location type/search term
1994
- * @param serviceIds: BBA3 | BBA3,BFA1 split with ','
1995
- * @param locationType: optional | hearing | case_management
1996
- * @param searchTerm: any search term for postcode | site name | venue name |court name | court address etc.
1997
- * @return Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
1998
- */
1999
- searchLocations(serviceIds, locationType, searchTerm) {
2000
- return this.http.get(`api/prd/location/getLocations?serviceIds=${serviceIds}&locationType=${locationType}&searchTerm=${searchTerm}`);
2001
- }
2002
- }
2003
- LocationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LocationService_Factory() { return new LocationService(i0.ɵɵinject(i1.HttpClient)); }, token: LocationService, providedIn: "root" });
2004
- LocationService.decorators = [
2005
- { type: Injectable, args: [{
2006
- providedIn: 'root'
2007
- },] }
2008
- ];
2009
- LocationService.ctorParameters = () => [
2010
- { type: HttpClient }
2011
- ];
2012
-
2013
- class SessionStorageService {
2014
- /**
2015
- * Get an item from the session storage.
2016
- * If remove is true, the item will be removed once read
2017
- * @param removeAfterRead removed the key once it has been read
2018
- */
2019
- getItem(key, removeAfterRead = false) {
2020
- const item = sessionStorage.getItem(key);
2021
- if (removeAfterRead) {
2022
- this.removeItem(key);
2023
- }
2024
- return item;
2025
- }
2026
- /**
2027
- * Set an item in the session storage.
2028
- */
2029
- setItem(key, value) {
2030
- sessionStorage.setItem(key, value);
2031
- }
2032
- /**
2033
- * Remove an item in the session storage.
2034
- */
2035
- removeItem(key) {
2036
- sessionStorage.removeItem(key);
2037
- }
2038
- /**
2039
- * Clear all the items held in session storage.
2040
- */
2041
- clear() {
2042
- sessionStorage.clear();
2043
- }
2044
- }
2045
- SessionStorageService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SessionStorageService_Factory() { return new SessionStorageService(); }, token: SessionStorageService, providedIn: "root" });
2046
- SessionStorageService.decorators = [
2047
- { type: Injectable, args: [{
2048
- providedIn: 'root'
2049
- },] }
2050
- ];
2051
-
2052
- class SearchLocationComponent {
2053
- constructor(locationService, sessionStorageService, fb, cd) {
2054
- this.locationService = locationService;
2055
- this.sessionStorageService = sessionStorageService;
2056
- this.fb = fb;
2057
- this.cd = cd;
2058
- this.disabled = null;
2059
- this.singleMode = false;
2060
- this.locationType = '';
2061
- this.serviceIds = '';
2062
- this.submitted = true;
2063
- this.delay = 500;
2064
- this.showAutocomplete = false;
2065
- this.locations = [];
2066
- this.locationSelected = new EventEmitter();
2067
- this.locationInputChanged = new EventEmitter();
2068
- this.searchLocationChanged = new EventEmitter();
2069
- this.minSearchCharacters = 3;
2070
- this.term = '';
2071
- this.pSelectedLocations = [];
2072
- this.pReset = true;
2073
- this.form = this.fb.group({
2074
- searchTerm: ['']
2075
- });
2076
- }
2077
- get reset() {
2078
- return this.pReset;
2079
- }
2080
- set reset(value) {
2081
- this.pReset = value;
2082
- this.resetSearchTerm();
2083
- }
2084
- get selectedLocations() {
2085
- return this.pSelectedLocations;
2086
- }
2087
- set selectedLocations(value) {
2088
- this.pSelectedLocations = value;
2089
- }
2090
- ngOnInit() {
2091
- if (this.singleMode && this.selectedLocations.length > 0) {
2092
- const location = this.selectedLocations[0];
2093
- this.form.controls.searchTerm.patchValue(location.site_name, { emitEvent: false, onlySelf: true });
2094
- }
2095
- this.search();
2096
- }
2097
- filter(term) {
2098
- this.getLocations(term).pipe(map((locations) => this.removeSelectedLocations(locations)));
2099
- }
2100
- onSelectionChange(location) {
2101
- this.form.controls.searchTerm.patchValue(location.site_name, { emitEvent: false, onlySelf: true });
2102
- this.locationSelected.emit(location);
2103
- }
2104
- search() {
2105
- this.form.controls.searchTerm.valueChanges
2106
- .pipe(tap((term) => this.locationInputChanged.next(term)), tap(() => this.locations = []), tap((term) => this.term = term), filter(term => !!term && term.length >= this.minSearchCharacters), debounceTime(this.delay), mergeMap(value => this.getLocations(value)), map((locations) => this.removeSelectedLocations(locations))).subscribe(locations => {
2107
- this.locations = locations;
2108
- this.cd.markForCheck();
2109
- if (locations.length === 1 && this.term === locations[0].site_name && !this.singleMode) {
2110
- this.locationSelected.emit(locations[0]);
2111
- this.showAutocomplete = false;
2112
- return;
2113
- }
2114
- this.showAutocomplete = true;
2115
- });
2116
- }
2117
- onInput() {
2118
- this.searchLocationChanged.emit();
2119
- }
2120
- getLocations(term) {
2121
- let userLocations;
2122
- let bookingLocations;
2123
- // Booking type info - can create more
2124
- // NO_CHECK - All work - Do not filter out locations - Default assumption
2125
- // ONLY_BOOKINGS - My work - Try to only show base locations/booking locations
2126
- // POSSIBLE_BOOKINGS - Create booking screen - Show only potential bookings
2127
- if (this.bookingCheck === BookingCheckType.BOOKINGS_AND_BASE) {
2128
- userLocations = JSON.parse(this.sessionStorageService.getItem('userLocations'));
2129
- bookingLocations = JSON.parse(this.sessionStorageService.getItem('bookingLocations'));
2130
- }
2131
- else if (this.bookingCheck === BookingCheckType.POSSIBLE_BOOKINGS) {
2132
- userLocations = JSON.parse(this.sessionStorageService.getItem('userLocations'));
2133
- this.serviceIds = JSON.parse(this.sessionStorageService.getItem('bookableServices'));
2134
- }
2135
- return this.locationService.getAllLocations(this.serviceIds, this.locationType, term, userLocations, bookingLocations);
2136
- }
2137
- resetSearchTerm() {
2138
- this.form.controls.searchTerm.patchValue('', { emitEvent: false, onlySelf: true });
2139
- }
2140
- removeSelectedLocations(locations) {
2141
- if (this.singleMode) {
2142
- return locations;
2143
- }
2144
- return locations.filter(location => !this.selectedLocations.map(selectedLocation => selectedLocation.epimms_id).includes(location.epimms_id) && location.site_name);
2145
- }
2146
- }
2147
- SearchLocationComponent.decorators = [
2148
- { type: Component, args: [{
2149
- selector: 'exui-search-location',
2150
- template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputLocationSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchLocation\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locations\"\n (onSelectionChange)=\"onSelectionChange(location)\">\n {{ location.site_name }}\n </mat-option>\n <mat-option *ngIf=\"!locations.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
2151
- styles: [".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{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}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
2152
- },] }
2153
- ];
2154
- SearchLocationComponent.ctorParameters = () => [
2155
- { type: LocationService },
2156
- { type: SessionStorageService },
2157
- { type: FormBuilder },
2158
- { type: ChangeDetectorRef }
2159
- ];
2160
- SearchLocationComponent.propDecorators = {
2161
- control: [{ type: Input }],
2162
- disabled: [{ type: Input }],
2163
- singleMode: [{ type: Input }],
2164
- locationType: [{ type: Input }],
2165
- serviceIds: [{ type: Input }],
2166
- submitted: [{ type: Input }],
2167
- delay: [{ type: Input }],
2168
- form: [{ type: Input }],
2169
- showAutocomplete: [{ type: Input }],
2170
- locations: [{ type: Input }],
2171
- bookingCheck: [{ type: Input }],
2172
- locationSelected: [{ type: Output }],
2173
- locationInputChanged: [{ type: Output }],
2174
- searchLocationChanged: [{ type: Output }],
2175
- reset: [{ type: Input }],
2176
- selectedLocations: [{ type: Input }]
2177
- };
2178
-
2179
- class FindLocationComponent {
2180
- constructor() {
2181
- this.locationFieldChanged = new EventEmitter();
2182
- this.selectedLocations = [];
2183
- this.submitted = true;
2184
- this.enableAddLocationButton = true;
2185
- this.locationTitle = 'Search for a location by name';
2186
- this.disableInputField = false;
2187
- this.locations = [];
2188
- this.tempSelectedLocation = null;
2189
- this.serviceIds = 'SSCS,IA';
2190
- this.pServices = [];
2191
- this.pDisabled = false;
2192
- }
2193
- get disabled() {
2194
- return this.pDisabled;
2195
- }
2196
- set disabled(value) {
2197
- if (value) {
2198
- this.searchLocationComponent.resetSearchTerm();
2199
- this.removeSelectedValues();
2200
- }
2201
- this.pDisabled = this.disableInputField === true ? true : null;
2202
- }
2203
- get services() {
2204
- return this.pServices;
2205
- }
2206
- set services(value) {
2207
- this.pServices = value;
2208
- const field = this.fields.find(f => f.name === this.field.findLocationField);
2209
- if (field) {
2210
- if (typeof value === 'string') {
2211
- this.serviceIds = value;
2212
- }
2213
- else {
2214
- this.serviceIds = getValues(field.options, value).filter(x => x !== 'services_all').join(',');
2215
- }
2216
- }
2217
- }
2218
- ngOnInit() {
2219
- // implemented to get rid of undefined values
2220
- this.selectedLocations = this.selectedLocations.filter(location => location.epimms_id);
2221
- }
2222
- addLocation() {
2223
- if (this.tempSelectedLocation) {
2224
- this.selectedLocations = [...this.selectedLocations, this.tempSelectedLocation];
2225
- this.addSelectedLocationsToForm([this.tempSelectedLocation]);
2226
- this.tempSelectedLocation = null;
2227
- this.locations = [];
2228
- this.searchLocationComponent.resetSearchTerm();
2229
- }
2230
- }
2231
- removeLocation(location) {
2232
- if (location.epimms_id) {
2233
- this.selectedLocations = this.selectedLocations.filter(selectedLocation => selectedLocation.epimms_id !== location.epimms_id);
2234
- const formArray = this.form.get(this.field.name);
2235
- const index = formArray.value.findIndex(selectedLocation => selectedLocation.epimms_id === location.epimms_id);
2236
- if (index > -1) {
2237
- formArray.removeAt(index);
2238
- }
2239
- }
2240
- }
2241
- onInputChanged(term) {
2242
- // if the filter is in single mode clear the selected locations
2243
- if (typeof term === 'string' && this.field.maxSelected === 1) {
2244
- this.removeSelectedValues();
2245
- }
2246
- }
2247
- onSearchInputChanged() {
2248
- this.locationFieldChanged.emit();
2249
- }
2250
- onLocationSelected(location) {
2251
- if (this.field.maxSelected === 1) {
2252
- this.removeSelectedValues();
2253
- this.addSelectedLocationsToForm([location]);
2254
- }
2255
- else {
2256
- if (!this.selectedLocations.find(x => x.epimms_id === location.epimms_id)) {
2257
- if (location.epimms_id) {
2258
- this.tempSelectedLocation = location;
2259
- }
2260
- }
2261
- }
2262
- }
2263
- removeSelectedValues() {
2264
- const formArray = this.form.get(this.field.name);
2265
- for (let i = 0; i < formArray.length; i++) {
2266
- formArray.removeAt(i);
2267
- }
2268
- this.selectedLocations = [];
2269
- }
2270
- addSelectedLocationsToForm(locations) {
2271
- const formArray = this.form.get(this.field.name);
2272
- for (const location of locations) {
2273
- formArray.push(new FormControl(location));
2274
- }
2275
- }
2276
- }
2277
- FindLocationComponent.decorators = [
2278
- { type: Component, args: [{
2279
- selector: 'xuilib-find-location',
2280
- template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"locationTitle\">{{locationTitle}}</label>\n </div>\n <exui-search-location class=\"search-location\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [bookingCheck]=\"field.bookingCheckType\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\n (searchLocationChanged)=\"onSearchInputChanged()\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\" class=\"govuk-button\" data-module=\"govuk-button\" *ngIf=\"enableAddLocationButton\">\n Add location\n </a>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedLocations\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeLocation(selection)\" href=\"javascript:void(0)\">\n {{ selection.site_name }}\n </a>\n </li>\n </ul>\n</div>\n",
2281
- styles: [""]
2282
- },] }
2283
- ];
2284
- FindLocationComponent.propDecorators = {
2285
- locationFieldChanged: [{ type: Output }],
2286
- selectedLocations: [{ type: Input }],
2287
- submitted: [{ type: Input }],
2288
- enableAddLocationButton: [{ type: Input }],
2289
- form: [{ type: Input }],
2290
- field: [{ type: Input }],
2291
- fields: [{ type: Input }],
2292
- locationTitle: [{ type: Input }],
2293
- disableInputField: [{ type: Input }],
2294
- searchLocationComponent: [{ type: ViewChild, args: [SearchLocationComponent, { static: true },] }],
2295
- disabled: [{ type: Input }],
2296
- services: [{ type: Input }]
2297
- };
2298
-
2299
- class PaginationComponent {
2300
- constructor() {
2301
- this.previousPage = new EventEmitter();
2302
- this.nextPage = new EventEmitter();
2303
- }
2304
- onPrevious() {
2305
- this.previousPage.emit(null);
2306
- }
2307
- onNext() {
2308
- this.nextPage.emit(null);
2309
- }
2310
- }
2311
- PaginationComponent.decorators = [
2312
- { type: Component, args: [{
2313
- selector: 'xuilib-pagination',
2314
- template: "<nav class=\"hmcts-pagination\" id=\"pagination-label\">\n\n <p class=\"govuk-visually-hidden\" aria-labelledby=\"pagination-label\">Pagination navigation</p>\n\n <ul class=\"hmcts-pagination__list\">\n <li class=\"hmcts-pagination__item hmcts-pagination__item--prev\">\n <a *ngIf=\"firstRecord > 1; else noPrevious\" class=\"hmcts-pagination__link\" (click)=\"onPrevious()\" href=\"javascript:void(0)\">\n Previous page\n </a>\n <ng-template #noPrevious>\n <span class=\"hmcts-pagination__link\">Previous page</span>\n </ng-template>\n </li>\n\n <li class=\"hmcts-pagination__item hmcts-pagination__item--next\">\n <a *ngIf=\"moreItems; else noNext\" class=\"hmcts-pagination__link\" (click)=\"onNext()\" href=\"javascript:void(0)\">Next page</a>\n <ng-template #noNext>\n <span class=\"hmcts-pagination__link\">Next page</span>\n </ng-template>\n </li>\n </ul>\n</nav>\n",
2315
- styles: ["span.hmcts-pagination__link:hover{color:revert}"]
2316
- },] }
2317
- ];
2318
- PaginationComponent.ctorParameters = () => [];
2319
- PaginationComponent.propDecorators = {
2320
- moreItems: [{ type: Input }],
2321
- firstRecord: [{ type: Input }],
2322
- previousPage: [{ type: Output }],
2323
- nextPage: [{ type: Output }]
2324
- };
2325
-
2326
- class SearchVenueComponent {
2327
- constructor(locationService, fb) {
2328
- this.locationService = locationService;
2329
- this.disabled = null;
2330
- this.locationType = '';
2331
- this.serviceIds = '';
2332
- this.submitted = true;
2333
- this.showAutocomplete = false;
2334
- this.locationChanged = new EventEmitter();
2335
- this.minSearchCharacters = 3;
2336
- this.keyUpSubject$ = new Subject();
2337
- this.readyAfterContent = false;
2338
- this.searchInProgress = false;
2339
- this.findLocationFormGroup = fb.group({
2340
- findLocationFormControl: [null],
2341
- locationSelectedFormControl: [null]
2342
- });
2343
- this.selectedLocations = [];
2344
- }
2345
- ngAfterContentInit() {
2346
- this.readyAfterContent = true;
2347
- }
2348
- ngOnInit() {
2349
- this.displayedLocations = [];
2350
- if (this.control) {
2351
- if (this.findLocationFormGroup && this.findLocationFormGroup.controls) {
2352
- this.findLocationFormGroup.controls.locationSelectedFormControl = this.control;
2353
- }
2354
- }
2355
- this.keyUpSubject$.pipe(debounceTime(500)).subscribe(searchValue => this.search(searchValue));
2356
- }
2357
- onKeyDown() {
2358
- this.locationChanged.emit();
2359
- }
2360
- onKeyUp(event) {
2361
- this.showAutocomplete = false;
2362
- this.keyUpSubject$.next(event.target.value);
2363
- }
2364
- onFocus() {
2365
- this.showAutocomplete = false;
2366
- }
2367
- get displayedLocationsDuplicationFiltered() {
2368
- return this.displayedLocations.filter(location => !this.selectedLocations.map(selectedLocation => selectedLocation.epimms_id).includes(location.epimms_id) && location.court_name);
2369
- }
2370
- filter(term) {
2371
- this.searchLocations(term).pipe(mergeMap((apiData) => {
2372
- const apiFilter = apiData.filter(apiLocation => !this.selectedLocations.map(selectedLocation => selectedLocation.epimms_id).includes(apiLocation.epimms_id));
2373
- this.displayedLocations = apiFilter;
2374
- this.searchInProgress = false;
2375
- return apiFilter;
2376
- })).subscribe(location => {
2377
- if (term === location.court_name) {
2378
- this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(location);
2379
- this.displayedLocations = [];
2380
- this.locationChanged.emit(location);
2381
- this.showAutocomplete = false;
2382
- }
2383
- this.searchInProgress = false;
2384
- });
2385
- }
2386
- onSelectionChange(selection) {
2387
- if (this.findLocationFormGroup.controls.findLocationFormControl instanceof FormArray) {
2388
- this.findLocationFormGroup.controls.locationSelectedFormControl.push(new FormControl(selection.epimms_id));
2389
- }
2390
- else {
2391
- this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(selection);
2392
- }
2393
- this.locationChanged.emit(selection);
2394
- }
2395
- search(currentValue) {
2396
- this.searchInProgress = true;
2397
- this.showAutocomplete = !!currentValue && (currentValue.length >= this.minSearchCharacters);
2398
- if (!currentValue || !currentValue.length) {
2399
- this.findLocationFormGroup.controls.locationSelectedFormControl.markAsPristine();
2400
- this.findLocationFormGroup.controls.locationSelectedFormControl.reset();
2401
- }
2402
- if (this.showAutocomplete) {
2403
- this.filter(currentValue);
2404
- }
2405
- else {
2406
- this.searchInProgress = false;
2407
- }
2408
- }
2409
- getDisplayName(selectedLocation) {
2410
- return selectedLocation.court_name;
2411
- }
2412
- searchLocations(term) {
2413
- return this.locationService.searchLocations(this.serviceIds, this.locationType, term);
2414
- }
2415
- getControlCourtNameValue() {
2416
- return this.findLocationFormGroup && this.findLocationFormGroup.controls && this.findLocationFormGroup.controls.locationSelectedFormControl.value ?
2417
- this.findLocationFormGroup.controls.locationSelectedFormControl.value.court_name : '';
2418
- }
2419
- }
2420
- SearchVenueComponent.decorators = [
2421
- { type: Component, args: [{
2422
- selector: 'xuilib-search-venue',
2423
- template: "<div class=\"auto-complete-container\">\n <div *ngIf=\"readyAfterContent\" class=\"autocomplete__wrapper\">\n <input\n [formControl]=\"findLocationFormGroup.controls.findLocationFormControl\"\n [matAutocomplete]=\"autoSearchLocation\"\n (keydown)=\"onKeyDown()\"\n (keyup)=\"onKeyUp($event)\"\n (focus)=\"onFocus()\"\n class=\"autocomplete__input autocomplete__input--default search-box\"\n [attr.disabled]=\"!disabled ? null: disabled\"\n [value]=\"getControlCourtNameValue()\"\n #inputSelectedLocation>\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of displayedLocationsDuplicationFiltered\"\n [value]=\"getDisplayName(location)\"\n (onSelectionChange)=\"onSelectionChange(location)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(location) }}\n </mat-option>\n <mat-option *ngIf=\"!displayedLocationsDuplicationFiltered?.length && showAutocomplete && !searchInProgress\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </div>\n</div>\n",
2424
- styles: [".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%;line-height:24px;font-size:19px;background-color:transparent;position:relative}.autocomplete__hint{color:#b1b4b6;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{outline:3px solid #fd0;outline-offset:0;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{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}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:550px;display:inline-block;margin-right:4px}"]
2425
- },] }
2426
- ];
2427
- SearchVenueComponent.ctorParameters = () => [
2428
- { type: LocationService },
2429
- { type: FormBuilder }
2430
- ];
2431
- SearchVenueComponent.propDecorators = {
2432
- control: [{ type: Input }],
2433
- disabled: [{ type: Input }],
2434
- locationType: [{ type: Input }],
2435
- selectedLocations: [{ type: Input }],
2436
- serviceIds: [{ type: Input }],
2437
- submitted: [{ type: Input }],
2438
- autoCompleteInputBox: [{ type: ViewChild, args: ['inputSelectedLocation', { read: ElementRef },] }],
2439
- showAutocomplete: [{ type: Input }],
2440
- displayedLocations: [{ type: Input }],
2441
- locationChanged: [{ type: Output }]
2442
- };
2443
-
2444
- const getAllCaseworkersFromServices = (caseworkersByService) => {
2445
- let allCaseworkers = [];
2446
- caseworkersByService.forEach(caseworkerListByService => {
2447
- allCaseworkers = allCaseworkers.concat(caseworkerListByService.caseworkers);
2448
- });
2449
- return allCaseworkers;
2450
- };
2451
- const getSessionStorageKeyForServiceId = (serviceId) => {
2452
- return `${serviceId}-caseworkers`;
2453
- };
2454
- const getCaseworkers = (serviceId, sessionStorageService) => {
2455
- const sessionKey = getSessionStorageKeyForServiceId(serviceId);
2456
- const value = sessionStorageService.getItem(sessionKey);
2457
- if (value) {
2458
- return JSON.parse(value);
2459
- }
2460
- };
2461
- const setCaseworkers = (serviceId, caseworkers, sessionStorageService) => {
2462
- const sessionKey = getSessionStorageKeyForServiceId(serviceId);
2463
- sessionStorageService.setItem(sessionKey, JSON.stringify(caseworkers));
2464
- };
2465
-
2466
- class FindAPersonService {
2467
- constructor(http, sessionStorageService) {
2468
- this.http = http;
2469
- this.sessionStorageService = sessionStorageService;
2470
- }
2471
- find(searchOptions) {
2472
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
2473
- if (userInfoStr && !searchOptions.userIncluded) {
2474
- const userInfo = JSON.parse(userInfoStr);
2475
- this.userId = userInfo.id ? userInfo.id : userInfo.uid;
2476
- }
2477
- this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : null;
2478
- return this.http.post('/workallocation/findPerson', { searchOptions })
2479
- .pipe(map(judiciary => judiciary.filter(judge => !([this.assignedUser, this.userId].includes(judge.id)))));
2480
- }
2481
- findCaseworkers(searchOptions) {
2482
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
2483
- if (userInfoStr) {
2484
- const userInfo = JSON.parse(userInfoStr);
2485
- this.userId = userInfo.id ? userInfo.id : userInfo.uid;
2486
- }
2487
- this.assignedUser = searchOptions.assignedUser ? searchOptions.assignedUser : null;
2488
- const fullServices = searchOptions.services;
2489
- const storedServices = [];
2490
- const newServices = [];
2491
- const storedCaseworkersByService = [];
2492
- fullServices.forEach(serviceId => {
2493
- const serviceKey = getSessionStorageKeyForServiceId(serviceId);
2494
- if (this.sessionStorageService.getItem(serviceKey)) {
2495
- storedServices.push(serviceId);
2496
- storedCaseworkersByService.push({ service: serviceId, caseworkers: JSON.parse(this.sessionStorageService.getItem(serviceKey)) });
2497
- }
2498
- else {
2499
- newServices.push(serviceId);
2500
- }
2501
- });
2502
- // if all services are stored then return the stored caseworkers by service
2503
- if (storedServices.length === fullServices.length) {
2504
- const storedCaseworkers = getAllCaseworkersFromServices(storedCaseworkersByService);
2505
- return of(this.searchInCaseworkers(storedCaseworkers, searchOptions));
2506
- }
2507
- // all serviceIds passed in as node layer getting used anyway and caseworkers also stored there
2508
- return this.http.post('/workallocation/retrieveCaseWorkersForServices', { fullServices }).pipe(tap(caseworkersByService => {
2509
- caseworkersByService.forEach(caseworkerListByService => {
2510
- // for any new service, ensure that they are then stored in the session
2511
- if (newServices.includes(caseworkerListByService.service)) {
2512
- setCaseworkers(caseworkerListByService.service, caseworkerListByService.caseworkers, this.sessionStorageService);
2513
- }
2514
- });
2515
- }), map(caseworkersByService => {
2516
- const givenCaseworkers = getAllCaseworkersFromServices(caseworkersByService);
2517
- return this.searchInCaseworkers(givenCaseworkers, searchOptions);
2518
- }));
2519
- }
2520
- mapCaseworkers(caseworkers, roleCategory) {
2521
- const people = [];
2522
- caseworkers.forEach((caseworker) => {
2523
- const thisPerson = {
2524
- email: caseworker.email,
2525
- name: `${caseworker.firstName} ${caseworker.lastName}`,
2526
- id: caseworker.idamId,
2527
- domain: caseworker.roleCategory === RoleCategory.CASEWORKER ? PersonRole.CASEWORKER : PersonRole.ADMIN,
2528
- };
2529
- if (caseworker.roleCategory === roleCategory || roleCategory === RoleCategory.ALL) {
2530
- people.push(thisPerson);
2531
- }
2532
- });
2533
- return people;
2534
- }
2535
- searchInCaseworkers(caseworkers, searchOptions) {
2536
- let roleCategory = RoleCategory.ALL;
2537
- if (!(searchOptions.userRole === PersonRole.ALL)) {
2538
- roleCategory = searchOptions.userRole === PersonRole.CASEWORKER ? RoleCategory.CASEWORKER : RoleCategory.ADMIN;
2539
- }
2540
- const searchTerm = searchOptions && searchOptions.searchTerm ? searchOptions.searchTerm.toLowerCase() : '';
2541
- const people = caseworkers ? this.mapCaseworkers(caseworkers, roleCategory) : [];
2542
- const finalPeopleList = people.filter(person => person && person.name && person.name.toLowerCase().includes(searchTerm));
2543
- return searchOptions.userIncluded ? finalPeopleList.filter(person => person && person.id !== this.assignedUser)
2544
- : finalPeopleList.filter(person => person && person.id !== this.userId && person.id !== this.assignedUser);
2545
- }
2546
- searchJudicial(value, serviceId) {
2547
- return this.http.post('api/prd/judicial/getJudicialUsersSearch', { searchString: value, serviceCode: serviceId });
2548
- }
2549
- }
2550
- FindAPersonService.caseworkersKey = 'caseworkers';
2551
- FindAPersonService.ɵprov = i0.ɵɵdefineInjectable({ factory: function FindAPersonService_Factory() { return new FindAPersonService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(SessionStorageService)); }, token: FindAPersonService, providedIn: "root" });
2552
- FindAPersonService.decorators = [
2553
- { type: Injectable, args: [{
2554
- providedIn: 'root'
2555
- },] }
2556
- ];
2557
- FindAPersonService.ctorParameters = () => [
2558
- { type: HttpClient },
2559
- { type: SessionStorageService }
2560
- ];
2561
-
2562
- class SearchJudicialsComponent {
2563
- constructor(judicialService, fb) {
2564
- this.judicialService = judicialService;
2565
- this.disabled = null;
2566
- this.selectedJudicials = [];
2567
- this.submitted = true;
2568
- this.placeholderContent = '';
2569
- this.showAutocomplete = false;
2570
- this.judicialChanged = new EventEmitter();
2571
- this.idValue = '';
2572
- this.errorMessage = 'You must select a name';
2573
- this.serviceId = '';
2574
- this.minSearchCharacters = 3;
2575
- this.keyUpSubject$ = new Subject();
2576
- this.searchInProgress = false;
2577
- this.formGroup = fb.group({
2578
- formControl: [null],
2579
- selectedFormControl: [null]
2580
- });
2581
- }
2582
- ngOnInit() {
2583
- this.displayedJudicials = [];
2584
- if (this.control) {
2585
- if (this.formGroup && this.formGroup.controls) {
2586
- this.formGroup.controls.selectedFormControl = this.control;
2587
- this.formGroup.controls.formControl.setValue(this.getControlValueDisplayText());
2588
- }
2589
- }
2590
- this.keyUpSubject$.pipe(debounceTime(500)).subscribe(searchValue => this.search(searchValue));
2591
- }
2592
- onKeyDown() {
2593
- this.judicialChanged.emit();
2594
- }
2595
- onKeyUp(event) {
2596
- this.showAutocomplete = false;
2597
- this.keyUpSubject$.next(event.target.value);
2598
- }
2599
- onFocus() {
2600
- this.showAutocomplete = false;
2601
- }
2602
- get displayedJudicialsDuplicationFiltered() {
2603
- return this.displayedJudicials.filter(judicial => !this.selectedJudicials.map(selectedJudicial => selectedJudicial.idamId).includes(judicial.idamId));
2604
- }
2605
- filter(term) {
2606
- this.searchJudicials(term, this.serviceId).pipe(mergeMap((apiData) => {
2607
- const apiFilter = apiData.filter(apiJudicial => !this.selectedJudicials.map(selectedJudicial => selectedJudicial.idamId).includes(apiJudicial.idamId));
2608
- this.displayedJudicials = apiFilter;
2609
- this.searchInProgress = false;
2610
- return apiFilter;
2611
- })).subscribe(judicial => {
2612
- if (term === judicial.fullName) {
2613
- this.formGroup.controls.selectedFormControl.setValue(judicial);
2614
- this.displayedJudicials = [];
2615
- this.judicialChanged.emit(judicial);
2616
- this.showAutocomplete = false;
2617
- }
2618
- this.searchInProgress = false;
2619
- });
2620
- }
2621
- onSelectionChange(selection) {
2622
- if (this.formGroup.controls.formControl instanceof FormArray) {
2623
- this.formGroup.controls.selectedFormControl.push(new FormControl(selection.idamId));
2624
- }
2625
- else {
2626
- this.formGroup.controls.selectedFormControl.setValue(selection);
2627
- }
2628
- this.judicialChanged.emit(selection);
2629
- }
2630
- search(currentValue) {
2631
- this.searchInProgress = true;
2632
- this.showAutocomplete = !!currentValue && (currentValue.length >= this.minSearchCharacters);
2633
- if (!!currentValue) {
2634
- this.formGroup.controls.selectedFormControl.markAsDirty();
2635
- }
2636
- else {
2637
- this.formGroup.controls.selectedFormControl.reset();
2638
- }
2639
- if (this.showAutocomplete) {
2640
- this.filter(currentValue);
2641
- }
2642
- else {
2643
- this.searchInProgress = false;
2644
- }
2645
- }
2646
- getDisplayName(selectedJudicial) {
2647
- return `${selectedJudicial.fullName} (${selectedJudicial.emailId})`;
2648
- }
2649
- searchJudicials(term, serviceId) {
2650
- return this.judicialService.searchJudicial(term, serviceId);
2651
- }
2652
- getControlValueDisplayText() {
2653
- return this.formGroup && this.formGroup.controls && this.formGroup.controls.selectedFormControl.value ?
2654
- this.getDisplayName(this.formGroup.controls.selectedFormControl.value) : '';
2655
- }
2656
- }
2657
- SearchJudicialsComponent.decorators = [
2658
- { type: Component, args: [{
2659
- selector: 'xuilib-search-judicials',
2660
- template: "<div class=\"govuk-form-group\">\n <input id=\"inputSelectPerson{{idValue}}\" [placeholder]=\"placeholderContent\" [formControl]=\"formGroup.controls.formControl\"\n [matAutocomplete]=\"autoComplete\" (keydown)=\"onKeyDown()\" (keyup)=\"onKeyUp($event)\" (focus)=\"onFocus()\"\n class=\"govuk-input\" [attr.disabled]=\"!disabled ? null: disabled\" [value]=\"getControlValueDisplayText()\"\n #inputSelection>\n <mat-autocomplete autoActiveFirstOption #autoComplete=\"matAutocomplete\">\n <mat-option *ngFor=\"let judicial of displayedJudicialsDuplicationFiltered\" class=\"select-option\"\n [value]=\"getDisplayName(judicial)\" (onSelectionChange)=\"onSelectionChange(judicial)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(judicial) }}\n </mat-option>\n <mat-option class=\"select-option\"\n *ngIf=\"!displayedJudicialsDuplicationFiltered?.length && showAutocomplete && !searchInProgress\">\n {{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n</div>\n",
2661
- styles: [".hide-autocomplete{display:none}.mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}"]
2662
- },] }
2663
- ];
2664
- SearchJudicialsComponent.ctorParameters = () => [
2665
- { type: FindAPersonService },
2666
- { type: FormBuilder }
2667
- ];
2668
- SearchJudicialsComponent.propDecorators = {
2669
- control: [{ type: Input }],
2670
- disabled: [{ type: Input }],
2671
- selectedJudicials: [{ type: Input }],
2672
- submitted: [{ type: Input }],
2673
- placeholderContent: [{ type: Input }],
2674
- showAutocomplete: [{ type: Input }],
2675
- displayedJudicials: [{ type: Input }],
2676
- judicialChanged: [{ type: Output }],
2677
- idValue: [{ type: Input }],
2678
- errorMessage: [{ type: Input }],
2679
- serviceId: [{ type: Input }],
2680
- autoCompleteInputBox: [{ type: ViewChild, args: ['inputSelection', { read: ElementRef, static: true },] }]
2681
- };
2682
-
2683
- class FindPersonComponent {
2684
- constructor(findPersonService, cd) {
2685
- this.findPersonService = findPersonService;
2686
- this.cd = cd;
2687
- this.personSelected = new EventEmitter();
2688
- this.personFieldChanged = new EventEmitter();
2689
- this.boldTitle = 'Find the person';
2690
- this.subTitle = 'Type the name of the person and select them.';
2691
- this.domain = PersonRole.ALL;
2692
- this.findPersonGroup = new FormGroup({});
2693
- this.submitted = true;
2694
- this.userIncluded = false;
2695
- this.placeholderContent = '';
2696
- this.isNoResultsShown = true;
2697
- this.showUpdatedColor = false;
2698
- this.selectedPersons = [];
2699
- this.errorMessage = 'You must select a name';
2700
- this.idValue = '';
2701
- this.services = ['IA'];
2702
- this.disabled = null;
2703
- this.showAutocomplete = false;
2704
- this.filteredOptions = [];
2705
- this.minSearchCharacters = 2;
2706
- }
2707
- ngOnDestroy() {
2708
- if (this.sub) {
2709
- this.sub.unsubscribe();
2710
- }
2711
- }
2712
- ngOnInit() {
2713
- this.findPersonControl = new FormControl(this.selectedPerson);
2714
- this.findPersonGroup.addControl('findPersonControl', this.findPersonControl);
2715
- this.sub = this.findPersonControl.valueChanges.pipe(tap(() => this.showAutocomplete = false), tap(() => this.filteredOptions = []), debounceTime(300), tap((searchTerm) => typeof searchTerm === 'string' ? this.personSelected.emit(null) : void 0), filter((searchTerm) => searchTerm && searchTerm.length > this.minSearchCharacters), switchMap((searchTerm) => this.filter(searchTerm).pipe(tap(() => this.showAutocomplete = true), catchError(() => this.filteredOptions = [])))).subscribe((people) => {
2716
- this.filteredOptions = people;
2717
- this.cd.detectChanges();
2718
- });
2719
- }
2720
- filter(searchTerm) {
2721
- const findJudicialPeople = this.findPersonService.find({ searchTerm, userRole: this.domain, services: this.services, userIncluded: this.userIncluded, assignedUser: this.assignedUser });
2722
- const findCaseworkersOrAdmins = this.findPersonService.findCaseworkers({ searchTerm, userRole: this.domain, services: this.services, userIncluded: this.userIncluded, assignedUser: this.assignedUser });
2723
- if (searchTerm && searchTerm.length > this.minSearchCharacters) {
2724
- switch (this.domain) {
2725
- case PersonRole.JUDICIAL: {
2726
- return findJudicialPeople.pipe(map(persons => {
2727
- const ids = this.selectedPersons.map(({ id }) => id);
2728
- return persons.filter(({ id }) => !ids.includes(id));
2729
- }));
2730
- }
2731
- case PersonRole.ALL: {
2732
- return zip(findJudicialPeople, findCaseworkersOrAdmins).pipe(map(separatePeople => separatePeople[0].concat(separatePeople[1])));
2733
- }
2734
- case PersonRole.CASEWORKER:
2735
- case PersonRole.ADMIN: {
2736
- return findCaseworkersOrAdmins;
2737
- }
2738
- default: {
2739
- return of([]);
2740
- }
2741
- }
2742
- }
2743
- return of([]);
2744
- }
2745
- onSelectionChange(selectedPerson) {
2746
- this.personSelected.emit(selectedPerson);
2747
- this.findPersonControl.setValue(this.getDisplayName(selectedPerson), { emitEvent: false, onlySelf: true });
2748
- }
2749
- getDisplayName(selectedPerson) {
2750
- if (!selectedPerson) {
2751
- return '';
2752
- }
2753
- if (selectedPerson.domain === PersonRole.JUDICIAL && selectedPerson.fullName) {
2754
- return `${selectedPerson.fullName} (${selectedPerson.email})`;
2755
- }
2756
- return selectedPerson.email ? `${selectedPerson.name} (${selectedPerson.email})` : selectedPerson.name;
2757
- }
2758
- onInput() {
2759
- this.personFieldChanged.emit();
2760
- }
2761
- }
2762
- FindPersonComponent.decorators = [
2763
- { type: Component, args: [{
2764
- selector: 'xuilib-find-person',
2765
- template: "<h1 class=\"govuk-heading-l\" *ngIf=\"title && title.length\">\n <span class=\"govuk-caption-l\">{{title}}</span>\n {{boldTitle}}\n</h1>\n<div class=\"govuk-form-group\" [formGroup]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': findPersonGroup.get('findPersonControl').invalid && submitted}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"sub-title-hint\">\n <div id=\"sub-title-hint\" class=\"govuk-hint\" *ngIf=\"subTitle && subTitle.length\">\n {{subTitle}}\n </div>\n <span id=\"validation-error\" class=\"govuk-error-message\" *ngIf=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>{{findPersonGroup.errors.error ? findPersonGroup.errors.error : errorMessage}}\n </span>\n <input id=\"inputSelectPerson{{idValue}}\" type=\"text\" aria-label=\"select a person\"\n formControlName=\"findPersonControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n [placeholder]=\"placeholderContent\"\n [attr.disabled]=\"disabled\"\n (input)=\"onInput()\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" (optionSelected)=\"onSelectionChange($event.option.value)\">\n <mat-option *ngFor=\"let option of filteredOptions\"\n [value]=\"option\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete, 'select-option': showUpdatedColor}\">\n {{getDisplayName(option)}}\n </mat-option>\n <mat-option [ngClass]=\"{'select-option': showUpdatedColor}\" *ngIf=\"isNoResultsShown && !filteredOptions.length && showAutocomplete\">No results found</mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
2766
- styles: [".mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}.hide-autocomplete{display:none}"]
2767
- },] }
2768
- ];
2769
- FindPersonComponent.ctorParameters = () => [
2770
- { type: FindAPersonService },
2771
- { type: ChangeDetectorRef }
2772
- ];
2773
- FindPersonComponent.propDecorators = {
2774
- personSelected: [{ type: Output }],
2775
- personFieldChanged: [{ type: Output }],
2776
- title: [{ type: Input }],
2777
- boldTitle: [{ type: Input }],
2778
- subTitle: [{ type: Input }],
2779
- domain: [{ type: Input }],
2780
- findPersonGroup: [{ type: Input }],
2781
- selectedPerson: [{ type: Input }],
2782
- submitted: [{ type: Input }],
2783
- userIncluded: [{ type: Input }],
2784
- assignedUser: [{ type: Input }],
2785
- placeholderContent: [{ type: Input }],
2786
- isNoResultsShown: [{ type: Input }],
2787
- showUpdatedColor: [{ type: Input }],
2788
- selectedPersons: [{ type: Input }],
2789
- errorMessage: [{ type: Input }],
2790
- idValue: [{ type: Input }],
2791
- services: [{ type: Input }],
2792
- disabled: [{ type: Input }]
2793
- };
2794
-
2795
- /**
2796
- * Main Page Wrapper
2797
- * Responsible for:
2798
- * Wrapping content within the gov-uk html elements bellow
2799
- * @prop showBackLink - switch for back link
2800
- * @prop appHeaderTitle = appHeaderTitle
2801
- * @prop appFunctionalTitle = appFunctionalTitle
2802
- * @prop summaryErrors list of errors
2803
- * @prop back link, appHeaderTitle (appHeaderTitle), summaryErrors (array of errors)
2804
- */
2805
- class ExuiPageWrapperComponent {
2806
- constructor() { }
2807
- }
2808
- ExuiPageWrapperComponent.decorators = [
2809
- { type: Component, args: [{
2810
- selector: 'exui-page-wrapper',
2811
- template: "<div class=\"page\">\n <a *ngIf=\"backLink\" [routerLink]=\"backLink\" class=\"govuk-back-link\">Back</a>\n <div class=\"govuk-width-container\">\n <main id=\"content\" role=\"main\" class=\"govuk-main-wrapper\">\n <div class=\"govuk-grid-row\">\n <h1 *ngIf=\"title\" class=\"govuk-heading-xl\">\n <span *ngIf=\"fnTitle\" class=\"govuk-caption-xl\">{{fnTitle}}</span>\n {{title}}\n </h1>\n <ng-content>\n\n </ng-content>\n </div>\n </main>\n </div>\n</div>\n",
2812
- styles: [".page{width:100%}"]
2813
- },] }
2814
- ];
2815
- ExuiPageWrapperComponent.ctorParameters = () => [];
2816
- ExuiPageWrapperComponent.propDecorators = {
2817
- backLink: [{ type: Input }],
2818
- title: [{ type: Input }],
2819
- fnTitle: [{ type: Input }]
2820
- };
2821
-
2822
- class FeatureToggleDirective {
2823
- constructor(service, viewContainer, templateRef) {
2824
- this.service = service;
2825
- this.viewContainer = viewContainer;
2826
- this.templateRef = templateRef;
2827
- }
2828
- set xuilibFeatureToggle(feature) {
2829
- this.feature = feature;
2830
- this.updateSubscription();
2831
- }
2832
- ngOnDestroy() {
2833
- if (this.subscription) {
2834
- this.subscription.unsubscribe();
2835
- }
2836
- }
2837
- updateSubscription() {
2838
- this.subscription = this.service.isEnabled(this.feature).subscribe(enabled => {
2839
- if (enabled) {
2840
- this.viewContainer.createEmbeddedView(this.templateRef);
2841
- }
2842
- else {
2843
- this.viewContainer.clear();
2844
- }
2845
- });
2846
- }
2847
- }
2848
- FeatureToggleDirective.decorators = [
2849
- { type: Directive, args: [{
2850
- selector: '[xuilibFeatureToggle]'
2851
- },] }
2852
- ];
2853
- FeatureToggleDirective.ctorParameters = () => [
2854
- { type: FeatureToggleService },
2855
- { type: ViewContainerRef },
2856
- { type: TemplateRef }
2857
- ];
2858
- FeatureToggleDirective.propDecorators = {
2859
- xuilibFeatureToggle: [{ type: Input }]
2860
- };
2861
-
2862
- class LetContext {
2863
- constructor() {
2864
- this.$implicit = null;
2865
- this.xuilibLet = null;
2866
- }
2867
- }
2868
- class LetDirective {
2869
- constructor(viewContainer, templateRef) {
2870
- this.viewContainer = viewContainer;
2871
- this.context = new LetContext();
2872
- this.viewContainer.createEmbeddedView(templateRef, this.context);
2873
- }
2874
- set xuilibLet(condition) {
2875
- this.context.$implicit = this.context.xuilibLet = condition;
2876
- }
2877
- }
2878
- LetDirective.decorators = [
2879
- { type: Directive, args: [{
2880
- selector: '[xuilibLet]'
2881
- },] }
2882
- ];
2883
- LetDirective.ctorParameters = () => [
2884
- { type: ViewContainerRef },
2885
- { type: TemplateRef }
2886
- ];
2887
- LetDirective.propDecorators = {
2888
- xuilibLet: [{ type: Input }]
2889
- };
2890
-
2891
- class FindServiceComponent {
2892
- constructor() {
2893
- this.serviceTitle = 'Search for a service by name';
2894
- this.enableAddServiceButton = true;
2895
- this.disableInputField = false;
2896
- }
2897
- addService() {
2898
- // Todo
2899
- }
2900
- }
2901
- FindServiceComponent.decorators = [
2902
- { type: Component, args: [{
2903
- selector: 'xuilib-find-service',
2904
- template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div>\n <label id=\"input-selected-service-label\" *ngIf=\"serviceTitle\">{{serviceTitle}}</label>\n </div>\n <exui-search-service class=\"search-service\"\n [services]=\"services\"\n [selectedServices]=\"selectedServices\"\n [delay]=\"300\"\n [disabled]=\"disabled\"></exui-search-service>\n <a href=\"javascript:void(0)\" (click)=\"addService()\" class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n data-module=\"govuk-button\" *ngIf=\"enableAddServiceButton\" id=\"add-service\">\n Add\n </a>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"service-selection\" *ngFor=\"let selection of selectedServices\">\n <a class=\"hmcts-filter__tag\" href=\"javascript:void(0)\">\n {{ selection.name }}\n </a>\n </li>\n </ul>\n </div>\n",
2905
- styles: ["#add-service{background-color:#ddd}"]
2906
- },] }
2907
- ];
2908
- FindServiceComponent.propDecorators = {
2909
- field: [{ type: Input }],
2910
- fields: [{ type: Input }],
2911
- serviceTitle: [{ type: Input }],
2912
- form: [{ type: Input }],
2913
- services: [{ type: Input }],
2914
- selectedServices: [{ type: Input }],
2915
- disabled: [{ type: Input }],
2916
- enableAddServiceButton: [{ type: Input }],
2917
- disableInputField: [{ type: Input }]
2918
- };
2919
-
2920
- class SearchServiceComponent {
2921
- constructor() {
2922
- this.showAutocomplete = false;
2923
- this.minSearchCharacters = 3;
2924
- this.term = '';
2925
- }
2926
- onInput() {
2927
- // Todo
2928
- }
2929
- onSelectionChange() {
2930
- // Todo
2931
- }
2932
- }
2933
- SearchServiceComponent.decorators = [
2934
- { type: Component, args: [{
2935
- selector: 'exui-search-service',
2936
- template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputServiceSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form?.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchService\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchService=\"matAutocomplete\">\n <mat-option *ngFor=\"let service of services\" (onSelectionChange)=\"onSelectionChange()\">\n {{ service.name }}\n </mat-option>\n <mat-option *ngIf=\"!services?.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
2937
- styles: [".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{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}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:250px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
2938
- },] }
2939
- ];
2940
- SearchServiceComponent.propDecorators = {
2941
- services: [{ type: Input }],
2942
- selectedServices: [{ type: Input }],
2943
- disabled: [{ type: Input }],
2944
- delay: [{ type: Input }],
2945
- form: [{ type: Input }],
2946
- showAutocomplete: [{ type: Input }]
2947
- };
2948
-
2949
- /*
2950
- * Gov Uk Checkbox Dumb Component responsible for
2951
- * displaying checkbox input and hint
2952
- *
2953
- * */
2954
- class GovUkCheckboxComponent {
2955
- constructor() {
2956
- this.isChecked = false;
2957
- }
2958
- ngOnInit() {
2959
- const id = this.config.focusOn ? this.config.focusOn : this.config.value;
2960
- this.config.id = id;
2961
- this.config.classes = this.config.classes ?
2962
- this.config.classes.concat(' govuk-checkboxes__label') : 'govuk-checkboxes__label';
2963
- }
2964
- }
2965
- GovUkCheckboxComponent.decorators = [
2966
- { type: Component, args: [{
2967
- selector: 'xuilib-gov-checkbox',
2968
- template: "<div class=\"govuk-checkboxes__item\" [formGroup]=\"group\">\n <input class=\"govuk-checkboxes__input\" type=\"checkbox\" [attr.aria-describedby]=\"config.hint ? config.value+'-item-hint' : null\"\n [id]=\"config.id\" [name]=\"config.name\" [formControlName]=\"config.value\" [checked]=\"isChecked\">\n <xuilib-gov-label appRemoveHost [config]=\"config\"></xuilib-gov-label>\n <span [id]=\"config.value+'-item-hint'\" class=\"govuk-hint govuk-checkboxes__hint\">\n {{config.hint}}\n </span>\n</div>"
2969
- },] }
2970
- ];
2971
- GovUkCheckboxComponent.ctorParameters = () => [];
2972
- GovUkCheckboxComponent.propDecorators = {
2973
- group: [{ type: Input }],
2974
- config: [{ type: Input }],
2975
- isChecked: [{ type: Input }]
2976
- };
2977
-
2978
- /*
2979
- * CheckBox component - state less
2980
- * Responsible for displaying a list of gov-uk-checkboxes
2981
- * @param: options - object with data for wrapper (fieldset) and
2982
- * array of items for gov-uk-checkboxes
2983
- * @param: errors - array of error stings
2984
- * */
2985
- class GovUkCheckboxesComponent {
2986
- }
2987
- GovUkCheckboxesComponent.decorators = [
2988
- { type: Component, args: [{
2989
- selector: 'xuilib-gov-uk-checkboxes',
2990
- template: "<xuilib-gov-uk-form-group-wrapper\n[error]=\"errors\"\n[config]=\"options.config\"\n[group]=\"options.key\">\n<div class=\"govuk-checkboxes\">\n <xuilib-gov-checkbox *ngFor=\"let item of options.items\"\n [group]=\"item.group\"\n [config]=\"item.config\">\n </xuilib-gov-checkbox>\n</div>\n</xuilib-gov-uk-form-group-wrapper>"
2991
- },] }
2992
- ];
2993
- GovUkCheckboxesComponent.propDecorators = {
2994
- options: [{ type: Input }],
2995
- errors: [{ type: Input }]
2996
- };
2997
-
2998
- /*
2999
- * Gov UK Date Component
3000
- * Responsible for displaying 3 input fields:
3001
- * day / month / year
3002
- * displaying errorMessage messages
3003
- * */
3004
- class GovUkDateComponent {
3005
- constructor() {
3006
- this.isOptional = false;
3007
- }
3008
- ngOnInit() {
3009
- this.day = `${this.config.id}_day`;
3010
- this.month = `${this.config.id}_month`;
3011
- this.year = `${this.config.id}_year`;
3012
- const dateValidator = this.DateValidator();
3013
- this.formGroup.get(this.day).setValidators(dateValidator);
3014
- }
3015
- isValidDate(d, month, year) {
3016
- const dateCheck = !isNaN(d.getTime());
3017
- // Month mismatch occurs if the provided day or month are invalid, or either is omitted. **Note:** This is insufficient for
3018
- // checking date validity when the year is omitted because it defaults to 1900 - an extra check is required
3019
- const monthMatch = d.getMonth() === month;
3020
- const yearMatch = d.getFullYear() === year;
3021
- return dateCheck && monthMatch && yearMatch;
3022
- }
3023
- isEmpty(value) {
3024
- // Note: Intentional use of == to check for null or undefined
3025
- /* eslint-disable eqeqeq */
3026
- /* tslint:disable:triple-equals */
3027
- // NaN and < 0 checks required for month field
3028
- return value == null || value === '' || isNaN(value) || value < 0;
3029
- /* eslint-enable eqeqeq */
3030
- /* tslint:enable:triple-equals */
3031
- }
3032
- DateValidator() {
3033
- return () => {
3034
- const day = this.formGroup.get(this.day).value;
3035
- const month = this.formGroup.get(this.month).value - 1;
3036
- const year = this.formGroup.get(this.year).value;
3037
- // Validation should pass if the date field is optional and day, month, and year are all empty
3038
- if (this.isOptional && this.isEmpty(day) && this.isEmpty(month) && this.isEmpty(year)) {
3039
- return null;
3040
- }
3041
- // + to coerce year to a number
3042
- return !this.isValidDate(new Date(year, month, day), month, +year) ? { dateComponent: true } : null;
3043
- };
3044
- }
3045
- }
3046
- GovUkDateComponent.decorators = [
3047
- { type: Component, args: [{
3048
- selector: 'xuilib-gov-uk-date',
3049
- template: "<div class=\"govuk-form-group\" [ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\" [formGroup]=\"formGroup\">\n <div class=\"date-input-container\">\n <xuilib-gov-uk-fieldset\n [config]=\"{\n legend: config.label || 'Date component',\n classes: config.classes || 'govuk-label--m',\n id: config.id,\n hint: config.hint != null ? config.hint : 'For example, 12 11 2007',\n isPageHeading: config.isPageHeading || false}\"\n [errorMessage]=\"errorMessage\">\n <xuilib-gov-uk-error-message\n [config]=\"{id: 'passport'}\"\n *ngIf=\"errorMessage\"\n [errorMessage]=\"errorMessage\">\n </xuilib-gov-uk-error-message>\n <div class=\"govuk-date-input\" [id]=\"config.id+'-date'\">\n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <xuilib-gov-label\n [config]=\"{label: 'Day', name: config.id+'-day', id: config.id+'-day', classes: 'govuk-date-input__label'}\">\n </xuilib-gov-label>\n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\"\n [name]=\"config.id+'-day'\" type=\"number\" value=\"\" pattern=\"[0-9]*\"\n [formControlName]=\"config.id+'_day'\">\n </div>\n </div>\n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <xuilib-gov-label\n [config]=\"{label: 'Month', name: config.id+'-month', id: config.id+'-month', classes: 'govuk-date-input__label'}\">\n </xuilib-gov-label>\n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id+'-month'\"\n [name]=\"config.id+'-month'\" type=\"number\" value=\"\" pattern=\"[0-9]*\"\n [formControlName]=\"config.id+'_month'\">\n </div>\n </div>\n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <xuilib-gov-label\n [config]=\"{label: 'Year', name: config.id+'-year', id: config.id+'-year', classes: 'govuk-date-input__label'}\">\n </xuilib-gov-label>\n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id+'-year'\"\n [name]=\"config.id+'-year'\" type=\"number\" value=\"\" pattern=\"[0-9]*\"\n [formControlName]=\"config.id+'_year'\">\n </div>\n </div>\n </div>\n </xuilib-gov-uk-fieldset>\n </div>\n</div>\n",
3050
- styles: [".govuk-form-group .date-input-container{margin-bottom:30px}.govuk-form-group .date-input-container .govuk-date-input .govuk-date-input__item .govuk-form-group{margin-bottom:0}"]
3051
- },] }
3052
- ];
3053
- GovUkDateComponent.ctorParameters = () => [];
3054
- GovUkDateComponent.propDecorators = {
3055
- config: [{ type: Input }],
3056
- errorMessage: [{ type: Input }],
3057
- formGroup: [{ type: Input }],
3058
- isOptional: [{ type: Input }]
3059
- };
3060
-
3061
- /*
3062
- * Gov UK Error Message
3063
- * Responsible for displaying in-line error messages
3064
- * @prop config - obj with properties
3065
- * @prop errorMessage - all error bject with messages property that is arry of strings.
3066
- * */
3067
- class GovUkErrorMessageComponent {
3068
- constructor() { }
3069
- }
3070
- GovUkErrorMessageComponent.decorators = [
3071
- { type: Component, args: [{
3072
- selector: ' xuilib-gov-uk-error-message',
3073
- template: "<span class=\"govuk-error-message\" [id]=\"config.id + '-error'\" *ngFor=\"let message of errorMessage?.messages\">\n <span class=\"govuk-visually-hidden\">Error:</span>{{message}}\n</span>"
3074
- },] }
3075
- ];
3076
- GovUkErrorMessageComponent.ctorParameters = () => [];
3077
- GovUkErrorMessageComponent.propDecorators = {
3078
- config: [{ type: Input }],
3079
- errorMessage: [{ type: Input }]
3080
- };
3081
-
3082
- /*
3083
- * Helper Class
3084
- * Used for dynamic templates manipulation
3085
- * */
3086
- class HtmlTemplatesHelper {
3087
- /*
3088
- * Sets described by string depending if
3089
- * there is an error, error and hit or nothing
3090
- * */
3091
- static setDescribedBy(errorMessage, config) {
3092
- if (!errorMessage) {
3093
- return config.hint ? `${config.id}-hint` : null;
3094
- }
3095
- else if (errorMessage && errorMessage.isInvalid) {
3096
- return config.hint ? `${config.id}-hint ${config.id}-error` : `${config.id}-error`;
3097
- }
3098
- else {
3099
- return config.hint ? `${config.id}-hint` : null;
3100
- }
3101
- }
3102
- }
3103
-
3104
- /*
3105
- * Gov Uk Fieldset Component
3106
- * Used to wrap group fieldset elements
3107
- * it can conditionally display h1 tag
3108
- * @param config
3109
- * @param isHeading
3110
- * @param errorMessage - used for aria tag
3111
- * */
3112
- class GovUkFieldsetComponent {
3113
- constructor() { }
3114
- setDescribedBy() {
3115
- return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
3116
- }
3117
- }
3118
- GovUkFieldsetComponent.decorators = [
3119
- { type: Component, args: [{
3120
- selector: 'xuilib-gov-uk-fieldset',
3121
- template: "<fieldset class=\"govuk-fieldset\" [attr.aria-describedby]=\"setDescribedBy()\">\n <legend [class]=\"config.classes + ' govuk-fieldset__legend'\" *ngIf=\"!config.isPageHeading\">\n {{config.legend}}\n </legend>\n\n <legend [class]=\"config.classes + ' govuk-fieldset__legend'\" *ngIf=\"config.isPageHeading\">\n <h1>{{config.legend}}</h1>\n </legend>\n\n <span [id]=\"config.id+'-hint'\" class=\"govuk-hint\" *ngIf=\"config.hint\">\n {{config.hint}}\n </span>\n <ng-content></ng-content>\n</fieldset>"
3122
- },] }
3123
- ];
3124
- GovUkFieldsetComponent.ctorParameters = () => [];
3125
- GovUkFieldsetComponent.propDecorators = {
3126
- config: [{ type: Input }],
3127
- errorMessage: [{ type: Input }]
3128
- };
3129
-
3130
- /*
3131
- * Gov UK Input component
3132
- * Responsible for displaying input, hint and error messages
3133
- * @prop errorMessages - array of messages
3134
- * @prop focusOn - passing the FormGroup
3135
- * @prop config - adding configuration
3136
- * */
3137
- class GovUkFileUploadComponent {
3138
- constructor() {
3139
- // { label: string, hint: string; name: string; id: string, type: string; isPageHeading: boolean, classes: string };
3140
- this.reloadInput = true;
3141
- }
3142
- ngOnInit() {
3143
- this.config.classes = 'govuk-label--m';
3144
- }
3145
- setDescribedBy() {
3146
- return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
3147
- }
3148
- }
3149
- GovUkFileUploadComponent.decorators = [
3150
- { type: Component, args: [{
3151
- selector: 'xuilib-gov-uk-file-upload',
3152
- template: "<div class=\"govuk-form-group\" [formGroup]=\"group\"\n [ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n\n <xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n\n <span *ngIf=\"config.hint\" [id]=\"config.id +'-hint'\" class=\"govuk-hint\">\n {{config.hint}}\n </span>\n\n <xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n\n <input class=\"govuk-file-upload\"\n *ngIf=\"reloadInput\"\n [formControlName]=\"config.id\"\n [ngClass]=\"{'govuk-file-upload--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\" [name]=\"config.name\"\n [attr.aria-describedby]=\"setDescribedBy()\"\n type=\"file\">\n </div>"
3153
- },] }
3154
- ];
3155
- GovUkFileUploadComponent.ctorParameters = () => [];
3156
- GovUkFileUploadComponent.propDecorators = {
3157
- errorMessage: [{ type: Input }],
3158
- group: [{ type: Input }],
3159
- config: [{ type: Input }]
3160
- };
3161
-
3162
- /*
3163
- * Gov Uk Form Group Wrapper
3164
- * Used to wrap group form elements in html tags below such as
3165
- * gov-uk-checkboxes and radio buttons
3166
- * and errorMessage messages
3167
- * */
3168
- class GovUkFormGroupWrapperComponent {
3169
- constructor() { }
3170
- }
3171
- GovUkFormGroupWrapperComponent.decorators = [
3172
- { type: Component, args: [{
3173
- selector: 'xuilib-gov-uk-form-group-wrapper',
3174
- template: "<div class=\"govuk-form-group\" [attr.formGroupName]=\"group\" [ngClass]=\"{'govuk-form-group--error': (error?.isInvalid)}\">\n <xuilib-gov-uk-fieldset\n [config]=\"{legend: config.legend, classes: 'govuk-label--m', id: config.key, hint: config.hint, isPageHeading: config.isPageHeading}\"\n [errorMessage]=\"error\">\n\n <xuilib-gov-uk-error-message [config]=\"{id: group}\" [errorMessage]=\"error\"></xuilib-gov-uk-error-message>\n\n <ng-content></ng-content>\n\n </xuilib-gov-uk-fieldset>\n</div>"
3175
- },] }
3176
- ];
3177
- GovUkFormGroupWrapperComponent.ctorParameters = () => [];
3178
- GovUkFormGroupWrapperComponent.propDecorators = {
3179
- error: [{ type: Input }],
3180
- group: [{ type: Input }],
3181
- config: [{ type: Input }]
3182
- };
3183
-
3184
- /*
3185
- * Gov UK Input component
3186
- * Responsible for displaying input, hint and error messages
3187
- * @prop errorMessages - array of messages
3188
- * @prop focusOn - passing the FormGroup
3189
- * @prop config - adding configuration
3190
- * */
3191
- class GovUkInputComponent {
3192
- constructor() { }
3193
- // { label: string, hint: string; name: string; id: string, type: string; isPageHeading: boolean, classes: string };
3194
- ngOnInit() {
3195
- this.config.classes = 'govuk-label--m';
3196
- }
3197
- setDescribedBy() {
3198
- return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
3199
- }
3200
- }
3201
- GovUkInputComponent.decorators = [
3202
- { type: Component, args: [{
3203
- selector: 'xuilib-gov-uk-input',
3204
- template: "<div class=\"govuk-form-group gov-uk-input\" [formGroup]=\"group\"\n[ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n\n<span *ngIf=\"config.hint\" [id]=\"config.id +'-hint'\" class=\"govuk-hint\">\n {{config.hint}}\n</span>\n\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n\n<input class=\"govuk-input\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\"\n [name]=\"config.name\"\n [type]=\"config.type\"\n [attr.aria-invalid]=\"errorMessage?.isInvalid\"\n [formControlName]=\"config.name\"\n [attr.aria-describedby]='setDescribedBy()'>\n</div>\n",
3205
- styles: [".gov-uk-input input:disabled{background:#b1b4b6}"]
3206
- },] }
3207
- ];
3208
- GovUkInputComponent.ctorParameters = () => [];
3209
- GovUkInputComponent.propDecorators = {
3210
- errorMessage: [{ type: Input }],
3211
- group: [{ type: Input }],
3212
- config: [{ type: Input }]
3213
- };
3214
-
3215
- /*
3216
- * Gov UK Label component
3217
- * Responsible for displaying label tag
3218
- * @prop isPageHading - boolean to display h1
3219
- * @prop config - obj with properties
3220
- * */
3221
- class GovUkLabelComponent {
3222
- constructor() { }
3223
- }
3224
- GovUkLabelComponent.decorators = [
3225
- { type: Component, args: [{
3226
- selector: 'xuilib-gov-label',
3227
- template: "<h1 *ngIf=\"config.isPageHeading else noHeading\">\n <label *ngIf=\"config.label\" [class]=\"config.classes + ' govuk-label'\"\n [for]=\"config.id\" [innerHTML]=\"config.label\">\n </label>\n</h1>\n<ng-template #noHeading>\n <label *ngIf=\"config.label\" [class]=\"config.classes + ' govuk-label'\"\n [for]=\"config.id\" [innerHTML]=\"config.label\">\n </label>\n</ng-template>"
3228
- },] }
3229
- ];
3230
- GovUkLabelComponent.ctorParameters = () => [];
3231
- GovUkLabelComponent.propDecorators = {
3232
- config: [{ type: Input }]
3233
- };
3234
-
3235
- /*
3236
- * Gov Uk Radio state-less Component responsible for
3237
- * displaying radios input and hint
3238
- *
3239
- * */
3240
- class GovUkRadioComponent {
3241
- constructor() { }
3242
- /*
3243
- * ngOnInIt
3244
- * needed to manage the focus id if passed on in config
3245
- * si it can focus on element when user clicks on error message in the header.
3246
- **/
3247
- ngOnInit() {
3248
- const id = this.config.focusOn ? this.config.focusOn : this.config.value;
3249
- this.config.id = id;
3250
- this.config.classes = this.config.classes ?
3251
- this.config.classes.concat(' govuk-radios__label') : 'govuk-radios__label';
3252
- }
3253
- }
3254
- GovUkRadioComponent.decorators = [
3255
- { type: Component, args: [{
3256
- selector: 'xuilib-gov-radio',
3257
- template: "<div class=\"govuk-radios__item\" [formGroup]=\"group\">\n <input [className]=\"'govuk-radios__input ' + config.classes\"\n [id]=\"config.id\"\n [value]=\"config.value\" type=\"radio\"\n [attr.data-aria-controls]=\"config.id\"\n [name]=\"config.name\"\n [formControl]=\"group.controls[config.name]\">\n <xuilib-gov-label appRemoveHost [config]=\"config\"></xuilib-gov-label>\n</div>"
3258
- },] }
3259
- ];
3260
- GovUkRadioComponent.ctorParameters = () => [];
3261
- GovUkRadioComponent.propDecorators = {
3262
- group: [{ type: Input }],
3263
- config: [{ type: Input }]
3264
- };
3265
-
3266
- /*
3267
- * Radios component - state less
3268
- * Responsible for displaying a list of gov-uk-radio components
3269
- * @param: options - object with data for wrapper (fieldset) and
3270
- * array of items for gov-uk-checkboxes
3271
- * @param: errors - array of error stings
3272
- * */
3273
- class GovUkRadiosComponent {
3274
- }
3275
- GovUkRadiosComponent.decorators = [
3276
- { type: Component, args: [{
3277
- selector: 'xuilib-gov-uk-radios',
3278
- template: "<xuilib-gov-uk-form-group-wrapper\n[error]=\"errors\"\n[config]=\"options.config\"\n[group]=\"options.key\">\n<div class=\"govuk-radios\">\n <xuilib-gov-radio\n appRemoveHost\n *ngFor=\"let item of options.items\"\n [group]=\"options.group\"\n [config]=\"item.config\">\n </xuilib-gov-radio>\n</div>\n</xuilib-gov-uk-form-group-wrapper>"
3279
- },] }
3280
- ];
3281
- GovUkRadiosComponent.propDecorators = {
3282
- options: [{ type: Input }],
3283
- errors: [{ type: Input }]
3284
- };
3285
-
3286
- /*
3287
- * Gov Uk Select Dumb Component responsible for
3288
- * dropdown input.
3289
- * */
3290
- class GovUkSelectComponent {
3291
- constructor() { }
3292
- setDescribedBy() {
3293
- return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
3294
- }
3295
- }
3296
- GovUkSelectComponent.decorators = [
3297
- { type: Component, args: [{
3298
- selector: 'xuilib-gov-select',
3299
- template: "<div class=\"govuk-form-group\" [formGroup]=\"group\"\n[ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n<span *ngIf=\"config.hint\" [id]=\"config.id +'-hint'\" class=\"govuk-hint\">\n {{config.hint}}\n</span>\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n\n<select class=\"govuk-select\" [id]=\"config.id\" [name]=\"config.id\" [formControlName]=\"config.id\" [attr.aria-describedby]='setDescribedBy()'>\n<option value=\"{{item.value}}\" *ngFor=\"let item of items\">{{item.label}}</option>\n</select>\n</div>"
3300
- },] }
3301
- ];
3302
- GovUkSelectComponent.ctorParameters = () => [];
3303
- GovUkSelectComponent.propDecorators = {
3304
- errorMessage: [{ type: Input }],
3305
- group: [{ type: Input }],
3306
- config: [{ type: Input }],
3307
- items: [{ type: Input }]
3308
- };
3309
-
3310
- class GovukTableComponent {
3311
- constructor() {
3312
- this.classes = '';
3313
- this.caption = 'Dates and amounts';
3314
- this.firstCellIsHeader = true;
3315
- this.columnConfig = [
3316
- { header: 'Date', key: 'date', type: 'text' },
3317
- { header: 'Amount', key: 'amount' }
3318
- ];
3319
- }
3320
- formatDate(date) {
3321
- return formatDate(date, 'dd/MM/yyyy', 'en-UK');
3322
- }
3323
- }
3324
- GovukTableComponent.decorators = [
3325
- { type: Component, args: [{
3326
- selector: 'xuilib-gov-uk-table',
3327
- template: "<table class=\"{{'govuk-table ' + classes}}\">\n <caption class=\"govuk-table__caption\">{{caption}}</caption>\n <thead class=\"govuk-table__head\" >\n <tr class=\"govuk-table__row\">\n <th class=\"govuk-table__header\" scope=\"col\" *ngFor=\"let h of columnConfig\">{{h.header}}</th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr data-selector=\"table-row\" class=\"govuk-table__row\" *ngFor=\"let r of rows\">\n <ng-container *ngFor=\"let col of columnConfig; first as isFirst\">\n <th data-selector=\"table-header\" class=\"govuk-table__header\" scope=\"row\" *ngIf=\"isFirst && firstCellIsHeader\">\n <ng-container *ngIf=\"!col.type || col.type === 'text' || !r.routerLink\">{{r[col.key]}}</ng-container>\n <ng-container *ngIf=\"col.type === 'link' && r.routerLink\">\n <a class=\"govuk-link\" [routerLink]=\"r.routerLink\">{{r[col.key]}}</a>\n </ng-container>\n </th>\n <td data-selector=\"table-cell\" class=\"govuk-table__cell\" *ngIf=\"!(isFirst && firstCellIsHeader)\">\n <ng-container *ngIf=\"col.type === 'date'\">{{formatDate(r[col.key])}}</ng-container>\n <ng-container *ngIf=\"!col.type || col.type === 'text' || !r.routerLink\">{{r[col.key]}}</ng-container>\n <ng-container *ngIf=\"col.type === 'link' && r.routerLink\">\n <a class=\"govuk-link\" [routerLink]=\"r.routerLink\">{{r[col.key]}}</a>\n </ng-container>\n </td>\n </ng-container>\n </tr>\n </tbody>\n</table>\n",
3328
- styles: [""]
3329
- },] }
3330
- ];
3331
- GovukTableComponent.ctorParameters = () => [];
3332
- GovukTableComponent.propDecorators = {
3333
- classes: [{ type: Input }],
3334
- caption: [{ type: Input }],
3335
- firstCellIsHeader: [{ type: Input }],
3336
- rows: [{ type: Input }],
3337
- columnConfig: [{ type: Input }]
3338
- };
3339
- class GovukTableColumnConfig {
3340
- constructor() {
3341
- this.header = '';
3342
- this.key = '';
3343
- this.type = 'text';
3344
- }
3345
- }
3346
-
3347
- /*
3348
- * CheckBox component - state less
3349
- * Responsible for displaying a list of gov-uk-checkboxes
3350
- * @param: options - object with data for wrapper (fieldset) and
3351
- * array of items for gov-uk-checkboxes
3352
- * @param: errors - array of errorMessage
3353
- * */
3354
- class GovUkTextareaComponent {
3355
- setDescribedBy() {
3356
- return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
3357
- }
3358
- }
3359
- GovUkTextareaComponent.decorators = [
3360
- { type: Component, args: [{
3361
- selector: 'xuilib-gov-uk-textarea',
3362
- template: "<div [formGroup]=\"group\" \nclass=\"govuk-form-group\" [ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\">\n<xuilib-gov-label [config]=\"config\"></xuilib-gov-label>\n<span id=\"more-detail-hint\" class=\"govuk-hint\">\n {{config.hint}}\n</span>\n<xuilib-gov-uk-error-message [config]=\"config\" [errorMessage]=\"errorMessage\"></xuilib-gov-uk-error-message>\n<textarea\n class=\"govuk-textarea\" [formControlName]=\"config.key\"\n [ngClass]=\"{'govuk-textarea--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\" name=\"more-detail\" [rows]=\"config.rows\" [attr.aria-describedby]=\"setDescribedBy()\"></textarea>\n</div>"
3363
- },] }
3364
- ];
3365
- GovUkTextareaComponent.propDecorators = {
3366
- config: [{ type: Input }],
3367
- errorMessage: [{ type: Input }],
3368
- group: [{ type: Input }]
3369
- };
3370
-
3371
- /*
3372
- * Hmcts Banner
3373
- * Responsible for displaying prominent message and related actions
3374
- * @prop message to display
3375
- * @prop type
3376
- * */
3377
- class HmctsBannerComponent {
3378
- constructor() { }
3379
- }
3380
- HmctsBannerComponent.decorators = [
3381
- { type: Component, args: [{
3382
- selector: 'xuilib-hmcts-banner',
3383
- template: "<div class=\"hmcts-banner hmcts-banner--{{type}}\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" /></svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">{{type}}</span>\n {{message}}\n </div>\n</div>",
3384
- styles: [":host{display:block;width:100%}"]
3385
- },] }
3386
- ];
3387
- HmctsBannerComponent.ctorParameters = () => [];
3388
- HmctsBannerComponent.propDecorators = {
3389
- type: [{ type: Input }],
3390
- message: [{ type: Input }]
3391
- };
3392
-
3393
- /*
3394
- Error Summary component
3395
- State Less component
3396
- @property errorMessages that is array of messages.
3397
- Component is also responsible for scrolling. Up and Down the page when user click on links
3398
- */
3399
- class HmctsErrorSummaryComponent {
3400
- constructor(document) {
3401
- this.document = document;
3402
- }
3403
- set errorMessages(value) {
3404
- this.messages = value;
3405
- }
3406
- ngAfterViewInit() {
3407
- this.scrollTo('errorSummary');
3408
- }
3409
- ngOnChanges(changes) {
3410
- if (changes.errorMessages) {
3411
- this.scrollTo('errorSummary');
3412
- }
3413
- }
3414
- scrollTo(selector) {
3415
- if (this.document.querySelector(`#${selector}`)) {
3416
- const el = this.document.querySelector(`#${selector}`);
3417
- el.focus();
3418
- }
3419
- }
3420
- hasElement(selector) {
3421
- return this.document.querySelector(`#${selector}`);
3422
- }
3423
- }
3424
- HmctsErrorSummaryComponent.decorators = [
3425
- { type: Component, args: [{
3426
- selector: 'xuilib-hmcts-error-summary',
3427
- template: "<div *ngIf=\"!showWarningMessage && messages && messages.length > 0\" id=\"errorSummary\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\"\n data-module=\"error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{header}}\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let message of messages\">\n <a (click)=\"scrollTo(message['id'])\" [routerLink]=\"\" [fragment]=\"message['id']\"\n *ngIf=\"hasElement(message['id'])\">{{message['message']}}</a>\n <span *ngIf=\"!hasElement(message['id'])\">{{message['message']}}</span>\n </li>\n </ul>\n </div>\n</div>\n<div *ngIf=\"showWarningMessage\" class=\"hmcts-banner hmcts-banner--warning\">\n <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"25\" width=\"25\">\n <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\" /></svg>\n <div class=\"hmcts-banner__message\">\n <span class=\"hmcts-banner__assistive\">Warning</span>\n <p class=\"govuk-body\" *ngFor=\"let message of messages\">{{ message['message'] }}</p>\n </div>\n</div>"
3428
- },] }
3429
- ];
3430
- HmctsErrorSummaryComponent.ctorParameters = () => [
3431
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
3432
- ];
3433
- HmctsErrorSummaryComponent.propDecorators = {
3434
- errorMessages: [{ type: Input }],
3435
- header: [{ type: Input }],
3436
- showWarningMessage: [{ type: Input }]
3437
- };
3438
-
3439
- class HmctsIdentityBarComponent {
3440
- constructor() { }
3441
- set content(value) {
3442
- this.value = value.name;
3443
- }
3444
- }
3445
- HmctsIdentityBarComponent.decorators = [
3446
- { type: Component, args: [{
3447
- selector: 'xuilib-hmcts-identity-bar',
3448
- template: "<div class=\"hmcts-identity-bar\" *ngIf=\"value\">\n\n <div class=\"hmcts-identity-bar__container\">\n\n <div class=\"hmcts-identity-bar__details\">\n \n <span class=\"hmcts-identity-bar__title\">{{value}}</span>\n \n </div> \n\n </div>\n\n</div>",
3449
- styles: [""]
3450
- },] }
3451
- ];
3452
- HmctsIdentityBarComponent.ctorParameters = () => [];
3453
- HmctsIdentityBarComponent.propDecorators = {
3454
- content: [{ type: Input }]
3455
- };
3456
-
3457
- /*
3458
- * Main Content wrapper
3459
- * Responsible for:
3460
- * Wrapping content within the gov-uk html elements bellow
3461
- * @prop showBackLink - switch for back link
3462
- * @prop title = title
3463
- * @prop summaryErrors list of errors
3464
- * @prop back link, title (title), summaryErrors (array of errors)
3465
- * */
3466
- class HmctsMainWrapperComponent {
3467
- constructor() {
3468
- this.backEvent = new EventEmitter();
3469
- }
3470
- set banner(value) {
3471
- this.bannerData = value;
3472
- }
3473
- ngOnInit() {
3474
- this.hasBackLink = this.backLink !== undefined || this.backEvent.observers.length > 0;
3475
- }
3476
- onGoBack() {
3477
- this.backEvent.emit();
3478
- }
3479
- }
3480
- HmctsMainWrapperComponent.decorators = [
3481
- { type: Component, args: [{
3482
- selector: 'xuilib-hmcts-main-wrapper',
3483
- template: "<a *ngIf=\"hasBackLink\" [routerLink]=\"backLink\" (click)=\"onGoBack()\" class=\"govuk-back-link\">Back</a>\n<main id=\"content\" role=\"main\" class=\"govuk-main-wrapper\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-two-thirds\">\n <xuilib-hmcts-error-summary\n *ngIf=\"summaryErrors && !summaryErrors.isFromValid\"\n [errorMessages]=\"summaryErrors.items\"\n [header]=\"summaryErrors.header\"\n [showWarningMessage]=\"showWarningMessage\">\n </xuilib-hmcts-error-summary>\n <xuilib-hmcts-banner *ngIf=\"bannerData\" [message]=\"bannerData.message\" [type]=\"bannerData.type\"></xuilib-hmcts-banner>\n <h1 *ngIf=\"title\" class=\"govuk-heading-xl\">{{title}}</h1>\n <ng-content></ng-content>\n </div>\n <div class=\"govuk-grid-column-one-third\" *ngIf=\"actionButtons?.length > 0\">\n <div class=\"hmcts-page-heading__actions-wrapper\">\n <a\n *ngFor=\"let actionButton of actionButtons\"\n (click)=\"actionButton.action()\"\n role=\"button\"\n draggable=\"false\"\n class=\"govuk-button {{ actionButton.class }}\"\n >{{ actionButton.name }}</a>\n </div>\n </div>\n </div>\n</main>\n"
3484
- },] }
3485
- ];
3486
- HmctsMainWrapperComponent.ctorParameters = () => [];
3487
- HmctsMainWrapperComponent.propDecorators = {
3488
- backLink: [{ type: Input }],
3489
- title: [{ type: Input }],
3490
- summaryErrors: [{ type: Input }],
3491
- banner: [{ type: Input }],
3492
- actionButtons: [{ type: Input }],
3493
- showWarningMessage: [{ type: Input }],
3494
- backEvent: [{ type: Output }]
3495
- };
3496
-
3497
- class HmctsPaginationComponent {
3498
- constructor() {
3499
- this.maxSize = 7;
3500
- this.pageSize = 10;
3501
- this.showPageNumbers = true;
3502
- this.showResultCount = true;
3503
- this.pageChange = new EventEmitter();
3504
- this.pageBoundsCorrection = new EventEmitter();
3505
- }
3506
- }
3507
- HmctsPaginationComponent.decorators = [
3508
- { type: Component, args: [{
3509
- selector: 'xuilib-hmcts-pagination',
3510
- template: "<pagination-template #p=\"paginationApi\" [id]=\"id\" [maxSize]=\"maxSize\" (pageChange)=\"pageChange.emit($event)\"\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\">\n\n <nav class=\"hmcts-pagination\" id=\"pagination-label\">\n <p class=\"govuk-visually-hidden\" aria-labelledby=\"pagination-label\">Pagination navigation</p>\n <ul class=\"hmcts-pagination__list\" *ngIf=\"!(p.pages.length <= 1)\">\n\n <li class=\"hmcts-pagination__item hmcts-pagination__item--prev\" [class.disabled]=\"p.isFirstPage()\">\n <a [routerLink]=\"\" class=\"hmcts-pagination__link\" *ngIf=\"1 < p.getCurrent()\" (keyup.enter)=\"p.previous()\"\n (click)=\"p.previous()\">Previous <span class=\"govuk-visually-hidden\">set of pages</span></a>\n </li>\n\n <ng-container *ngIf=\"showPageNumbers\">\n <li class=\"hmcts-pagination__item\" [class.hmcts-pagination__item--active]=\"p.getCurrent() === page.value\"\n [class.hmcts-pagination__item--dots]=\"page.label === '...'\" *ngFor=\"let page of p.pages\">\n <a class=\"hmcts-pagination__link\" [routerLink]=\"\" (keyup.enter)=\"p.setCurrent(page.value)\"\n (click)=\"p.setCurrent(page.value)\" *ngIf=\"p.getCurrent() !== page.value\">\n <span class=\"govuk-visually-hidden\">page </span>\n <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span>\n </a>\n <ng-container *ngIf=\"p.getCurrent() === page.value\">\n <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span>\n </ng-container>\n </li>\n </ng-container>\n\n <li class=\"hmcts-pagination__item hmcts-pagination__item--next\" [class.disabled]=\"p.isLastPage()\">\n <a [routerLink]=\"\" class=\"hmcts-pagination__link\" *ngIf=\"!p.isLastPage()\" (keyup.enter)=\"p.next()\"\n (click)=\"p.next()\">Next<span class=\"govuk-visually-hidden\"> page</span></a>\n </li>\n\n </ul>\n <p class=\"hmcts-pagination__results\" *ngIf=\"showResultCount\">Showing <b>{{(p.getCurrent() * pageSize) - pageSize + 1}}</b>\n to <b>{{ p.getCurrent() * pageSize > p.getTotalItems() ? p.getTotalItems() : p.getCurrent() *\n pageSize}}</b> of <b>{{p.getTotalItems()}}</b> results</p>\n </nav>\n\n</pagination-template>",
3511
- styles: [".hmcts-pagination__results{float:right}"]
3512
- },] }
3513
- ];
3514
- HmctsPaginationComponent.propDecorators = {
3515
- id: [{ type: Input }],
3516
- maxSize: [{ type: Input }],
3517
- pageSize: [{ type: Input }],
3518
- showPageNumbers: [{ type: Input }],
3519
- showResultCount: [{ type: Input }],
3520
- pageChange: [{ type: Output }],
3521
- pageBoundsCorrection: [{ type: Output }]
3522
- };
3523
-
3524
- class HmctsPrimaryNavigationComponent {
3525
- constructor() {
3526
- }
3527
- set userLoggedIn(value) {
3528
- this.isUserLoggedIn = value;
3529
- }
3530
- }
3531
- HmctsPrimaryNavigationComponent.decorators = [
3532
- { type: Component, args: [{
3533
- selector: 'xuilib-hmcts-primary-navigation',
3534
- template: "<nav *ngIf=\"isUserLoggedIn\" class=\"hmcts-primary-navigation\" [attr.aria-label]=\"label\">\n <div class=\"hmcts-primary-navigation__container\">\n <div class=\"govuk-header__logo\" *ngIf=\"isBrandedHeader\"></div>\n <ul class=\"hmcts-primary-navigation__list\">\n <li class=\"hmcts-primary-navigation__item\" *ngFor=\"let item of items\">\n <a class=\"hmcts-primary-navigation__link\" [attr.aria-current]=\"item.active ? true: null\" [routerLink]=\"item.href\" [innerHTML]=\"item.text\"></a>\n </li>\n </ul>\n </div>\n</nav>\n",
3535
- styles: [""]
3536
- },] }
3537
- ];
3538
- HmctsPrimaryNavigationComponent.ctorParameters = () => [];
3539
- HmctsPrimaryNavigationComponent.propDecorators = {
3540
- userLoggedIn: [{ type: Input }],
3541
- label: [{ type: Input }],
3542
- items: [{ type: Input }],
3543
- isBrandedHeader: [{ type: Input }]
3544
- };
3545
-
3546
- class HmctsSubNavigationComponent {
3547
- }
3548
- HmctsSubNavigationComponent.decorators = [
3549
- { type: Component, args: [{
3550
- selector: 'xuilib-hmcts-sub-navigation',
3551
- template: "<nav class=\"hmcts-sub-navigation\" attr.aria-label=\"{{label}}\" role=\"navigation\" *ngIf=\"items\">\n <ul class=\"hmcts-sub-navigation__list\">\n <li class=\"hmcts-sub-navigation__item\" *ngFor=\"let item of items\">\n <a data-selector=\"sub-nav-link\" class=\"hmcts-sub-navigation__link\" [routerLink]=\"item.href\"\n [attr.aria-current]=\"item.active ? 'page' : null\">\n {{item.text}}\n\n <span *ngIf=\"item.roundel && item.roundel > 0 \" class=\"xui-alert-link__number\"> {{item.roundel}} </span>\n </a>\n </li>\n </ul>\n</nav>\n",
3552
- styles: [".xui-alert-link__number{font-family:nta,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;font-size:14px;font-size:.875rem;line-height:1.78571;border-radius:50%;background-color:#1d70b8;color:#fff;font-weight:700;width:25px;height:25px;margin-left:5px;text-align:center;display:inline-block;text-decoration:none}"]
3553
- },] }
3554
- ];
3555
- HmctsSubNavigationComponent.propDecorators = {
3556
- label: [{ type: Input }],
3557
- items: [{ type: Input }]
3558
- };
3559
-
3560
- /*
3561
- * Remove Host Directive
3562
- * Used to remove native angular host tags tags
3563
- * sometimes needed because of CSS dependencies
3564
- * */
3565
- class RemoveHostDirective {
3566
- constructor(el) {
3567
- this.el = el;
3568
- }
3569
- ngOnInit() {
3570
- const nativeElement = this.el.nativeElement;
3571
- const parentElement = nativeElement.parentElement;
3572
- // move all children out of the element
3573
- while (nativeElement.firstChild) {
3574
- parentElement.insertBefore(nativeElement.firstChild, nativeElement);
3575
- }
3576
- parentElement.removeChild(nativeElement);
3577
- }
3578
- }
3579
- RemoveHostDirective.decorators = [
3580
- { type: Directive, args: [{
3581
- selector: '[appRemoveHost]'
3582
- },] }
3583
- ];
3584
- RemoveHostDirective.ctorParameters = () => [
3585
- { type: ElementRef }
3586
- ];
3587
-
3588
- const COMMON_COMPONENTS = [
3589
- ExuiPageWrapperComponent,
3590
- TermsAndConditionsComponent,
3591
- TcDisplayHtmlComponent,
3592
- TcDisplayPlainComponent,
3593
- TcConfirmComponent,
3594
- ContactDetailsComponent,
3595
- FeatureToggleDirective,
3596
- LetDirective,
3597
- HmctsSessionDialogComponent,
3598
- UserListComponent,
3599
- UserDetailsComponent,
3600
- InviteUserPermissionComponent,
3601
- InviteUserFormComponent,
3602
- ShareCaseComponent,
3603
- ShareCaseConfirmComponent,
3604
- SelectedCaseListComponent,
3605
- SelectedCaseComponent,
3606
- SelectedCaseConfirmComponent,
3607
- UserSelectComponent,
3608
- TabComponent,
3609
- AccessibilityComponent,
3610
- DueDateComponent,
3611
- CheckboxListComponent,
3612
- ServiceMessageComponent,
3613
- ServiceMessagesComponent,
3614
- LoadingSpinnerComponent,
3615
- GenericFilterComponent,
3616
- CookieBannerComponent,
3617
- FindPersonComponent,
3618
- SearchJudicialsComponent,
3619
- FindLocationComponent,
3620
- SearchLocationComponent,
3621
- FindServiceComponent,
3622
- SearchServiceComponent,
3623
- SearchVenueComponent,
3624
- PaginationComponent
3625
- ];
3626
- const GOV_UI_COMPONENTS = [
3627
- HmctsIdentityBarComponent,
3628
- HmctsPaginationComponent,
3629
- HmctsSubNavigationComponent,
3630
- HmctsPrimaryNavigationComponent,
3631
- HmctsErrorSummaryComponent,
3632
- HmctsMainWrapperComponent,
3633
- HmctsBannerComponent,
3634
- GovukTableComponent,
3635
- GovUkInputComponent,
3636
- GovUkCheckboxComponent,
3637
- GovUkFormGroupWrapperComponent,
3638
- GovUkLabelComponent,
3639
- GovUkErrorMessageComponent,
3640
- GovUkFieldsetComponent,
3641
- GovUkDateComponent,
3642
- GovUkCheckboxesComponent,
3643
- GovUkRadioComponent,
3644
- GovUkRadiosComponent,
3645
- GovUkSelectComponent,
3646
- GovUkTextareaComponent,
3647
- GovUkFileUploadComponent,
3648
- RemoveHostDirective
3649
- ];
3650
- const ɵ0 = windowProvider;
3651
- class ExuiCommonLibModule {
3652
- }
3653
- ExuiCommonLibModule.decorators = [
3654
- { type: NgModule, args: [{
3655
- declarations: [
3656
- ...COMMON_COMPONENTS,
3657
- ...GOV_UI_COMPONENTS
3658
- ],
3659
- imports: [
3660
- CommonModule,
3661
- FormsModule,
3662
- ReactiveFormsModule,
3663
- RouterModule.forChild([]),
3664
- MatAutocompleteModule,
3665
- MatTabsModule,
3666
- MatInputModule,
3667
- NgxPaginationModule
3668
- ],
3669
- providers: [
3670
- { provide: windowToken, useFactory: ɵ0 }
3671
- ],
3672
- exports: [
3673
- ...COMMON_COMPONENTS,
3674
- ...GOV_UI_COMPONENTS,
3675
- PaginatePipe
3676
- ]
3677
- },] }
3678
- ];
3679
-
3680
- class GovUiService {
3681
- constructor() { }
3682
- }
3683
- GovUiService.ɵprov = i0.ɵɵdefineInjectable({ factory: function GovUiService_Factory() { return new GovUiService(); }, token: GovUiService, providedIn: "root" });
3684
- GovUiService.decorators = [
3685
- { type: Injectable, args: [{
3686
- providedIn: 'root'
3687
- },] }
3688
- ];
3689
- GovUiService.ctorParameters = () => [];
3690
-
3691
- function checkboxesBeCheckedValidator(minRequired = 1) {
3692
- return function validate(formGroup) {
3693
- let checked = 0;
3694
- Object.keys(formGroup.controls).forEach(key => {
3695
- const control = formGroup.controls[key];
3696
- if (control.value === true) {
3697
- checked++;
3698
- }
3699
- });
3700
- if (checked < minRequired) {
3701
- return {
3702
- requireOneCheckboxToBeChecked: true,
3703
- };
3704
- }
3705
- return null;
3706
- };
3707
- }
3708
-
3709
- function dateValidator() {
3710
- return function validate(formGroup) {
3711
- const d = new Date(parseInt(formGroup.controls.day.value, 10), parseInt(formGroup.controls.month.value, 10) - 1, parseInt(formGroup.controls.year.value, 10) - 1);
3712
- function isValidDate(val) {
3713
- return val instanceof Date && !isNaN(+d);
3714
- }
3715
- if (!isValidDate(d)) {
3716
- return {
3717
- dateIsInvalid: true,
3718
- };
3719
- }
3720
- return null;
3721
- };
3722
- }
3723
-
3724
- function radioGroupValidator() {
3725
- return function validate(formGroup) {
3726
- if (formGroup.controls) {
3727
- for (const control in formGroup.controls) {
3728
- if (!formGroup.controls[control].valid) {
3729
- return {
3730
- isRadioGroupInvalid: true,
3731
- };
3732
- }
3733
- }
3734
- }
3735
- return null;
3736
- };
3737
- }
3738
-
3739
- /*
3740
- * Public API Surface of gov-ui
3741
- */
3742
-
3743
- /*
3744
- * Public API Surface of gov-ui
3745
- */
3746
-
3747
- class FeatureToggleGuard {
3748
- constructor(featureToggleService, router) {
3749
- this.featureToggleService = featureToggleService;
3750
- this.router = router;
3751
- }
3752
- /**
3753
- * Usage: Add the FeatureToggleGuard as the Guard for a route, and provide the following
3754
- * in the data array for the route:
3755
- * - needsFeaturesEnabled: An array of feature keys that need to be enabled for this route
3756
- * - featureDisabledRedirect: the URL to redirect to when the this route is not accessible due to disabled features
3757
- * @param route Automatically provided by Angular
3758
- */
3759
- canActivate(route) {
3760
- return combineLatest(...route.data.needsFeaturesEnabled.map(feature => this.featureToggleService.getValueOnce(feature, false))).pipe(map(featureStatuses => featureStatuses.every(status => status)), map(status => status || this.router.parseUrl(route.data.featureDisabledRedirect)));
3761
- }
3762
- }
3763
- FeatureToggleGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function FeatureToggleGuard_Factory() { return new FeatureToggleGuard(i0.ɵɵinject(FeatureToggleService), i0.ɵɵinject(i1$1.Router)); }, token: FeatureToggleGuard, providedIn: "root" });
3764
- FeatureToggleGuard.decorators = [
3765
- { type: Injectable, args: [{
3766
- providedIn: 'root'
3767
- },] }
3768
- ];
3769
- FeatureToggleGuard.ctorParameters = () => [
3770
- { type: FeatureToggleService },
3771
- { type: Router }
3772
- ];
3773
-
3774
- class LaunchDarklyService {
3775
- constructor() {
3776
- this.ready = new BehaviorSubject(false);
3777
- this.features = {};
3778
- this.user = { anonymous: true };
3779
- this.clientId = '';
3780
- }
3781
- initialize(user = { anonymous: true }, clientId) {
3782
- this.ready.next(false);
3783
- this.user = user;
3784
- this.clientId = clientId;
3785
- this.client = LDClient.initialize(this.clientId, this.user, {});
3786
- this.client.on('ready', () => {
3787
- this.client.identify(this.user).then(() => this.ready.next(true));
3788
- });
3789
- }
3790
- isEnabled(feature) {
3791
- return this.getValue(feature, false);
3792
- }
3793
- getArray(feature) {
3794
- return this.getValue(feature, []);
3795
- }
3796
- getValue(feature, defaultValue) {
3797
- if (!this.features.hasOwnProperty(feature)) {
3798
- this.features[feature] = new BehaviorSubject(defaultValue);
3799
- this.ready.pipe(filter(ready => ready), map(() => this.client.variation(feature, defaultValue))).subscribe(value => {
3800
- this.features[feature].next(value);
3801
- this.client.on(`change:${feature}`, (val) => {
3802
- this.features[feature].next(val);
3803
- });
3804
- });
3805
- }
3806
- return this.features[feature].pipe(distinctUntilChanged());
3807
- }
3808
- /**
3809
- * This method returns an observable that will only get the state of the feature toggle
3810
- * once. It calls the LD SDK directly, and should only be used in circumstances where
3811
- * only one value should be emitted, that value coming directly from LD. This will likely
3812
- * only apply for Guards, and should be used only when absolutely necessary.
3813
- * @see getValue for regular usage.
3814
- * @param feature string
3815
- * @param defaultValue R
3816
- */
3817
- getValueOnce(feature, defaultValue) {
3818
- return this.ready.pipe(filter(ready => ready), map(() => this.client.variation(feature, defaultValue)));
3819
- }
3820
- }
3821
- LaunchDarklyService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LaunchDarklyService_Factory() { return new LaunchDarklyService(); }, token: LaunchDarklyService, providedIn: "root" });
3822
- LaunchDarklyService.decorators = [
3823
- { type: Injectable, args: [{
3824
- providedIn: 'root'
3825
- },] }
3826
- ];
3827
-
3828
- class GoogleAnalyticsService {
3829
- constructor(router, title, window, document) {
3830
- this.router = router;
3831
- this.title = title;
3832
- this.window = window;
3833
- this.document = document;
3834
- }
3835
- init(googleAnalyticsKey) {
3836
- this.googleAnalyticsKey = googleAnalyticsKey;
3837
- try {
3838
- const script1 = this.document.createElement('script');
3839
- script1.async = true;
3840
- script1.src = `https://www.googletagmanager.com/gtag/js?id=${this.googleAnalyticsKey}`;
3841
- this.document.head.appendChild(script1);
3842
- const script2 = this.document.createElement('script');
3843
- script2.innerHTML = `
3844
- window.dataLayer = window.dataLayer || [];
3845
- function gtag(){dataLayer.push(arguments);}
3846
- gtag('js', new Date());
3847
- gtag('config', '${this.googleAnalyticsKey}', {'send_page_view': false});
3848
- `;
3849
- this.document.head.appendChild(script2);
3850
- }
3851
- catch (ex) {
3852
- console.error('Error appending google analytics');
3853
- console.error(ex);
3854
- }
3855
- this.listenForRouteChanges();
3856
- }
3857
- listenForRouteChanges() {
3858
- if (this.googleAnalyticsKey) {
3859
- this.router.events.subscribe(event => {
3860
- if (event instanceof NavigationEnd) {
3861
- this.window.gtag('config', this.googleAnalyticsKey, {
3862
- page_path: event.urlAfterRedirects,
3863
- page_title: this.title.getTitle(),
3864
- });
3865
- }
3866
- });
3867
- }
3868
- }
3869
- event(eventName, params) {
3870
- this.window.gtag('event', eventName, params);
3871
- }
3872
- }
3873
- GoogleAnalyticsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function GoogleAnalyticsService_Factory() { return new GoogleAnalyticsService(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(i2.Title), i0.ɵɵinject(windowToken), i0.ɵɵinject(i4.DOCUMENT)); }, token: GoogleAnalyticsService, providedIn: "root" });
3874
- GoogleAnalyticsService.decorators = [
3875
- { type: Injectable, args: [{
3876
- providedIn: 'root'
3877
- },] }
3878
- ];
3879
- GoogleAnalyticsService.ctorParameters = () => [
3880
- { type: Router },
3881
- { type: Title },
3882
- { type: undefined, decorators: [{ type: Inject, args: [windowToken,] }] },
3883
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
3884
- ];
3885
-
3886
- class GoogleTagManagerService {
3887
- constructor(router, title, window, document) {
3888
- this.router = router;
3889
- this.title = title;
3890
- this.window = window;
3891
- this.document = document;
3892
- }
3893
- init(googleTagManagerKey) {
3894
- this.googleTagManagerKey = googleTagManagerKey;
3895
- try {
3896
- this.window.dataLayer = this.window.dataLayer || [];
3897
- this.window.dataLayer.push({
3898
- 'gtm.start': new Date().getTime(),
3899
- event: 'gtm.js'
3900
- });
3901
- const script = this.document.createElement('script');
3902
- script.async = true;
3903
- script.src = `https://www.googletagmanager.com/gtm.js?id=${this.googleTagManagerKey}`;
3904
- this.document.head.appendChild(script);
3905
- }
3906
- catch (ex) {
3907
- console.error('Error appending google tag manager');
3908
- console.error(ex);
3909
- }
3910
- this.listenForRouteChanges();
3911
- }
3912
- listenForRouteChanges() {
3913
- if (this.googleTagManagerKey) {
3914
- this.router.events.subscribe(event => {
3915
- if (event instanceof NavigationEnd) {
3916
- this.window.dataLayer.push({
3917
- event: 'pageview',
3918
- page: {
3919
- path: event.urlAfterRedirects,
3920
- title: this.title.getTitle()
3921
- }
3922
- });
3923
- }
3924
- });
3925
- }
3926
- }
3927
- event(eventName, params) {
3928
- this.window.dataLayer.push({
3929
- event: eventName,
3930
- params
3931
- });
3932
- }
3933
- }
3934
- GoogleTagManagerService.ɵprov = i0.ɵɵdefineInjectable({ factory: function GoogleTagManagerService_Factory() { return new GoogleTagManagerService(i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(i2.Title), i0.ɵɵinject(windowToken), i0.ɵɵinject(i4.DOCUMENT)); }, token: GoogleTagManagerService, providedIn: "root" });
3935
- GoogleTagManagerService.decorators = [
3936
- { type: Injectable, args: [{
3937
- providedIn: 'root'
3938
- },] }
3939
- ];
3940
- GoogleTagManagerService.ctorParameters = () => [
3941
- { type: Router },
3942
- { type: Title },
3943
- { type: undefined, decorators: [{ type: Inject, args: [windowToken,] }] },
3944
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
3945
- ];
3946
-
3947
- class ManageSessionServices {
3948
- constructor(idle, keepalive) {
3949
- this.idle = idle;
3950
- this.keepalive = keepalive;
3951
- this.appStateEmitter = new Subject();
3952
- }
3953
- init(idleConfig) {
3954
- this.idle.setIdleName(idleConfig.idleServiceName);
3955
- this.idle.setTimeout(idleConfig.timeout);
3956
- const interrupt = new DocumentInterruptSource('mousedown keydown DOMMouseScroll mousewheel touchstart touchmove scroll');
3957
- this.idle.setInterrupts([interrupt]);
3958
- // adding delay so that user can click on sign out before the modal shuts
3959
- this.idle.onIdleEnd.pipe(delay(250)).subscribe(() => {
3960
- this.appStateEmitter.next({ type: 'modal', countdown: undefined, isVisible: false });
3961
- });
3962
- this.idle.onTimeout.subscribe(() => {
3963
- this.appStateEmitter.next({ type: 'signout' });
3964
- });
3965
- this.idle.onTimeoutWarning.pipe(map(sec => (sec > 60) ? `${Math.ceil(sec / 60)} minutes` : `${sec} seconds`), distinctUntilChanged()).subscribe((countdown) => {
3966
- this.appStateEmitter.next({ type: 'modal', countdown, isVisible: true });
3967
- });
3968
- this.keepalive.interval(idleConfig.keepAliveInSeconds);
3969
- this.keepalive.onPing.subscribe(() => {
3970
- this.appStateEmitter.next({ type: 'keepalive' });
3971
- });
3972
- const idleInSeconds = Math.floor((idleConfig.idleMilliseconds / 1000)) - idleConfig.timeout;
3973
- this.idle.setIdle(idleInSeconds);
3974
- this.idle.watch();
3975
- }
3976
- appStateChanges() {
3977
- return this.appStateEmitter.asObservable();
3978
- }
3979
- }
3980
- ManageSessionServices.ɵprov = i0.ɵɵdefineInjectable({ factory: function ManageSessionServices_Factory() { return new ManageSessionServices(i0.ɵɵinject(i1$2.Idle), i0.ɵɵinject(i2$1.Keepalive)); }, token: ManageSessionServices, providedIn: "root" });
3981
- ManageSessionServices.decorators = [
3982
- { type: Injectable, args: [{
3983
- providedIn: 'root'
3984
- },] }
3985
- ];
3986
- ManageSessionServices.ctorParameters = () => [
3987
- { type: Idle },
3988
- { type: Keepalive }
3989
- ];
3990
-
3991
- /**
3992
- * TimeoutNotificationsService
3993
- *
3994
- * The Timeout Notification Service allows your application to receive notifications
3995
- * when a User is approaching the the total time that a User has been idle for.
3996
- *
3997
- * This can be set by your application using the Timeout Notification Config object.
3998
- *
3999
- * Your application will then have to listen to events coming from the Timeout Notification Service,
4000
- * and handle these events within your application.
4001
- *
4002
- * @see README.md for implementation details and code, on how to implement the Timeout Notification
4003
- * Service within your application.
4004
- */
4005
- class TimeoutNotificationsService {
4006
- constructor(idle, keepalive) {
4007
- this.idle = idle;
4008
- this.keepalive = keepalive;
4009
- /**
4010
- * Convert milliseconds to seconds.
4011
- *
4012
- * @param milliseconds - 1000
4013
- * @return seconds - 1
4014
- */
4015
- this.millisecondsToSeconds = (milliseconds) => milliseconds / 1000;
4016
- this.eventEmitter = new Subject();
4017
- }
4018
- /**
4019
- * Initialise
4020
- *
4021
- * Initialise the Timeout Notification Events.
4022
- *
4023
- * I made the decision not to make ' minutes' and ' seconds' configurable via input parameters -
4024
- * As I made an assumption that any Reform team would not need to change these to 'secs, mins' or 's, m'.
4025
- *
4026
- * idleModalDisplayTime and totalIdleTime need to be passed in, in milliseconds.
4027
- *
4028
- * @see README.md for more information on TimeoutNotificationService.
4029
- */
4030
- initialise(config) {
4031
- const DOCUMENT_INTERRUPTS = 'mousedown keydown DOMMouseScroll mousewheel touchstart touchmove scroll';
4032
- const MINUTES = ' minutes';
4033
- const SECONDS = ' seconds';
4034
- const SIGNOUT_EVENT = 'sign-out';
4035
- const COUNTDOWN_EVENT = 'countdown';
4036
- const KEEP_ALIVE_EVENT = 'keep-alive';
4037
- const { idleServiceName, idleModalDisplayTime, totalIdleTime } = config;
4038
- this.idle.setIdleName(idleServiceName);
4039
- const idleModalDisplayTimeInSeconds = this.millisecondsToSeconds(idleModalDisplayTime);
4040
- const totalIdleTimeInSeconds = this.millisecondsToSeconds(totalIdleTime);
4041
- this.idle.setTimeout(idleModalDisplayTimeInSeconds);
4042
- const interrupt = new DocumentInterruptSource(DOCUMENT_INTERRUPTS);
4043
- this.idle.setInterrupts([interrupt]);
4044
- this.idle.onTimeout.subscribe(() => {
4045
- this.eventEmitter.next({ eventType: SIGNOUT_EVENT });
4046
- });
4047
- this.idle.onTimeoutWarning.pipe(map(sec => (sec > 60) ? Math.ceil(sec / 60) + MINUTES : sec + SECONDS), distinctUntilChanged()).subscribe((countdown) => {
4048
- this.eventEmitter.next({ eventType: COUNTDOWN_EVENT, readableCountdown: countdown });
4049
- });
4050
- this.keepalive.onPing.subscribe(() => {
4051
- this.eventEmitter.next({ eventType: KEEP_ALIVE_EVENT });
4052
- });
4053
- const idleInSeconds = Math.floor(totalIdleTimeInSeconds) - idleModalDisplayTimeInSeconds;
4054
- this.idle.setIdle(idleInSeconds);
4055
- this.idle.watch();
4056
- }
4057
- /**
4058
- * Expose the notification events, so that a 3rd party service can listen to the notifications.
4059
- */
4060
- notificationOnChange() {
4061
- return this.eventEmitter.asObservable();
4062
- }
4063
- }
4064
- TimeoutNotificationsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TimeoutNotificationsService_Factory() { return new TimeoutNotificationsService(i0.ɵɵinject(i1$2.Idle), i0.ɵɵinject(i2$1.Keepalive)); }, token: TimeoutNotificationsService, providedIn: "root" });
4065
- TimeoutNotificationsService.decorators = [
4066
- { type: Injectable, args: [{
4067
- providedIn: 'root'
4068
- },] }
4069
- ];
4070
- TimeoutNotificationsService.ctorParameters = () => [
4071
- { type: Idle },
4072
- { type: Keepalive }
4073
- ];
4074
-
4075
- class RoleService {
4076
- constructor() {
4077
- this.pRoles = [];
4078
- }
4079
- get roles() {
4080
- return this.pRoles;
4081
- }
4082
- set roles(roles) {
4083
- this.pRoles = roles;
4084
- }
4085
- }
4086
- RoleService.ɵprov = i0.ɵɵdefineInjectable({ factory: function RoleService_Factory() { return new RoleService(); }, token: RoleService, providedIn: "root" });
4087
- RoleService.decorators = [
4088
- { type: Injectable, args: [{
4089
- providedIn: 'root'
4090
- },] }
4091
- ];
4092
-
4093
- var RoleMatching;
4094
- (function (RoleMatching) {
4095
- RoleMatching[RoleMatching["ALL"] = 0] = "ALL";
4096
- RoleMatching[RoleMatching["ANY"] = 1] = "ANY";
4097
- })(RoleMatching || (RoleMatching = {}));
4098
- class RoleGuard {
4099
- constructor(roleService, router) {
4100
- this.roleService = roleService;
4101
- this.router = router;
4102
- }
4103
- canActivate(route) {
4104
- const roles = route.data.needsRole;
4105
- const check = (roleRegEx) => {
4106
- const regex = new RegExp(roleRegEx);
4107
- return this.roleService.roles.some(role => regex.test(role));
4108
- };
4109
- const match = route.data.roleMatching === RoleMatching.ALL ? roles.every(check) : roles.some(check);
4110
- return match || this.router.parseUrl(route.data.noRoleMatchRedirect);
4111
- }
4112
- }
4113
- RoleGuard.ɵprov = i0.ɵɵdefineInjectable({ factory: function RoleGuard_Factory() { return new RoleGuard(i0.ɵɵinject(RoleService), i0.ɵɵinject(i1$1.Router)); }, token: RoleGuard, providedIn: "root" });
4114
- RoleGuard.decorators = [
4115
- { type: Injectable, args: [{
4116
- providedIn: 'root'
4117
- },] }
4118
- ];
4119
- RoleGuard.ctorParameters = () => [
4120
- { type: RoleService },
4121
- { type: Router }
4122
- ];
4123
-
4124
- class HasLoadingState {
4125
- get isLoading() {
4126
- return;
4127
- }
4128
- }
4129
- class LoadingService {
4130
- constructor() {
4131
- this.registered = new Map();
4132
- this.loading = new BehaviorSubject(false);
4133
- }
4134
- get isLoading() {
4135
- return this.loading.asObservable().pipe(distinctUntilChanged());
4136
- }
4137
- register() {
4138
- const token = this.generateToken();
4139
- this.registered.set(token, token);
4140
- this.loading.next(true);
4141
- return token;
4142
- }
4143
- unregister(token) {
4144
- this.registered.delete(token);
4145
- this.loading.next(this.registered.size > 0);
4146
- }
4147
- generateToken() {
4148
- const timestamp = window.performance.now();
4149
- return `common-lib-loading-${timestamp}`; // format: [source-library]-[unique incrementing number]
4150
- }
4151
- }
4152
- LoadingService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingService_Factory() { return new LoadingService(); }, token: LoadingService, providedIn: "root" });
4153
- LoadingService.decorators = [
4154
- { type: Injectable, args: [{
4155
- providedIn: 'root'
4156
- },] }
4157
- ];
4158
-
4159
- /*
4160
- * Public API Surface of exui-common-lib
4161
- */
4162
-
4163
- /*
4164
- * Public API Surface of exui-common-lib
4165
- */
4166
-
4167
- /**
4168
- * Generated bundle index. Do not edit.
4169
- */
4170
-
4171
- export { AccessibilityComponent, AnonymousFeatureUser, BadgeColour, BookingCheckType, COMMON_COMPONENTS, CheckboxListComponent, ContactDetailsComponent, CookieBannerComponent, CookieService, DateBadgeColour, DueDateComponent, ExuiCommonLibModule, ExuiPageWrapperComponent, FeatureToggleDirective, FeatureToggleGuard, FeatureToggleService, FilterService, FindLocationComponent, FindPersonComponent, GOV_UI_COMPONENTS, GenericFilterComponent, GoogleAnalyticsService, GoogleTagManagerService, GovUiService, GovUkCheckboxComponent, GovUkCheckboxesComponent, GovUkDateComponent, GovUkErrorMessageComponent, GovUkFieldsetComponent, GovUkFileUploadComponent, GovUkFormGroupWrapperComponent, GovUkInputComponent, GovUkLabelComponent, GovUkRadioComponent, GovUkRadiosComponent, GovUkSelectComponent, GovUkTextareaComponent, GovukTableColumnConfig, GovukTableComponent, HasLoadingState, HmctsBannerComponent, HmctsErrorSummaryComponent, HmctsIdentityBarComponent, HmctsMainWrapperComponent, HmctsPaginationComponent, HmctsPrimaryNavigationComponent, HmctsSessionDialogComponent, HmctsSubNavigationComponent, InviteUserFormComponent, InviteUserPermissionComponent, LaunchDarklyService, LetContext, LetDirective, LoadingService, LoadingSpinnerComponent, LoggedInFeatureUser, ManageSessionServices, PaginationComponent, PersonRole, RadioFilterFieldConfig, RemoveHostDirective, RoleCategory, RoleGuard, RoleMatching, RoleService, SECONDS_IN_A_DAY, SearchJudicialsComponent, SearchLocationComponent, SearchVenueComponent, SelectedCaseComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseComponent, ShareCaseConfirmComponent, SharedCaseErrorMessages, TabComponent, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, TimeoutNotificationsService, UserDetailsComponent, UserListComponent, UserSelectComponent, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, windowProvider, windowToken, ɵ0, ExuiPageWrapperComponent as ɵa, TermsAndConditionsComponent as ɵb, ServiceMessageComponent as ɵba, ServiceMessagesComponent as ɵbb, LoadingSpinnerComponent as ɵbc, GenericFilterComponent as ɵbd, FilterService as ɵbe, CookieBannerComponent as ɵbf, CookieService as ɵbg, FindPersonComponent as ɵbh, FindAPersonService as ɵbi, SessionStorageService as ɵbj, SearchJudicialsComponent as ɵbk, FindLocationComponent as ɵbl, SearchLocationComponent as ɵbm, LocationService as ɵbn, FindServiceComponent as ɵbo, SearchServiceComponent as ɵbp, SearchVenueComponent as ɵbq, PaginationComponent as ɵbr, HmctsIdentityBarComponent as ɵbs, HmctsPaginationComponent as ɵbt, HmctsSubNavigationComponent as ɵbu, HmctsPrimaryNavigationComponent as ɵbv, HmctsErrorSummaryComponent as ɵbw, HmctsMainWrapperComponent as ɵbx, HmctsBannerComponent as ɵby, GovukTableComponent as ɵbz, TcDisplayHtmlComponent as ɵc, GovUkInputComponent as ɵca, GovUkCheckboxComponent as ɵcb, GovUkFormGroupWrapperComponent as ɵcc, GovUkLabelComponent as ɵcd, GovUkErrorMessageComponent as ɵce, GovUkFieldsetComponent as ɵcf, GovUkDateComponent as ɵcg, GovUkCheckboxesComponent as ɵch, GovUkRadioComponent as ɵci, GovUkRadiosComponent as ɵcj, GovUkSelectComponent as ɵck, GovUkTextareaComponent as ɵcl, GovUkFileUploadComponent as ɵcm, RemoveHostDirective as ɵcn, TcDisplayPlainComponent as ɵd, TcConfirmComponent as ɵe, ContactDetailsComponent as ɵf, FeatureToggleDirective as ɵg, FeatureToggleService as ɵh, LetContext as ɵi, LetDirective as ɵj, HmctsSessionDialogComponent as ɵk, UserListComponent as ɵl, UserDetailsComponent as ɵm, InviteUserPermissionComponent as ɵn, InviteUserFormComponent as ɵo, ShareCaseComponent as ɵp, UserSelectComponent as ɵq, CaseSharingStateService as ɵr, ShareCaseConfirmComponent as ɵs, SelectedCaseListComponent as ɵt, SelectedCaseComponent as ɵu, SelectedCaseConfirmComponent as ɵv, TabComponent as ɵw, AccessibilityComponent as ɵx, DueDateComponent as ɵy, CheckboxListComponent as ɵz };
4172
- //# sourceMappingURL=hmcts-rpx-xui-common-lib.js.map