@flarehr/apollo-super-selection 3.52.60060 → 3.53.61179

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 (162) hide show
  1. package/dist/lib/apollo-super-selection/apollo-super-selection.css +1 -0
  2. package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
  3. package/dist/lib/apollo-super-selection/apollo-super-selection.js +1 -1
  4. package/dist/lib/apollo-super-selection/assets/icon-check.svg +3 -0
  5. package/dist/lib/apollo-super-selection/assets/icon-exclamation.svg +3 -0
  6. package/dist/lib/apollo-super-selection/assets/icon-information-circle.svg +3 -0
  7. package/dist/lib/apollo-super-selection/p-03373b03.system.js +1 -0
  8. package/dist/lib/apollo-super-selection/p-14885f78.system.js +15 -0
  9. package/dist/lib/apollo-super-selection/{p-381262c1.system.js → p-15f0e5eb.system.js} +1 -1
  10. package/dist/lib/apollo-super-selection/p-29c11183.js +15 -0
  11. package/dist/lib/apollo-super-selection/p-6c94de60.system.entry.js +69 -0
  12. package/dist/lib/apollo-super-selection/p-74f91404.entry.js +14 -0
  13. package/dist/lib/apollo-super-selection/p-86e3e03f.js +1 -0
  14. package/dist/lib/cjs/apollo-super-selection.cjs.js +3 -4
  15. package/dist/lib/cjs/{app-globals-45007120.js → app-globals-b1125d8c.js} +1 -1
  16. package/dist/lib/cjs/{datorama-akita-7f4b082a.js → datorama-akita-6c9cb8fb.js} +1005 -68
  17. package/dist/lib/cjs/loader.cjs.js +3 -4
  18. package/dist/lib/cjs/{fl-button_31.cjs.entry.js → sss-button_28.cjs.entry.js} +2099 -2167
  19. package/dist/lib/collection/apollo-super-selection.css +1 -0
  20. package/dist/lib/collection/collection-manifest.json +16 -28
  21. package/dist/lib/collection/components/app-host/loading-page.js +3 -3
  22. package/dist/lib/collection/components/app-host/super-selection-app-host.css +0 -4
  23. package/dist/lib/collection/components/app-host/super-selection-app-host.js +7 -19
  24. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.dto.js +69 -1
  25. package/dist/lib/collection/components/super-selection-app/api/super-selection.api.js +9 -3
  26. package/dist/lib/collection/components/super-selection-app/app-state-pages/success.js +16 -21
  27. package/dist/lib/collection/components/super-selection-app/assets/icon-check.svg +3 -0
  28. package/dist/lib/collection/components/super-selection-app/assets/icon-exclamation.svg +3 -0
  29. package/dist/lib/collection/components/super-selection-app/assets/icon-information-circle.svg +3 -0
  30. package/dist/lib/collection/components/super-selection-app/consent/consent.js +57 -0
  31. package/dist/lib/collection/components/super-selection-app/existing-choice/existing-choice.js +132 -0
  32. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.js +6 -18
  33. package/dist/lib/collection/components/super-selection-app/funds/constants.js +50 -0
  34. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.js +31 -16
  35. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/custom-fund.store.js +10 -14
  36. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/default-fund/default-fund.js +36 -45
  37. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.js +40 -19
  38. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.js +45 -40
  39. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +104 -58
  40. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +53 -49
  41. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.js +6 -16
  42. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-join-page.js +1 -1
  43. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund.store.js +1 -4
  44. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/services/promoted-fund-join-iframe-builder.js +10 -4
  45. package/dist/lib/collection/components/super-selection-app/funds/slate-super/services/slate-iframe-builder.js +13 -4
  46. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-join-page.js +2 -3
  47. package/dist/lib/collection/components/super-selection-app/header-section/header-section.js +28 -0
  48. package/dist/lib/collection/components/super-selection-app/misc/button.js +146 -0
  49. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.css +7 -0
  50. package/dist/lib/collection/components/super-selection-app/misc/dropdown-async.js +359 -0
  51. package/dist/lib/collection/components/super-selection-app/misc/loading-indicator.js +52 -0
  52. package/dist/lib/collection/components/super-selection-app/services/australian-fund-lookup.service.js +8 -4
  53. package/dist/lib/collection/components/super-selection-app/services/event-tracking.service.js +20 -0
  54. package/dist/lib/collection/components/super-selection-app/services/existing-super-choice-info.service.js +95 -0
  55. package/dist/lib/collection/components/super-selection-app/services/navigation.service.js +8 -0
  56. package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +6 -4
  57. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.js +71 -34
  58. package/dist/lib/collection/components/super-selection-app/standard-choice/standard-choice-form.store.js +10 -0
  59. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.js +94 -0
  60. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.js +89 -0
  61. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.js +67 -90
  62. package/dist/lib/collection/components/super-selection-app/super-selection-app.css +16 -4
  63. package/dist/lib/collection/components/super-selection-app/super-selection-app.js +32 -11
  64. package/dist/lib/esm/apollo-super-selection.js +3 -4
  65. package/dist/lib/esm/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
  66. package/dist/lib/esm/{datorama-akita-79ce4385.js → datorama-akita-127aea91.js} +960 -28
  67. package/dist/lib/esm/loader.js +3 -4
  68. package/dist/lib/esm/{fl-button_31.entry.js → sss-button_28.entry.js} +2086 -2151
  69. package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
  70. package/dist/lib/esm-es5/{app-globals-7ac1ffba.js → app-globals-c1f89805.js} +1 -1
  71. package/dist/lib/esm-es5/datorama-akita-127aea91.js +15 -0
  72. package/dist/lib/esm-es5/loader.js +1 -1
  73. package/dist/lib/esm-es5/sss-button_28.entry.js +69 -0
  74. package/dist/lib/types/components/app-host/super-selection-app-host.d.ts +0 -3
  75. package/dist/lib/types/components/super-selection-app/api/super-selection-events.model.d.ts +30 -0
  76. package/dist/lib/types/components/super-selection-app/api/super-selection.api.d.ts +2 -1
  77. package/dist/lib/types/components/super-selection-app/api/super-selection.api.dto.d.ts +19 -4
  78. package/dist/lib/types/components/super-selection-app/consent/consent.d.ts +9 -0
  79. package/dist/lib/types/components/super-selection-app/existing-choice/existing-choice.d.ts +12 -0
  80. package/dist/lib/types/components/super-selection-app/footer-section/footer-section.d.ts +0 -1
  81. package/dist/lib/types/components/super-selection-app/funds/constants.d.ts +3 -0
  82. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.d.ts +1 -1
  83. package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +4 -6
  84. package/dist/lib/types/components/super-selection-app/funds/custom-fund/default-fund/default-fund.d.ts +0 -2
  85. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund-inputs.d.ts +2 -1
  86. package/dist/lib/types/components/super-selection-app/funds/custom-fund/my-own-fund/my-own-fund.d.ts +1 -0
  87. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +7 -0
  88. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +1 -0
  89. package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts +0 -1
  90. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund.store.d.ts +0 -3
  91. package/dist/lib/types/components/super-selection-app/header-section/header-section.d.ts +4 -0
  92. package/dist/lib/types/components/super-selection-app/misc/button.d.ts +11 -0
  93. package/dist/lib/types/components/super-selection-app/misc/dropdown-async.d.ts +44 -0
  94. package/dist/lib/types/components/super-selection-app/misc/loading-indicator.d.ts +5 -0
  95. package/dist/lib/types/components/super-selection-app/services/australian-fund-lookup.service.d.ts +1 -0
  96. package/dist/lib/types/components/super-selection-app/services/event-tracking.service.d.ts +4 -0
  97. package/dist/lib/types/components/super-selection-app/services/existing-super-choice-info.service.d.ts +51 -0
  98. package/dist/lib/types/components/super-selection-app/services/navigation.service.d.ts +6 -0
  99. package/dist/lib/types/components/super-selection-app/services/super-selection-app.routes.d.ts +3 -2
  100. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.d.ts +6 -3
  101. package/dist/lib/types/components/super-selection-app/standard-choice/standard-choice-form.store.d.ts +8 -0
  102. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-bottom.d.ts +9 -0
  103. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item/super-choice-item-top.d.ts +7 -0
  104. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-page.d.ts +0 -3
  105. package/dist/lib/types/components/super-selection-app/super-selection-app.d.ts +1 -1
  106. package/dist/lib/types/components.d.ts +146 -97
  107. package/package.json +12 -7
  108. package/dist/lib/apollo-super-selection/assets/logo-qsuper-square.png +0 -0
  109. package/dist/lib/apollo-super-selection/assets/logo-qsuper.png +0 -0
  110. package/dist/lib/apollo-super-selection/p-0623b20a.system.entry.js +0 -69
  111. package/dist/lib/apollo-super-selection/p-13573238.system.js +0 -15
  112. package/dist/lib/apollo-super-selection/p-342cee5a.js +0 -1
  113. package/dist/lib/apollo-super-selection/p-38f24f69.js +0 -1
  114. package/dist/lib/apollo-super-selection/p-64ebe17d.system.entry.js +0 -1
  115. package/dist/lib/apollo-super-selection/p-7dbe5a2f.system.js +0 -1
  116. package/dist/lib/apollo-super-selection/p-d82b00ed.system.js +0 -1
  117. package/dist/lib/apollo-super-selection/p-df9ce4b7.js +0 -15
  118. package/dist/lib/apollo-super-selection/p-f7a45412.entry.js +0 -1
  119. package/dist/lib/apollo-super-selection/p-fbe8c6d1.entry.js +0 -14
  120. package/dist/lib/cjs/delay-81aff2f1.js +0 -955
  121. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -90
  122. package/dist/lib/collection/components/super-selection-app/footer-section/footer-section.css +0 -11
  123. package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-not-supported.css +0 -23
  124. package/dist/lib/collection/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.js +0 -62
  125. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-fund.store.js +0 -10
  126. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slate-standard-choice-page.js +0 -67
  127. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.css +0 -0
  128. package/dist/lib/collection/components/super-selection-app/funds/slate-super/slatesuper-header.js +0 -19
  129. package/dist/lib/collection/components/super-selection-app/notifications-section/notifications-section.js +0 -25
  130. package/dist/lib/collection/components/super-selection-app/services/notifications.service.js +0 -37
  131. package/dist/lib/collection/components/super-selection-app/services/notifications.store.js +0 -3
  132. package/dist/lib/collection/components/super-selection-app/services/selected-super-choice-info.service.js +0 -50
  133. package/dist/lib/collection/components/super-selection-app/standard-choice/api/standard-choice.model.js +0 -1
  134. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper-square.png +0 -0
  135. package/dist/lib/collection/components/super-selection-app/super-choice-page/assets/logo-qsuper.png +0 -0
  136. package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.css +0 -18
  137. package/dist/lib/collection/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.js +0 -53
  138. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-item.js +0 -296
  139. package/dist/lib/collection/components/super-selection-app/super-choice-page/super-choice-page.css +0 -70
  140. package/dist/lib/esm/delay-c0555599.js +0 -935
  141. package/dist/lib/esm/fl-style-guide.entry.js +0 -86
  142. package/dist/lib/esm-es5/datorama-akita-79ce4385.js +0 -15
  143. package/dist/lib/esm-es5/delay-c0555599.js +0 -1
  144. package/dist/lib/esm-es5/fl-button_31.entry.js +0 -69
  145. package/dist/lib/esm-es5/fl-style-guide.entry.js +0 -1
  146. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  147. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  148. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  149. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  150. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  151. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  152. package/dist/lib/types/components/super-selection-app/funds/promoted-fund/promoted-fund-standard-choice-page.d.ts +0 -8
  153. package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-fund.store.d.ts +0 -7
  154. package/dist/lib/types/components/super-selection-app/funds/slate-super/slate-standard-choice-page.d.ts +0 -8
  155. package/dist/lib/types/components/super-selection-app/funds/slate-super/slatesuper-header.d.ts +0 -3
  156. package/dist/lib/types/components/super-selection-app/notifications-section/notifications-section.d.ts +0 -5
  157. package/dist/lib/types/components/super-selection-app/services/notifications.service.d.ts +0 -15
  158. package/dist/lib/types/components/super-selection-app/services/notifications.store.d.ts +0 -14
  159. package/dist/lib/types/components/super-selection-app/services/selected-super-choice-info.service.d.ts +0 -18
  160. package/dist/lib/types/components/super-selection-app/standard-choice/api/standard-choice.model.d.ts +0 -3
  161. package/dist/lib/types/components/super-selection-app/super-choice-page/selected-super-choice-section/selected-super-choice-section.d.ts +0 -5
  162. package/dist/lib/types/components/super-selection-app/super-choice-page/super-choice-item.d.ts +0 -22
