@hmcts/rpx-xui-common-lib 2.1.4-angular-upgrade-11 → 2.1.4

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