@flarehr/apollo-super-selection 1.2.32739 → 1.3.36

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 (191) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -1
  2. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  3. package/dist/lib/apollo-super-selection/p-065c0e01.system.entry.js +69 -0
  4. package/dist/lib/apollo-super-selection/p-42cd55d4.entry.js +14 -0
  5. package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
  6. package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
  7. package/dist/lib/cjs/loader.cjs.js +1 -1
  8. package/dist/lib/cjs/{sss-button_30.cjs.entry.js → sss-button_34.cjs.entry.js} +6510 -5652
  9. package/dist/lib/collection/apollo-super-selection.css +1 -1
  10. package/dist/lib/collection/collection-manifest.json +25 -17
  11. package/dist/lib/collection/components/app-host/services/appinsights.service.js +3 -0
  12. package/dist/lib/collection/components/app-host/super-selection-app-host.css +6 -6
  13. package/dist/lib/collection/components/super-campaign/fund-tile-clicked.handler.js +49 -0
  14. package/dist/lib/collection/components/super-campaign/promoted-fund-joined.handler.js +121 -0
  15. package/dist/lib/collection/components/super-campaign/super-campaign-types.js +6 -0
  16. package/dist/lib/collection/components/super-campaign/super-campaign.js +213 -0
  17. package/dist/lib/collection/components/super-selection-app/api/super-campaign-errors-api.js +9 -0
  18. package/dist/lib/collection/components/super-selection-app/api/super-campaign-errors.api.dtos.js +1 -0
  19. package/dist/lib/collection/components/super-selection-app/api/super-selection-events.model.js +16 -1
  20. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +71 -22
  21. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +5 -9
  22. package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +11 -1
  23. package/dist/lib/collection/components/super-selection-app/choice/choice-router.js +42 -0
  24. package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +26 -15
  25. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +15 -15
  26. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.js +9 -0
  27. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +30 -7
  28. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.store.js +6 -23
  29. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +8 -3
  30. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/featured-funds/super-campaign-featured-funds.js +113 -0
  31. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/featured-funds/super-campaign-featured-funds.types.js +1 -0
  32. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/member-name-input.js +19 -5
  33. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-engagement-step-types.js +1 -0
  34. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-engagement-step.js +115 -0
  35. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +4 -4
  36. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +16 -4
  37. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +32 -17
  38. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +8 -3
  39. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.js +9 -0
  40. package/dist/lib/collection/components/super-selection-app/funds/slate-super/api/slate.js +4 -0
  41. package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +8 -38
  42. package/dist/lib/collection/components/super-selection-app/misc/button.js +20 -2
  43. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +18 -1
  44. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-common.js +22 -0
  45. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-display-field.js +42 -0
  46. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-error-box.js +66 -0
  47. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.js +121 -0
  48. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-invalid-smsf.js +145 -0
  49. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-my-own-fund.js +223 -0
  50. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-smsf.js +398 -0
  51. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-types.js +288 -0
  52. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill-warning-box.js +37 -0
  53. package/dist/lib/collection/components/super-selection-app/prefill-fund/prefill.js +81 -0
  54. package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +30 -25
  55. package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +29 -7
  56. package/dist/lib/collection/components/super-selection-app/services/navigation.service.js +1 -0
  57. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +17 -9
  58. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.service.js +69 -20
  59. package/dist/lib/collection/components/super-selection-app/services/super-selection.store.js +31 -3
  60. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +75 -12
  61. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.store.js +1 -0
  62. package/dist/lib/collection/components/super-selection-app/super-selection-app.js +14 -20
  63. package/dist/lib/esm/apollo-super-selection.js +1 -1
  64. package/dist/lib/esm/loader.js +1 -1
  65. package/dist/lib/esm/{sss-button_30.entry.js → sss-button_34.entry.js} +7864 -7030
  66. package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
  67. package/dist/lib/esm-es5/loader.js +1 -1
  68. package/dist/lib/esm-es5/sss-button_34.entry.js +69 -0
  69. package/dist/lib/types/components/app-host/services/appinsights.service.d.ts +1 -0
  70. package/dist/lib/types/components/super-campaign/fund-tile-clicked.handler.d.ts +12 -0
  71. package/dist/lib/types/components/super-campaign/promoted-fund-joined.handler.d.ts +15 -0
  72. package/dist/lib/types/components/super-campaign/super-campaign-types.d.ts +98 -0
  73. package/dist/lib/types/components/super-campaign/super-campaign.d.ts +28 -0
  74. package/dist/lib/types/components/super-selection-app/api/super-campaign-errors-api.d.ts +6 -0
  75. package/dist/lib/types/components/super-selection-app/api/super-campaign-errors.api.dtos.d.ts +7 -0
  76. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +83 -32
  77. package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +2 -2
  78. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +88 -8
  79. package/dist/lib/types/components/super-selection-app/app-state-pages/success.d.ts +3 -0
  80. package/dist/lib/types/components/super-selection-app/{funds/promoted-fund/promoted-fund-join-v1-page.d.ts → choice/choice-router.d.ts} +2 -1
  81. package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +1 -2
  82. package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.d.ts +2 -1
  83. package/dist/lib/types/components/super-selection-app/funds/custom-fund/api/custom-fund-choice.api.dto.d.ts +16 -12
  84. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +6 -9
  85. package/dist/lib/types/components/super-selection-app/funds/custom-fund/featured-funds/super-campaign-featured-funds.d.ts +18 -0
  86. package/dist/lib/types/components/super-selection-app/funds/custom-fund/featured-funds/super-campaign-featured-funds.types.d.ts +26 -0
  87. package/dist/lib/types/components/super-selection-app/funds/custom-fund/member-name-input.d.ts +1 -0
  88. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-engagement-step-types.d.ts +15 -0
  89. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-engagement-step.d.ts +20 -0
  90. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +1 -2
  91. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.d.ts +2 -1
  92. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/api/promoted-fund-choice.api.dto.d.ts +16 -15
  93. package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate-choice.api.dto.d.ts +3 -5
  94. package/dist/lib/types/components/super-selection-app/funds/slate-super/api/slate.d.ts +4 -0
  95. package/dist/lib/types/components/super-selection-app/header-section/header-section.d.ts +0 -1
  96. package/dist/lib/types/components/super-selection-app/misc/button.d.ts +2 -1
  97. package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +1 -0
  98. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-common.d.ts +9 -0
  99. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-display-field.d.ts +5 -0
  100. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-error-box.d.ts +5 -0
  101. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-my-own-fund.d.ts +18 -0
  102. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-invalid-smsf.d.ts +28 -0
  103. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-my-own-fund.d.ts +30 -0
  104. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-smsf.d.ts +52 -0
  105. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-types.d.ts +95 -0
  106. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill-warning-box.d.ts +4 -0
  107. package/dist/lib/types/components/super-selection-app/prefill-fund/prefill.d.ts +14 -0
  108. package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +6 -5
  109. package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +17 -1
  110. package/dist/lib/types/components/super-selection-app/services/navigation.service.d.ts +2 -0
  111. package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +8 -4
  112. package/dist/lib/types/components/super-selection-app/services/super-selection-app.service.d.ts +18 -9
  113. package/dist/lib/types/components/super-selection-app/services/super-selection.store.d.ts +22 -4
  114. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.d.ts +5 -0
  115. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.store.d.ts +34 -0
  116. package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +0 -2
  117. package/dist/lib/types/components.d.ts +172 -115
  118. package/package.json +3 -3
  119. package/dist/lib/apollo-super-selection/assets/icon-check.svg +0 -3
  120. package/dist/lib/apollo-super-selection/assets/logo-active.svg +0 -1
  121. package/dist/lib/apollo-super-selection/assets/logo-art.svg +0 -7
  122. package/dist/lib/apollo-super-selection/assets/logo-aus-eth.svg +0 -31
  123. package/dist/lib/apollo-super-selection/assets/logo-aware.svg +0 -1
  124. package/dist/lib/apollo-super-selection/assets/logo-first.svg +0 -15
  125. package/dist/lib/apollo-super-selection/assets/logo-hesta.svg +0 -5
  126. package/dist/lib/apollo-super-selection/assets/logo-mercer-mychoice.svg +0 -1
  127. package/dist/lib/apollo-super-selection/assets/logo-slate.png +0 -0
  128. package/dist/lib/apollo-super-selection/assets/logo-spirit.svg +0 -141
  129. package/dist/lib/apollo-super-selection/assets/logo-virgin.svg +0 -8
  130. package/dist/lib/apollo-super-selection/p-74878c94.entry.js +0 -14
  131. package/dist/lib/apollo-super-selection/p-823c6c2c.system.entry.js +0 -69
  132. package/dist/lib/collection/components/super-selection-app/assets/icon-check.svg +0 -3
  133. package/dist/lib/collection/components/super-selection-app/consent/consent.js +0 -54
  134. package/dist/lib/collection/components/super-selection-app/funds/constants.js +0 -33
  135. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/active.js +0 -26
  136. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/australian-ethical.js +0 -43
  137. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/australian-retirement-trust.js +0 -32
  138. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/aware.js +0 -27
  139. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/first.js +0 -27
  140. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/hesta-default.js +0 -41
  141. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/mercermychoice.js +0 -32
  142. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/slate.js +0 -32
  143. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/spirit.js +0 -43
  144. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/funds/virgin.js +0 -36
  145. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-v1-page.js +0 -30
  146. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-v2-page.js +0 -30
  147. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund.store.js +0 -8
  148. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v1-iframe-builder.js +0 -115
  149. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v2-iframe-builder.js +0 -131
  150. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/types.js +0 -14
  151. package/dist/lib/collection/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.js +0 -136
  152. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-join-page.js +0 -30
  153. package/dist/lib/collection/components/super-selection-app/misc/iframe-host.js +0 -32
  154. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-active.svg +0 -1
  155. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-art.svg +0 -7
  156. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-aus-eth.svg +0 -31
  157. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-aware.svg +0 -1
  158. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-first.svg +0 -15
  159. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-hesta.svg +0 -5
  160. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-mercer-mychoice.svg +0 -1
  161. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-slate.png +0 -0
  162. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-spirit.svg +0 -141
  163. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-virgin.svg +0 -8
  164. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js +0 -112
  165. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.js +0 -136
  166. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +0 -181
  167. package/dist/lib/esm-es5/sss-button_30.entry.js +0 -69
  168. package/dist/lib/types/components/super-selection-app/consent/consent.d.ts +0 -8
  169. package/dist/lib/types/components/super-selection-app/funds/constants.d.ts +0 -8
  170. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/active.d.ts +0 -3
  171. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/australian-ethical.d.ts +0 -3
  172. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/australian-retirement-trust.d.ts +0 -3
  173. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/aware.d.ts +0 -3
  174. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/first.d.ts +0 -3
  175. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/hesta-default.d.ts +0 -3
  176. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/mercermychoice.d.ts +0 -3
  177. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/slate.d.ts +0 -4
  178. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/spirit.d.ts +0 -3
  179. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/funds/virgin.d.ts +0 -3
  180. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-join-v2-page.d.ts +0 -5
  181. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund.store.d.ts +0 -8
  182. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v1-iframe-builder.d.ts +0 -10
  183. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-v2-iframe-builder.d.ts +0 -9
  184. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/types.d.ts +0 -24
  185. package/dist/lib/types/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.d.ts +0 -14
  186. package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-join-page.d.ts +0 -5
  187. package/dist/lib/types/components/super-selection-app/misc/iframe-host.d.ts +0 -6
  188. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.d.ts +0 -10
  189. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.d.ts +0 -10
  190. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page.d.ts +0 -11
  191. package/readme.md +0 -41