@@ -0,0 +1,95 @@
1
+ import { isSome, none, some } from 'fp-ts/Option';
2
+ import { buildBackendApiClient } from '../api/api-client';
3
+ import { getSuperChoiceMemberNumber, getSuperChoiceUsi } from '../api/super-selection.api.dto';
4
+ import * as constants from '../funds/constants';
5
+ import australianFundLookupService from './australian-fund-lookup.service';
6
+ import superSelectionAppService from './super-selection-app.service';
7
+ export function ExistingFund(fund) {
8
+ if (isSome(fund)) {
9
+ return fund.value.isActive ? 'Active' : 'Inactive';
10
+ }
11
+ else {
12
+ return 'Unknown';
13
+ }
14
+ }
15
+ export class ExistingFundService {
16
+ async GetExistingFundAsync() {
17
+ var _a, _b;
18
+ const choice = superSelectionAppService.superBuyer.superChoice;
19
+ const choiceDetails = (_a = superSelectionAppService.superBuyer.superChoice) === null || _a === void 0 ? void 0 : _a.choiceDetails;
20
+ if (!choice)
21
+ return none;
22
+ if (!choiceDetails)
23
+ return none;
24
+ const dateSubmitted = choice.dateSubmitted == undefined ? none : some(new Date(choice.dateSubmitted));
25
+ const usi = getSuperChoiceUsi(choiceDetails);
26
+ const memberNumber = getSuperChoiceMemberNumber(choiceDetails);
27
+ if ('promoted' in choiceDetails) {
28
+ const fund = constants.PromotedFundIdList.find((f) => f.dtoPropName in choiceDetails.promoted);
29
+ if ((fund === null || fund === void 0 ? void 0 : fund.id) == undefined)
30
+ return none;
31
+ return some({
32
+ type: 'Promoted Fund',
33
+ id: fund.id,
34
+ name: (_b = constants.getFundNameById(fund.id)) !== null && _b !== void 0 ? _b : '',
35
+ usi: usi,
36
+ valid: 'Active',
37
+ memberNumber: memberNumber,
38
+ lastNominatedAt: dateSubmitted
39
+ });
40
+ }
41
+ else if ('smsf' in choiceDetails) {
42
+ return some({
43
+ type: 'Self Managed Fund',
44
+ name: choiceDetails.smsf.fundName,
45
+ valid: 'Unknown',
46
+ lastNominatedAt: dateSubmitted
47
+ });
48
+ }
49
+ else if ('myOwnFund' in choiceDetails) {
50
+ const fundUsi = choiceDetails.myOwnFund.usi;
51
+ const fund = await this.getFundByUsiAsync(fundUsi);
52
+ return some({
53
+ type: 'My Own Fund',
54
+ name: isSome(fund) ? fund.value.productName : fundUsi,
55
+ usi: usi,
56
+ valid: this.toFundValidState(fund),
57
+ memberNumber: memberNumber,
58
+ lastNominatedAt: dateSubmitted
59
+ });
60
+ }
61
+ else if ('default' in choiceDetails) {
62
+ const defaultUsi = choiceDetails.default.usi;
63
+ const defaultFund = await this.getFundByUsiAsync(defaultUsi);
64
+ return some({
65
+ type: 'Default Fund',
66
+ name: isSome(defaultFund) ? defaultFund.value.productName : defaultUsi,
67
+ usi: usi,
68
+ valid: this.toFundValidState(defaultFund),
69
+ lastNominatedAt: dateSubmitted
70
+ });
71
+ }
72
+ return none;
73
+ }
74
+ async submitRetainSuperFundAsync(dto) {
75
+ return buildBackendApiClient()
76
+ .url('super-choice/retain-super-fund')
77
+ .post(dto)
78
+ .badRequest(() => {
79
+ throw new Error('Failed to process default fund join request');
80
+ })
81
+ .text();
82
+ }
83
+ getFundByUsiAsync(usi) {
84
+ return australianFundLookupService.getFundByUsiAsync(usi);
85
+ }
86
+ toFundValidState(fund) {
87
+ if (isSome(fund)) {
88
+ return fund.value.isActive ? 'Active' : 'Inactive';
89
+ }
90
+ else {
91
+ return 'Unknown';
92
+ }
93
+ }
94
+ }
95
+ export default new ExistingFundService();
@@ -1,4 +1,6 @@
1
1
  import iframe from '../../../utils/iframe';
2
+ import standardChoiceFormState from './../standard-choice/standard-choice-form.store';
3
+ import { SuperSelectionAppRoutes } from './super-selection-app.routes';
2
4
  import superSelectionAppService from './super-selection-app.service';
3
5
  class NavigationService {
4
6
  navigateInternally(history, route) {
@@ -6,6 +8,12 @@ class NavigationService {
6
8
  iframe.navigation(path);
7
9
  history.push(path);
8
10
  }
11
+ navigateInternallyToStandardChoice(options) {
12
+ standardChoiceFormState.handleSubmitFn = options.handleSubmitFn;
13
+ standardChoiceFormState.fundName = options.fundName;
14
+ standardChoiceFormState.promotedFundId = options.promotedFundId;
15
+ this.navigateInternally(options.history, SuperSelectionAppRoutes.StandardChoice);
16
+ }
9
17
  toExternalUrl(url) {
10
18
  const externalUrl = new URL(url);
11
19
  externalUrl.searchParams.append('_extnav', 'true');
@@ -1,24 +1,26 @@
1
1
  import { h } from '@stencil/core';
2
2
  export var SuperSelectionAppRoutes;
3
3
  (function (SuperSelectionAppRoutes) {
4
+ SuperSelectionAppRoutes["ConsentPage"] = "/consent";
5
+ SuperSelectionAppRoutes["ExistingChoicePage"] = "/existing";
4
6
  SuperSelectionAppRoutes["ChoicePage"] = "/";
5
7
  SuperSelectionAppRoutes["SlateJoin"] = "/slate/join/";
6
- SuperSelectionAppRoutes["SlateStandardChoice"] = "/slate/standard-choice/";
7
8
  SuperSelectionAppRoutes["PromotedFundJoin"] = "/promoted-fund/join";
8
- SuperSelectionAppRoutes["PromotedFundStandardChoice"] = "/promoted-fund/standard-choice/";
9
9
  SuperSelectionAppRoutes["MyOwnFund"] = "/super-choice/my-own-fund/";
10
10
  SuperSelectionAppRoutes["SelfManagedFund"] = "/super-choice/smsf/";
11
11
  SuperSelectionAppRoutes["DefaultFund"] = "/super-choice/default/";
12
+ SuperSelectionAppRoutes["StandardChoice"] = "/standard-choice/";
12
13
  SuperSelectionAppRoutes["Success"] = "/success/";
13
14
  })(SuperSelectionAppRoutes || (SuperSelectionAppRoutes = {}));
14
15
  export const superSelectionAppStencilRoutes = [
16
+ h("stencil-route", { url: SuperSelectionAppRoutes.ConsentPage, component: "sss-consent-page" }),
17
+ h("stencil-route", { url: SuperSelectionAppRoutes.ExistingChoicePage, component: "sss-existing-choice-page" }),
15
18
  h("stencil-route", { exact: true, url: SuperSelectionAppRoutes.ChoicePage, component: "sss-super-choice-page" }),
16
19
  h("stencil-route", { url: SuperSelectionAppRoutes.SlateJoin, component: "sss-slate-join-page" }),
17
- h("stencil-route", { url: SuperSelectionAppRoutes.SlateStandardChoice, component: "sss-slate-standard-choice-page" }),
18
20
  h("stencil-route", { url: SuperSelectionAppRoutes.PromotedFundJoin, component: "sss-promoted-fund-join-page" }),
19
- h("stencil-route", { url: SuperSelectionAppRoutes.PromotedFundStandardChoice, component: "sss-promoted-fund-standard-choice-page" }),
20
21
  h("stencil-route", { url: SuperSelectionAppRoutes.MyOwnFund, component: "sss-my-own-fund" }),
21
22
  h("stencil-route", { url: SuperSelectionAppRoutes.SelfManagedFund, component: "sss-self-managed-fund" }),
22
23
  h("stencil-route", { url: SuperSelectionAppRoutes.DefaultFund, component: "sss-default-fund" }),
24
+ h("stencil-route", { url: SuperSelectionAppRoutes.StandardChoice, component: "sss-standard-choice-form" }),
23
25
  h("stencil-route", { url: SuperSelectionAppRoutes.Success, component: "sss-success" })
24
26
  ];
@@ -1,49 +1,86 @@
1
- import { Component, Event, h, State } from '@stencil/core';
1
+ import { Component, getAssetPath, h, Host, Prop, State } from '@stencil/core';
2
+ import { getLogoSrc } from '../funds/constants';
3
+ import navigationService from '../services/navigation.service';
4
+ import { SuperSelectionAppRoutes } from '../services/super-selection-app.routes';
5
+ import superSelectionAppService from '../services/super-selection-app.service';
6
+ import standardChoiceFormState from './standard-choice-form.store';
2
7
  export class StandardChoiceFormInputDefaultFund {
3
8
  constructor() {
4
- this.standardChoiceFormUrl = '/super-selection/embed/v1.0/app/assets/Superannuation_Standard_Choice_Form.pdf';
5
9
  this.standardChoiceFormSignature = '';
10
+ this.isSubmitDisabled = true;
6
11
  }
7
12
  render() {
8
- return (h("div", { class: "card p-4 mt-4 bg-light" },
9
- h("h4", { class: "small font-weight-bold" }, "Superannuation Standard Choice Form"),
10
- h("p", { class: "small mt-2" },
11
- "The superannuation",
12
- ' ',
13
- h("a", { target: "_blank", href: this.standardChoiceFormUrl }, "standard choice form"),
14
- ' ',
15
- "informs your employer of your choice of fund."),
16
- h("h4", { class: "small font-weight-bold" }, "Type your full name below (required)"),
17
- h("input", { placeholder: "Type your full name", type: "text", autocomplete: "off", class: "form-control", required: true, minlength: "2", name: "standardChoiceFormSignature", id: "standardChoiceFormSignature", value: this.standardChoiceFormSignature, onChange: (ev) => this.updateFormField(ev.target.value.trim()) }),
18
- h("div", { class: "invalid-feedback" }, "Type your full name"),
19
- h("p", { class: "small mt-3 mb-0" }, "Your authorisation is required for signing this form. Applying your full name in the text field above is the same as applying your written signature and is legally binding.")));
13
+ return (h(Host, null,
14
+ h("div", { class: "text-2xl sm:text-3xl font-bold text-center" }, "Confirm your super choice"),
15
+ h("div", { class: "sm:text-lg font-gray-600 max-w-800 mt-4 text-center leading-7 sm:leading-8" }, "Your authorisation is required to complete your super choice by signing the standard choice form, which informs your employer of your choice of fund."),
16
+ h("div", { class: "flex justify-center mt-8 sm:mt-12" },
17
+ h("div", { class: "max-w-560" },
18
+ h("div", { class: "p-4 sm:p-6 border shadow-sm rounded-lg flex flex-col sm:flex-row" },
19
+ standardChoiceFormState.promotedFundId &&
20
+ getLogoSrc(standardChoiceFormState.promotedFundId) && (h("div", { class: "pb-4 mb-4 border-b flex justify-center sm:pb-0 sm:mb-0 sm:border-b-0 sm:pr-8 sm:mr-8 sm:border-r sm:justify-start" },
21
+ h("img", { class: "h-16 w-auto", alt: standardChoiceFormState.fundName, src: getLogoSrc(standardChoiceFormState.promotedFundId) }))),
22
+ h("div", { class: "flex justify-between w-full" },
23
+ h("div", null,
24
+ h("div", { class: "text-xs font-semibold text-gray-500 sm:uppercase" }, "Nominated fund"),
25
+ h("div", { class: "text-sm mt-2" }, standardChoiceFormState.fundName)),
26
+ h("div", { class: "grid content-center ml-4" },
27
+ h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
28
+ h("sss-button", { variant: "secondary" }, "Change"))))),
29
+ h("div", { class: "mt-4 p-4 sm:p-6 border shadow-sm rounded-lg" },
30
+ h("div", { class: "sm:text-lg font-bold" }, "Superannuation Standard Choice Form"),
31
+ h("div", { class: "bg-blue-50 border-l-4 border-blue-400 p-4 mt-3" },
32
+ h("div", { class: "flex" },
33
+ h("div", { class: "flex-shrink-0" },
34
+ h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-information-circle.svg') })),
35
+ h("div", { class: "ml-2" },
36
+ h("p", { class: "text-sm text-blue-800 leading-5" }, "Applying your full name in the text field below is the same as applying your written signature and is legally binding.")))),
37
+ h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
38
+ 'mt-3': true,
39
+ 'was-validated': this.formState === 'validated'
40
+ }, ref: (el) => (this.formElement = el), onInput: (_) => (this.isSubmitDisabled = !this.formElement.checkValidity()) },
41
+ h("label", { class: "text-sm font-medium text-gray-700" }, "Type your full name"),
42
+ h("input", { type: "text", autocomplete: "off", class: {
43
+ 'shadow-sm focus:ring-primary-focus focus:border-primary-focus w-full text-sm border-gray-300 rounded-md mt-1': true,
44
+ 'invalid:border-red-300 invalid:text-red-900 invalid:focus:ring-red-500 invalid:focus:border-red-500': this.formState === 'validated'
45
+ }, required: true, minlength: "2", name: "standardChoiceFormSignature", id: "standardChoiceFormSignature", value: this.standardChoiceFormSignature }),
46
+ h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Type your full name"),
47
+ h("div", { class: "mt-6" },
48
+ h("sss-button", { fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Confirm and continue"))))))));
20
49
  }
21
- updateFormField(value) {
22
- this.standardChoiceFormSignatureUpdated.emit({ standardChoiceFormSignature: value });
50
+ async handleSubmitForm() {
51
+ this.formState = 'validated';
52
+ if (this.formElement.checkValidity()) {
53
+ await standardChoiceFormState.handleSubmitFn(this.standardChoiceFormSignature.trim());
54
+ superSelectionAppService.markSuperSelectionAsSubmitted();
55
+ navigationService.navigateInternally(this.history, SuperSelectionAppRoutes.Success);
56
+ }
23
57
  }
24
58
  static get is() { return "sss-standard-choice-form"; }
25
- static get states() { return {
26
- "standardChoiceFormSignature": {}
27
- }; }
28
- static get events() { return [{
29
- "method": "standardChoiceFormSignatureUpdated",
30
- "name": "standardChoiceFormSignatureUpdated",
31
- "bubbles": true,
32
- "cancelable": true,
33
- "composed": true,
34
- "docs": {
35
- "tags": [],
36
- "text": ""
37
- },
59
+ static get properties() { return {
60
+ "history": {
61
+ "type": "unknown",
62
+ "mutable": false,
38
63
  "complexType": {
39
- "original": "StandardChoiceInput",
40
- "resolved": "{ standardChoiceFormSignature: string; }",
64
+ "original": "RouterHistory",
65
+ "resolved": "RouterHistory",
41
66
  "references": {
42
- "StandardChoiceInput": {
67
+ "RouterHistory": {
43
68
  "location": "import",
44
- "path": "./api/standard-choice.model"
69
+ "path": "@stencil/router"
45
70
  }
46
71
  }
72
+ },
73
+ "required": false,
74
+ "optional": false,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": ""
47
78
  }
48
- }]; }
79
+ }
80
+ }; }
81
+ static get states() { return {
82
+ "standardChoiceFormSignature": {},
83
+ "formState": {},
84
+ "isSubmitDisabled": {}
85
+ }; }
49
86
  }
@@ -0,0 +1,10 @@
1
+ import { createStore } from '@stencil/store';
2
+ export const initial = {
3
+ handleSubmitFn: async function () {
4
+ return;
5
+ },
6
+ fundName: '',
7
+ promotedFundId: undefined
8
+ };
9
+ const { state } = createStore(initial);
10
+ export default state;
@@ -0,0 +1,94 @@
1
+ import { Component, Event, h, Host, Prop } from '@stencil/core';
2
+ export class SuperChoiceItemBottom {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("div", { class: "py-6 px-4 lg:px-6 flex flex-col justify-between h-full" },
6
+ h("div", null,
7
+ h("div", { class: "md:max-w-[240px] lg:max-w-full" },
8
+ h("sss-button", { class: "uuid-button-continue", fillWidth: true, onClick: () => this.handleFundClick() }, "Choose this fund")),
9
+ h("div", { class: "text-xs text-gray-500 mt-6 leading-4" }, this.disclaimer)),
10
+ this.abnInfo && this.abn && (h("div", { class: "text-xs text-gray-500 mt-2" },
11
+ h("p", null,
12
+ this.abnInfo,
13
+ "."),
14
+ h("p", null,
15
+ "ABN: ",
16
+ this.abn))))));
17
+ }
18
+ handleFundClick() {
19
+ return this.joinFundClicked.emit();
20
+ }
21
+ static get is() { return "sss-super-choice-item-bottom"; }
22
+ static get properties() { return {
23
+ "disclaimer": {
24
+ "type": "unknown",
25
+ "mutable": false,
26
+ "complexType": {
27
+ "original": "VNode",
28
+ "resolved": "VNode",
29
+ "references": {
30
+ "VNode": {
31
+ "location": "import",
32
+ "path": "@stencil/core"
33
+ }
34
+ }
35
+ },
36
+ "required": false,
37
+ "optional": false,
38
+ "docs": {
39
+ "tags": [],
40
+ "text": ""
41
+ }
42
+ },
43
+ "abnInfo": {
44
+ "type": "string",
45
+ "mutable": false,
46
+ "complexType": {
47
+ "original": "string",
48
+ "resolved": "string | undefined",
49
+ "references": {}
50
+ },
51
+ "required": false,
52
+ "optional": true,
53
+ "docs": {
54
+ "tags": [],
55
+ "text": ""
56
+ },
57
+ "attribute": "abn-info",
58
+ "reflect": false
59
+ },
60
+ "abn": {
61
+ "type": "string",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "string",
65
+ "resolved": "string | undefined",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": true,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": ""
73
+ },
74
+ "attribute": "abn",
75
+ "reflect": false
76
+ }
77
+ }; }
78
+ static get events() { return [{
79
+ "method": "joinFundClicked",
80
+ "name": "joinFundClicked",
81
+ "bubbles": true,
82
+ "cancelable": true,
83
+ "composed": true,
84
+ "docs": {
85
+ "tags": [],
86
+ "text": ""
87
+ },
88
+ "complexType": {
89
+ "original": "void",
90
+ "resolved": "void",
91
+ "references": {}
92
+ }
93
+ }]; }
94
+ }
@@ -0,0 +1,89 @@
1
+ import { Component, getAssetPath, h, Host, Prop } from '@stencil/core';
2
+ export class SuperChoiceItemTop {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("div", { class: "px-4 lg:px-6 pt-6" },
6
+ h("div", { class: "text-right w-100 -mt-5 -mr-3.5 lg:-mr-5" },
7
+ h("span", { class: "text-xs bg-gray-100 text-gray-800 font-medium rounded-xl py-0.5 px-2.5 mr-0.5" }, "Advertised")),
8
+ h("div", { class: "flex lg:block mt-2 md:mt-0 lg:mt-2" },
9
+ h("img", { class: "h-16 object-contain w-auto max-w-[80px] md:hidden lg:block lg:max-w-none", alt: this.name, src: getAssetPath(`assets/${this.logo}`) }),
10
+ h("div", { class: "grid content-center" },
11
+ h("p", { class: "text-lg font-bold ml-4 mb-2 md:ml-0 md:mb-0 lg:mt-4" }, this.name))),
12
+ h("div", { class: "mt-4 text-sm space-y-2" }, JSON.parse(this.features).map((feature) => (h("div", { class: "flex" },
13
+ h("div", { class: "h-5 w-5 flex-none mr-1.5" },
14
+ h("img", { src: getAssetPath(`assets/icon-check.svg`) })),
15
+ h("p", { class: "leading-5" }, feature.value))))),
16
+ this.featureSubText && (h("p", { class: "text-xs text-gray-500 italic mt-4 leading-4" }, this.featureSubText)))));
17
+ }
18
+ static get is() { return "sss-super-choice-item-top"; }
19
+ static get properties() { return {
20
+ "name": {
21
+ "type": "string",
22
+ "mutable": false,
23
+ "complexType": {
24
+ "original": "string",
25
+ "resolved": "string",
26
+ "references": {}
27
+ },
28
+ "required": false,
29
+ "optional": false,
30
+ "docs": {
31
+ "tags": [],
32
+ "text": ""
33
+ },
34
+ "attribute": "name",
35
+ "reflect": false
36
+ },
37
+ "logo": {
38
+ "type": "string",
39
+ "mutable": false,
40
+ "complexType": {
41
+ "original": "string",
42
+ "resolved": "string",
43
+ "references": {}
44
+ },
45
+ "required": false,
46
+ "optional": false,
47
+ "docs": {
48
+ "tags": [],
49
+ "text": ""
50
+ },
51
+ "attribute": "logo",
52
+ "reflect": false
53
+ },
54
+ "features": {
55
+ "type": "string",
56
+ "mutable": false,
57
+ "complexType": {
58
+ "original": "string",
59
+ "resolved": "string",
60
+ "references": {}
61
+ },
62
+ "required": false,
63
+ "optional": false,
64
+ "docs": {
65
+ "tags": [],
66
+ "text": ""
67
+ },
68
+ "attribute": "features",
69
+ "reflect": false
70
+ },
71
+ "featureSubText": {
72
+ "type": "string",
73
+ "mutable": false,
74
+ "complexType": {
75
+ "original": "string",
76
+ "resolved": "string | undefined",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": true,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": ""
84
+ },
85
+ "attribute": "feature-sub-text",
86
+ "reflect": false
87
+ }
88
+ }; }
89
+ }