@@ -148,7 +148,7 @@ export class SelectInputAsync {
148
148
  var _a;
149
149
  return (h(Host, null,
150
150
  h("div", { class: "relative" },
151
- h("input", { type: "text", class: {
151
+ h("input", { "data-testid": this.testId, type: "text", class: {
152
152
  'shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md': true,
153
153
  'invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
154
154
  .showValidationErrors
@@ -176,6 +176,23 @@ export class SelectInputAsync {
176
176
  "$": ["dropdown-async.css"]
177
177
  }; }
178
178
  static get properties() { return {
179
+ "testId": {
180
+ "type": "string",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "string",
184
+ "resolved": "string",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": ""
192
+ },
193
+ "attribute": "test-id",
194
+ "reflect": false
195
+ },
179
196
  "placeholder": {
180
197
  "type": "string",
181
198
  "mutable": false,
@@ -0,0 +1,22 @@
1
+ import { h } from '@stencil/core';
2
+ export function isNullOrWhitespace(value) {
3
+ return value == null || value.trim() === '';
4
+ }
5
+ export const DisabledField = (name, testId, value) => {
6
+ return (h("div", { class: "mt-3" },
7
+ h("label", { class: "text-sm font-medium text-gray-700" }, name),
8
+ h("div", { "data-testid": testId, class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-base sm:text-sm" }, value)));
9
+ };
10
+ export const Header = () => {
11
+ return (h("div", null,
12
+ h("div", { class: "text-2xl sm:text-3xl font-bold text-center" }, "Your super nomination"),
13
+ h("div", { class: "sm:text-lg text-gray-600 mt-3 sm:mt-4 max-w-800 text-center leading-7" }, "Review or update the below super fund nomination details provided by your employer.")));
14
+ };
15
+ export class Style {
16
+ static Input(isValidated) {
17
+ return {
18
+ 'relative shadow-sm focus:ring-primary-focus focus:border-primary-base block w-full text-base sm:text-sm border-gray-300 rounded-md focus:z-10': true,
19
+ 'invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500': isValidated
20
+ };
21
+ }
22
+ }
@@ -0,0 +1,42 @@
1
+ import { Component, h, Prop } from '@stencil/core';
2
+ export class DisplayField {
3
+ render() {
4
+ return (h("div", { class: "flex w-full flex-col sm:flex-row sm:min-h-5 justify-center items-start gap-0.5 sm:gap-4 self-stretch" },
5
+ h("div", { class: {
6
+ 'sm:w-2/5 sm:max-w-40 self-stretch text-gray-500 text-xs sm:text-sm not-italic font-medium leading-4 sm:leading-5': true,
7
+ 'text-red-600': !this.field.isValid
8
+ } }, this.field.name),
9
+ h("div", { "data-testid": this.field.testId, class: {
10
+ 'sm:w-3/5 max-w-[300px] self-stretch text-gray-900 text-sm not-italic font-normal leading-5 break-words': true,
11
+ 'h-5 sm:h-auto': this.field.isEmpty,
12
+ 'text-red-600': !this.field.isValid
13
+ } }, this.field.value)));
14
+ }
15
+ static get is() { return "sss-prefill-display-field"; }
16
+ static get properties() { return {
17
+ "field": {
18
+ "type": "unknown",
19
+ "mutable": false,
20
+ "complexType": {
21
+ "original": "FormField | StaticFormField",
22
+ "resolved": "FormField | StaticFormField",
23
+ "references": {
24
+ "FormField": {
25
+ "location": "import",
26
+ "path": "./prefill-types"
27
+ },
28
+ "StaticFormField": {
29
+ "location": "import",
30
+ "path": "./prefill-types"
31
+ }
32
+ }
33
+ },
34
+ "required": false,
35
+ "optional": false,
36
+ "docs": {
37
+ "tags": [],
38
+ "text": ""
39
+ }
40
+ }
41
+ }; }
42
+ }
@@ -0,0 +1,66 @@
1
+ import { Component, h, Prop } from '@stencil/core';
2
+ export class PrefillErrorBox {
3
+ constructor() {
4
+ this.withHeader = false;
5
+ }
6
+ render() {
7
+ const ErrorIcon = () => {
8
+ return (h("div", { class: "w-5 h-5" },
9
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
10
+ h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM8.70711 7.29289C8.31658 6.90237 7.68342 6.90237 7.29289 7.29289C6.90237 7.68342 6.90237 8.31658 7.29289 8.70711L8.58579 10L7.29289 11.2929C6.90237 11.6834 6.90237 12.3166 7.29289 12.7071C7.68342 13.0976 8.31658 13.0976 8.70711 12.7071L10 11.4142L11.2929 12.7071C11.6834 13.0976 12.3166 13.0976 12.7071 12.7071C13.0976 12.3166 13.0976 11.6834 12.7071 11.2929L11.4142 10L12.7071 8.70711C13.0976 8.31658 13.0976 7.68342 12.7071 7.29289C12.3166 6.90237 11.6834 6.90237 11.2929 7.29289L10 8.58579L8.70711 7.29289Z", fill: "#F87171" }))));
11
+ };
12
+ return (h("div", { class: "flex items-start self-stretch rounded-md bg-red-50" },
13
+ h("div", { class: "w-1 self-stretch bg-red-400" }),
14
+ h("div", { class: "flex items-start gap-3 flex-[1_0_0] p-4" },
15
+ h(ErrorIcon, null),
16
+ h("div", { class: "flex-col justify-start items-start gap-2 inline-flex" },
17
+ this.withHeader && (h("div", { class: "self-stretch text-red-800 text-sm font-medium leading-tight" },
18
+ "Please correct ",
19
+ this.notificationList.length,
20
+ " issues with your fund details")),
21
+ this.withHeader &&
22
+ this.notificationList.map((text) => (h("div", { class: "self-stretch h-5 flex-col justify-start items-start gap-1 flex" },
23
+ h("div", { class: "self-stretch pl-1.5 justify-start items-start gap-[7px] inline-flex" },
24
+ h("div", { class: "pt-1.5 justify-center items-center flex" },
25
+ h("div", { class: "w-1.5 h-1.5 bg-red-700 rounded-full" })),
26
+ h("div", { class: "grow shrink basis-0 text-red-700 text-sm font-normal leading-tight" }, text))))),
27
+ !this.withHeader &&
28
+ this.notificationList.map((text) => (h("div", { class: "text-sm font-medium leading-tight text-red-800" }, text)))))));
29
+ }
30
+ static get is() { return "sss-prefill-error-box"; }
31
+ static get properties() { return {
32
+ "withHeader": {
33
+ "type": "boolean",
34
+ "mutable": false,
35
+ "complexType": {
36
+ "original": "boolean",
37
+ "resolved": "boolean",
38
+ "references": {}
39
+ },
40
+ "required": false,
41
+ "optional": false,
42
+ "docs": {
43
+ "tags": [],
44
+ "text": ""
45
+ },
46
+ "attribute": "with-header",
47
+ "reflect": false,
48
+ "defaultValue": "false"
49
+ },
50
+ "notificationList": {
51
+ "type": "unknown",
52
+ "mutable": false,
53
+ "complexType": {
54
+ "original": "string[]",
55
+ "resolved": "string[]",
56
+ "references": {}
57
+ },
58
+ "required": false,
59
+ "optional": false,
60
+ "docs": {
61
+ "tags": [],
62
+ "text": ""
63
+ }
64
+ }
65
+ }; }
66
+ }
@@ -0,0 +1,121 @@
1
+ import { Component, h, Prop, State } from '@stencil/core';
2
+ import { EventTrackingService } from '../services/event-tracking.service';
3
+ import navigationService from '../services/navigation.service';
4
+ import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
5
+ import { Header, isNullOrWhitespace } from './prefill-common';
6
+ import { FundName, FundUsi, MemberGivenNames, MemberLastName, MemberNumber } from './prefill-types';
7
+ export class PrefillInvalidMyOwnFund {
8
+ constructor() {
9
+ this.eventTrackingService = EventTrackingService.Instance;
10
+ this.createSuperFundPrefillDeclinedDetail = (prefill) => {
11
+ return {
12
+ fundType: 'My Own Fund',
13
+ isUsiValid: prefill.fundDetail.type === 'Valid',
14
+ isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
15
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
16
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
17
+ };
18
+ };
19
+ this.createSuperFundPrefillViewedDetail = (prefill) => {
20
+ return {
21
+ fundType: 'My Own Fund',
22
+ isUsiValid: prefill.fundDetail.type === 'Valid',
23
+ isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
24
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
25
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
26
+ };
27
+ };
28
+ }
29
+ componentDidLoad() {
30
+ const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
31
+ return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
32
+ }
33
+ async componentWillLoad() {
34
+ if (this.prefill && this.prefill.fundDetail.type === 'Invalid') {
35
+ this.fundUsi = new FundUsi(this.prefill.fundDetail.fundUsi, false);
36
+ this.fundName = new FundName('', false);
37
+ this.memberNumber = new MemberNumber(this.prefill.memberNumber);
38
+ this.memberGivenNames = new MemberGivenNames(this.prefill.memberFirstName);
39
+ this.memberLastName = new MemberLastName(this.prefill.memberFamilyName);
40
+ }
41
+ else {
42
+ // If prefill does not exist, or is valid we should
43
+ // not have landed on this page, navigate to choice page
44
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
45
+ }
46
+ }
47
+ render() {
48
+ return (h("div", null,
49
+ h(Header, null),
50
+ h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
51
+ h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
52
+ h("div", { class: "flex flex-col items-start gap-3 self-stretch" },
53
+ h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your fund details"),
54
+ h("sss-prefill-error-box", { class: "self-stretch", notificationList: [
55
+ 'The fund USI is invalid, or no longer in use. You are required to choose another fund to continue with your super nomination.'
56
+ ] }),
57
+ h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
58
+ h("sss-prefill-display-field", { field: this.fundUsi }),
59
+ h("sss-prefill-display-field", { field: this.fundName }),
60
+ h("sss-prefill-display-field", { field: this.memberNumber }),
61
+ h("sss-prefill-display-field", { field: this.memberLastName }),
62
+ h("sss-prefill-display-field", { field: this.memberGivenNames })))),
63
+ h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
64
+ h("sss-button", { testid: "choose-another-fund-button", class: "self-stretch", fillWidth: true, variant: "primary", promiseFn: () => this.handleChooseAnotherFund() }, "Choose another fund")))));
65
+ }
66
+ async handleChooseAnotherFund() {
67
+ const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
68
+ await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
69
+ return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
70
+ }
71
+ static get is() { return "sss-prefill-invalid-my-own-fund"; }
72
+ static get properties() { return {
73
+ "history": {
74
+ "type": "unknown",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "RouterHistory",
78
+ "resolved": "RouterHistory",
79
+ "references": {
80
+ "RouterHistory": {
81
+ "location": "import",
82
+ "path": "@stencil/router"
83
+ }
84
+ }
85
+ },
86
+ "required": false,
87
+ "optional": false,
88
+ "docs": {
89
+ "tags": [],
90
+ "text": ""
91
+ }
92
+ },
93
+ "prefill": {
94
+ "type": "unknown",
95
+ "mutable": false,
96
+ "complexType": {
97
+ "original": "PrefillOwnFundChoiceDto",
98
+ "resolved": "{ fundDetail: { type: \"Valid\"; fundUsi: string; fundName: string; } | { type: \"Invalid\"; fundUsi: string; }; memberNumber: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
99
+ "references": {
100
+ "PrefillOwnFundChoiceDto": {
101
+ "location": "import",
102
+ "path": "../api/super-selection.api.dto"
103
+ }
104
+ }
105
+ },
106
+ "required": false,
107
+ "optional": false,
108
+ "docs": {
109
+ "tags": [],
110
+ "text": ""
111
+ }
112
+ }
113
+ }; }
114
+ static get states() { return {
115
+ "fundUsi": {},
116
+ "fundName": {},
117
+ "memberNumber": {},
118
+ "memberGivenNames": {},
119
+ "memberLastName": {}
120
+ }; }
121
+ }
@@ -0,0 +1,145 @@
1
+ import { Component, h, Prop, State } from '@stencil/core';
2
+ import { EventTrackingService } from '../services/event-tracking.service';
3
+ import navigationService from '../services/navigation.service';
4
+ import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
5
+ import { Header, isNullOrWhitespace } from './prefill-common';
6
+ import { BankAccountBsb, BankAccountName, BankAccountNumber, FundAbn, FundAddress, FundAddressCity, FundAddressLine1, FundAddressLine2, FundAddressPostcode, FundAddressState, FundEsa, MemberGivenNames, MemberLastName, SmsfFundName } from './prefill-types';
7
+ export class PrefillInvalidSMSF {
8
+ constructor() {
9
+ this.eventTrackingService = EventTrackingService.Instance;
10
+ this.createSuperFundPrefillDeclinedDetail = (prefill) => {
11
+ return {
12
+ fundType: 'SMSF',
13
+ isAbnValid: prefill.fundAbn.valid,
14
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
15
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
16
+ };
17
+ };
18
+ this.createSuperFundPrefillViewedDetail = (prefill) => {
19
+ return {
20
+ fundType: 'SMSF',
21
+ isAbnValid: prefill.fundAbn.valid,
22
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
23
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
24
+ };
25
+ };
26
+ }
27
+ componentDidLoad() {
28
+ const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
29
+ return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
30
+ }
31
+ async componentWillLoad() {
32
+ if (this.prefill && !this.prefill.fundAbn.valid) {
33
+ this.initialiseComponent(this.prefill);
34
+ }
35
+ else {
36
+ // If prefill does not exist, or is valid we should
37
+ // not have landed on this page, navigate to PrefillInvalidMyOwnFundPage page
38
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.PrefillInvalidMyOwnFundPage);
39
+ }
40
+ }
41
+ render() {
42
+ return (h("div", null,
43
+ h(Header, null),
44
+ h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
45
+ h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
46
+ h("div", { class: "flex flex-col items-start gap-3 self-stretch" },
47
+ h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your self-managed super fund (SMSF) details"),
48
+ h("sss-prefill-error-box", { class: "self-stretch", notificationList: [
49
+ 'The fund ABN is invalid. You are required to choose another fund to continue with your super nomination.'
50
+ ] }),
51
+ h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
52
+ h("sss-prefill-display-field", { field: this.fundName }),
53
+ h("sss-prefill-display-field", { field: this.fundAbn }),
54
+ h("sss-prefill-display-field", { field: this.fundEsa }),
55
+ h("sss-prefill-display-field", { field: this.fundAddress }),
56
+ h("sss-prefill-display-field", { field: this.memberLastName }),
57
+ h("sss-prefill-display-field", { field: this.memberGivenNames }),
58
+ h("div", { class: "mt-4 mb-2 text-gray-900 text-lg font-bold leading-7" }, "Fund bank details"),
59
+ h("sss-prefill-display-field", { field: this.bankAccountName }),
60
+ h("sss-prefill-display-field", { field: this.bankAccountBsb }),
61
+ h("sss-prefill-display-field", { field: this.bankAccountNumber })))),
62
+ h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
63
+ h("sss-button", { testid: "make-another-nomination-button", class: "self-stretch", fillWidth: true, variant: "primary", promiseFn: () => this.handleFundNominationDeclined() }, "Make another nomination")))));
64
+ }
65
+ initialiseComponent(prefill) {
66
+ this.fundName = new SmsfFundName(prefill.fundName);
67
+ this.fundAbn = new FundAbn(prefill.fundAbn.value, prefill.fundAbn.valid);
68
+ this.fundEsa = new FundEsa(prefill.electronicServiceAddress);
69
+ this.fundAddressLine1 = new FundAddressLine1(prefill.addressLine1);
70
+ this.fundAddressLine2 = new FundAddressLine2(prefill.addressLine2);
71
+ this.fundAddressCity = new FundAddressCity(prefill.addressCity);
72
+ this.fundAddressPostcode = new FundAddressPostcode(prefill.addressPostcode);
73
+ this.fundAddressState = new FundAddressState(prefill.addressState);
74
+ this.fundAddress = new FundAddress(this.fundAddressLine1, this.fundAddressLine2, this.fundAddressCity, this.fundAddressState, this.fundAddressPostcode);
75
+ this.memberGivenNames = new MemberGivenNames(prefill.memberFirstName);
76
+ this.memberLastName = new MemberLastName(prefill.memberFamilyName);
77
+ this.bankAccountName = new BankAccountName(prefill.bankAccountName);
78
+ this.bankAccountBsb = new BankAccountBsb(prefill.bankAccountBsb);
79
+ this.bankAccountNumber = new BankAccountNumber(prefill.bankAccountNumber);
80
+ }
81
+ async handleFundNominationDeclined() {
82
+ const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
83
+ await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
84
+ return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
85
+ }
86
+ static get is() { return "sss-prefill-invalid-smsf"; }
87
+ static get properties() { return {
88
+ "history": {
89
+ "type": "unknown",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "RouterHistory",
93
+ "resolved": "RouterHistory",
94
+ "references": {
95
+ "RouterHistory": {
96
+ "location": "import",
97
+ "path": "@stencil/router"
98
+ }
99
+ }
100
+ },
101
+ "required": false,
102
+ "optional": false,
103
+ "docs": {
104
+ "tags": [],
105
+ "text": ""
106
+ }
107
+ },
108
+ "prefill": {
109
+ "type": "unknown",
110
+ "mutable": false,
111
+ "complexType": {
112
+ "original": "PrefillSMSFChoiceDto",
113
+ "resolved": "{ fundAbn: { valid: boolean; value: string; }; fundName: string | null; addressLine1: string | null; addressLine2: string | null; addressCity: string | null; addressState: string | null; addressPostcode: string | null; bankAccountBsb: string | null; bankAccountName: string | null; bankAccountNumber: string | null; electronicServiceAddress: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
114
+ "references": {
115
+ "PrefillSMSFChoiceDto": {
116
+ "location": "import",
117
+ "path": "../api/super-selection.api.dto"
118
+ }
119
+ }
120
+ },
121
+ "required": false,
122
+ "optional": false,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": ""
126
+ }
127
+ }
128
+ }; }
129
+ static get states() { return {
130
+ "fundName": {},
131
+ "fundAbn": {},
132
+ "fundEsa": {},
133
+ "fundAddressLine1": {},
134
+ "fundAddressLine2": {},
135
+ "fundAddressCity": {},
136
+ "fundAddressPostcode": {},
137
+ "fundAddressState": {},
138
+ "fundAddress": {},
139
+ "memberGivenNames": {},
140
+ "memberLastName": {},
141
+ "bankAccountName": {},
142
+ "bankAccountBsb": {},
143
+ "bankAccountNumber": {}
144
+ }; }
145
+ }
@@ -0,0 +1,223 @@
1
+ import { Component, h, Prop, State } from '@stencil/core';
2
+ import customFundChoiceApi from '../funds/custom-fund/api/custom-fund-choice.api';
3
+ import { EventTrackingService } from '../services/event-tracking.service';
4
+ import navigationService from '../services/navigation.service';
5
+ import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
6
+ import superSelectionAppService from '../services/super-selection-app.service';
7
+ import { DisabledField, Header, isNullOrWhitespace, Style } from './prefill-common';
8
+ import { FundName, FundUsi, MemberGivenNames, MemberLastName, MemberNumber, NAME_PATTERN } from './prefill-types';
9
+ export class PrefillMyOwnFund {
10
+ constructor() {
11
+ this.mode = 'review';
12
+ this.formState = 'pristine';
13
+ this.isSubmitDisabled = true;
14
+ this.eventTrackingService = EventTrackingService.Instance;
15
+ this.createSuperFundPrefillDeclinedDetail = (prefill) => {
16
+ return {
17
+ fundType: 'My Own Fund',
18
+ isUsiValid: prefill.fundDetail.type === 'Valid',
19
+ isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
20
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
21
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
22
+ };
23
+ };
24
+ this.createSuperFundPrefillViewedDetail = (prefill) => {
25
+ return {
26
+ fundType: 'My Own Fund',
27
+ isUsiValid: prefill.fundDetail.type === 'Valid',
28
+ isMemberNumberPresent: !isNullOrWhitespace(prefill.memberNumber),
29
+ isMemberFirstNamePresent: !isNullOrWhitespace(prefill.memberFirstName),
30
+ isMemberLastNamePresent: !isNullOrWhitespace(prefill.memberFamilyName)
31
+ };
32
+ };
33
+ }
34
+ componentDidLoad() {
35
+ const detail = this.createSuperFundPrefillViewedDetail(this.prefill);
36
+ return this.eventTrackingService.TrackSuperFundPrefillViewedAsync(detail);
37
+ }
38
+ async componentWillLoad() {
39
+ if (this.prefill && this.prefill.fundDetail.type === 'Valid') {
40
+ this.initialiseComponent(this.prefill.fundDetail.fundName, this.prefill);
41
+ }
42
+ else {
43
+ // If prefill does not exist, or is invalid we should
44
+ // not have landed on this page, navigate to choice page
45
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
46
+ }
47
+ }
48
+ render() {
49
+ const errorMessages = [
50
+ this.memberNumber.errorMessage,
51
+ this.memberLastName.errorMessage,
52
+ this.memberGivenNames.errorMessage
53
+ ].filter((err) => err !== null);
54
+ return (h("div", null,
55
+ h(Header, null),
56
+ h("div", { class: "flex flex-col items-center gap-8 mt-8 sm:mt-12" },
57
+ h("div", { class: "flex max-w-[560px] flex-col items-start gap-6 p-6 border shadow-sm rounded-lg" },
58
+ h("div", { class: "flex flex-col items-start gap-3.5 self-stretch" },
59
+ h("div", { class: "self-stretch text-grey-900 text-lg not-italic font-bold leading-7" }, "Your fund details"),
60
+ h("sss-prefill-warning-box", { class: "self-stretch", notificationList: [
61
+ 'Make sure you are a current member of the fund before completing this step.',
62
+ 'Please check that the fund USI is correct as some funds have similar names.'
63
+ ] }),
64
+ this.mode === 'review' && errorMessages.length > 0 && (h("sss-prefill-error-box", { class: "self-stretch", notificationList: errorMessages, withHeader: true })),
65
+ this.mode === 'review' && (h("div", { class: "flex flex-col gap-3 self-stretch mt-4" },
66
+ h("sss-prefill-display-field", { field: this.fundUsi }),
67
+ h("sss-prefill-display-field", { field: this.fundName }),
68
+ h("sss-prefill-display-field", { field: this.memberNumber }),
69
+ h("sss-prefill-display-field", { field: this.memberLastName }),
70
+ h("sss-prefill-display-field", { field: this.memberGivenNames }))),
71
+ this.mode === 'review' && (h("sss-button", { testid: "edit-details-button", class: "self-stretch mt-3", fillWidth: true, variant: "secondary", promiseFn: () => this.setModeToEdit() },
72
+ h("div", { class: "flex flex-row gap-2" },
73
+ h("div", { class: "text-sm not-italic font-medium leading-4" }, "Edit details"),
74
+ h("div", { class: "w-4 h-4 relative" },
75
+ h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "16", viewBox: "0 0 17 16", fill: "currentColor" },
76
+ h("path", { d: "M11.369 2.86865C11.9939 2.24381 13.0069 2.24381 13.6318 2.86865C14.2566 3.49349 14.2566 4.50656 13.6318 5.1314L12.9974 5.76571L10.7347 3.50297L11.369 2.86865Z" }),
77
+ h("path", { d: "M9.60334 4.63434L2.90039 11.3373V13.6H5.16313L11.8661 6.89708L9.60334 4.63434Z" })))))),
78
+ this.mode === 'edit' && (h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: { 'was-validated': this.formState === 'validated' }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = this.formHasMissingData()) },
79
+ DisabledField(this.fundName.name, this.fundName.testId, this.fundName.value),
80
+ DisabledField(this.fundUsi.name, this.fundUsi.testId, this.fundUsi.value),
81
+ h("div", { class: "mt-3" },
82
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberNumber.name),
83
+ h("div", { class: "mt-1" },
84
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: "[A-Za-z0-9]{4,16}", "data-testid": this.memberNumber.testId, value: this.memberNumber.value, onInput: (ev) => {
85
+ this.updateMemberNumber(ev.target.value);
86
+ } }),
87
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberNumber.errorMessage))),
88
+ h("div", { class: "flex mt-3 gap-x-4 flex-col sm:flex-row" },
89
+ h("div", { class: "w-full sm:w-1/2" },
90
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberGivenNames.name),
91
+ h("div", { class: "mt-1" },
92
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: NAME_PATTERN, "data-testid": this.memberGivenNames.testId, value: this.memberGivenNames.value, onInput: (ev) => {
93
+ this.updateMemberGivenNames(ev.target.value);
94
+ } }),
95
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberGivenNames.errorMessage))),
96
+ h("div", { class: "w-full sm:w-1/2" },
97
+ h("label", { class: "text-sm font-medium text-gray-700" }, this.memberLastName.name),
98
+ h("div", { class: "mt-1" },
99
+ h("input", { type: "text", class: Style.Input(this.formState === 'validated'), required: true, pattern: NAME_PATTERN, "data-testid": this.memberLastName.testId, value: this.memberLastName.value, onInput: (ev) => {
100
+ this.updateMemberLastName(ev.target.value);
101
+ } }),
102
+ h("div", { class: "mt-2 text-sm text-red-600" }, this.formState === 'validated' && this.memberLastName.errorMessage)))))))),
103
+ h("div", { class: "flex w-full sm:w-80 max-w-[560px] flex-col items-start gap-4" },
104
+ h("sss-button", { testid: "continue-button", class: "self-stretch", fillWidth: true, variant: "primary", disabled: this.isSubmitDisabled, promiseFn: () => this.handleSubmitForm() }, "Continue"),
105
+ h("sss-button", { testid: "choose-another-fund-button", class: "self-stretch", fillWidth: true, variant: "secondary", promiseFn: () => this.handleFundNominationDeclined() }, "Choose another fund")))));
106
+ }
107
+ initialiseComponent(fundName, prefill) {
108
+ this.fundUsi = new FundUsi(prefill.fundDetail.fundUsi, true);
109
+ this.fundName = new FundName(fundName, true);
110
+ this.memberNumber = new MemberNumber(prefill.memberNumber);
111
+ this.memberGivenNames = new MemberGivenNames(prefill.memberFirstName);
112
+ this.memberLastName = new MemberLastName(prefill.memberFamilyName);
113
+ this.isSubmitDisabled = this.formHasMissingData();
114
+ }
115
+ isFormValid() {
116
+ return (this.fundUsi.isValid &&
117
+ this.fundName.isValid &&
118
+ this.memberNumber.isValid &&
119
+ this.memberGivenNames.isValid &&
120
+ this.memberLastName.isValid);
121
+ }
122
+ formHasMissingData() {
123
+ return (this.fundUsi.isEmpty ||
124
+ this.fundName.isEmpty ||
125
+ this.memberNumber.isEmpty ||
126
+ this.memberGivenNames.isEmpty ||
127
+ this.memberLastName.isEmpty);
128
+ }
129
+ setModeToEdit() {
130
+ this.mode = 'edit';
131
+ return Promise.resolve();
132
+ }
133
+ updateMemberNumber(memberNumber) {
134
+ this.memberNumber = new MemberNumber(memberNumber.trim());
135
+ }
136
+ updateMemberGivenNames(memberGivenNames) {
137
+ this.memberGivenNames = new MemberGivenNames(memberGivenNames.trimStart());
138
+ }
139
+ updateMemberLastName(memberLastName) {
140
+ this.memberLastName = new MemberLastName(memberLastName.trim());
141
+ }
142
+ async handleSubmitForm() {
143
+ this.formState = 'validated';
144
+ if (!this.isFormValid()) {
145
+ return;
146
+ }
147
+ if (this.mode === 'edit' && !this.formElement.checkValidity()) {
148
+ return;
149
+ }
150
+ navigationService.navigateInternallyToStandardChoice({
151
+ history: this.history,
152
+ fundName: this.fundName.value,
153
+ fundDetails: {
154
+ type: 'myOwnFund',
155
+ fundName: this.fundName.value,
156
+ fundUsi: this.fundUsi.value,
157
+ memberNumber: this.memberNumber.value
158
+ },
159
+ handleSubmitFn: async (standardChoiceFormSignature) => {
160
+ const customFundChoiceDto = Object.assign({ fundUsi: this.fundUsi.value, memberNumber: this.memberNumber.value, memberFirstName: this.memberGivenNames.value, memberFamilyName: this.memberLastName.value, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
161
+ await customFundChoiceApi.submitCustomFundChoiceAsync(customFundChoiceDto);
162
+ }
163
+ });
164
+ }
165
+ async handleFundNominationDeclined() {
166
+ const detail = this.createSuperFundPrefillDeclinedDetail(this.prefill);
167
+ await this.eventTrackingService.TrackSuperFundPrefillDeclinedAsync(detail);
168
+ return navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.ChoicePage);
169
+ }
170
+ static get is() { return "sss-prefill-my-own-fund"; }
171
+ static get properties() { return {
172
+ "history": {
173
+ "type": "unknown",
174
+ "mutable": false,
175
+ "complexType": {
176
+ "original": "RouterHistory",
177
+ "resolved": "RouterHistory",
178
+ "references": {
179
+ "RouterHistory": {
180
+ "location": "import",
181
+ "path": "@stencil/router"
182
+ }
183
+ }
184
+ },
185
+ "required": false,
186
+ "optional": false,
187
+ "docs": {
188
+ "tags": [],
189
+ "text": ""
190
+ }
191
+ },
192
+ "prefill": {
193
+ "type": "unknown",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "PrefillOwnFundChoiceDto",
197
+ "resolved": "{ fundDetail: { type: \"Valid\"; fundUsi: string; fundName: string; } | { type: \"Invalid\"; fundUsi: string; }; memberNumber: string | null; memberFirstName: string | null; memberFamilyName: string | null; }",
198
+ "references": {
199
+ "PrefillOwnFundChoiceDto": {
200
+ "location": "import",
201
+ "path": "../api/super-selection.api.dto"
202
+ }
203
+ }
204
+ },
205
+ "required": false,
206
+ "optional": false,
207
+ "docs": {
208
+ "tags": [],
209
+ "text": ""
210
+ }
211
+ }
212
+ }; }
213
+ static get states() { return {
214
+ "mode": {},
215
+ "formState": {},
216
+ "isSubmitDisabled": {},
217
+ "fundUsi": {},
218
+ "fundName": {},
219
+ "memberNumber": {},
220
+ "memberGivenNames": {},
221
+ "memberLastName": {}
222
+ }; }
223
+ }