@flarehr/apollo-super-selection 5.45.6971 → 5.47.7839
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.
- package/dist/lib/apollo-super-selection/apollo-super-selection.esm.js +1 -1
- package/dist/lib/apollo-super-selection/p-a73e1187.entry.js +14 -0
- package/dist/lib/apollo-super-selection/p-bc31a299.system.entry.js +69 -0
- package/dist/lib/apollo-super-selection/p-bdcfc026.system.js +1 -1
- package/dist/lib/cjs/apollo-super-selection.cjs.js +1 -1
- package/dist/lib/cjs/loader.cjs.js +1 -1
- package/dist/lib/cjs/{sss-button_34.cjs.entry.js → sss-button_33.cjs.entry.js} +103 -205
- package/dist/lib/collection/collection-manifest.json +3 -5
- package/dist/lib/collection/components/super-selection-app/services/super-selection-app.routes.js +1 -1
- package/dist/lib/collection/components/super-smsf/super-smsf-types.js +1 -0
- package/dist/lib/collection/components/super-smsf/super-smsf.js +136 -0
- package/dist/lib/esm/apollo-super-selection.js +1 -1
- package/dist/lib/esm/loader.js +1 -1
- package/dist/lib/esm/{sss-button_34.entry.js → sss-button_33.entry.js} +103 -204
- package/dist/lib/esm-es5/apollo-super-selection.js +1 -1
- package/dist/lib/esm-es5/loader.js +1 -1
- package/dist/lib/esm-es5/sss-button_33.entry.js +69 -0
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/custom-fund.store.d.ts +1 -1
- package/dist/lib/types/components/super-smsf/super-smsf-types.d.ts +34 -0
- package/dist/lib/types/components/super-smsf/super-smsf.d.ts +18 -0
- package/dist/lib/types/components.d.ts +15 -35
- package/package.json +1 -1
- package/dist/lib/apollo-super-selection/p-44edd355.system.entry.js +0 -69
- package/dist/lib/apollo-super-selection/p-46cf321a.entry.js +0 -14
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.js +0 -253
- package/dist/lib/collection/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.js +0 -121
- package/dist/lib/esm-es5/sss-button_34.entry.js +0 -69
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund-inputs.d.ts +0 -29
- package/dist/lib/types/components/super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.d.ts +0 -14
- /package/dist/lib/collection/components/{super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.js → super-smsf/super-smsf.form.js} +0 -0
- /package/dist/lib/types/components/{super-selection-app/funds/custom-fund/self-managed-fund/self-managed-fund.form.d.ts → super-smsf/super-smsf.form.d.ts} +0 -0
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { Component, Event, h, Prop, State } from '@stencil/core';
|
|
2
|
-
import { isNone, isSome, none, some } from 'fp-ts/Option';
|
|
3
|
-
import customFundChoiceApi from '../api/custom-fund-choice.api';
|
|
4
|
-
import customFundState from '../custom-fund.store';
|
|
5
|
-
import { validateAbn } from './abn-validation';
|
|
6
|
-
import bsbNumbers from './bankBsbNumbers';
|
|
7
|
-
var AbnValidationStatus;
|
|
8
|
-
(function (AbnValidationStatus) {
|
|
9
|
-
AbnValidationStatus[AbnValidationStatus["Invalid"] = 1] = "Invalid";
|
|
10
|
-
AbnValidationStatus[AbnValidationStatus["AbnIsUsedForRegulatedFund"] = 2] = "AbnIsUsedForRegulatedFund";
|
|
11
|
-
AbnValidationStatus[AbnValidationStatus["Valid"] = 3] = "Valid";
|
|
12
|
-
})(AbnValidationStatus || (AbnValidationStatus = {}));
|
|
13
|
-
export class SelfManagedFundInputs {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.abnValidationStatus = AbnValidationStatus.Invalid;
|
|
16
|
-
this.isAbnTouched = false;
|
|
17
|
-
this.currentBank = none;
|
|
18
|
-
this.addressErrorMessage = none;
|
|
19
|
-
this.stateOptions = [
|
|
20
|
-
{ value: 'NSW', label: 'NSW' },
|
|
21
|
-
{ value: 'QLD', label: 'QLD' },
|
|
22
|
-
{ value: 'ACT', label: 'ACT' },
|
|
23
|
-
{ value: 'VIC', label: 'VIC' },
|
|
24
|
-
{ value: 'TAS', label: 'TAS' },
|
|
25
|
-
{ value: 'WA', label: 'WA' },
|
|
26
|
-
{ value: 'SA', label: 'SA' },
|
|
27
|
-
{ value: 'NT', label: 'NT' }
|
|
28
|
-
];
|
|
29
|
-
this.bsbRegex = new RegExp(/^[0-9]{3}[0-9]{3}$/);
|
|
30
|
-
this.bankAccountNumberRegex = new RegExp(/^[0-9]{2,10}$/);
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
const inputClass = {
|
|
34
|
-
'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,
|
|
35
|
-
'invalid:border-red-300 invalid:text-red-900 invalid:placeholder-red-300 invalid:focus:ring-red-500 invalid:focus:border-red-500': this
|
|
36
|
-
.showValidationErrors
|
|
37
|
-
};
|
|
38
|
-
return (h("div", null,
|
|
39
|
-
h("div", null,
|
|
40
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund name"),
|
|
41
|
-
h("div", { class: "mt-1" },
|
|
42
|
-
h("input", { type: "text", class: inputClass, required: true, minlength: "2", name: "fundName", id: "fundName", value: customFundState.selfManagedFundForm.fundName, onChange: (ev) => this.updateFormField('fundName', ev.target.value.trim()) }),
|
|
43
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid fund name"))),
|
|
44
|
-
h("div", { class: "mt-3" },
|
|
45
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund ABN"),
|
|
46
|
-
h("div", { class: "mt-1" },
|
|
47
|
-
h("input", { type: "text", class: inputClass, required: true, minlength: "2", name: "fundAbn", id: "fundAbn", value: customFundState.selfManagedFundForm.fundAbn, inputmode: "numeric", pattern: "[0-9]*", onKeyUp: async (ev) => {
|
|
48
|
-
const abnInput = ev.target;
|
|
49
|
-
this.updateFormField('fundAbn', abnInput.value.trim());
|
|
50
|
-
this.abnValidationStatus = AbnValidationStatus.Invalid;
|
|
51
|
-
if (validateAbn(abnInput.value)) {
|
|
52
|
-
const isAbnUsedForRegulatedFund = await this.isAbnUsedForRegulatedAsync(abnInput.value);
|
|
53
|
-
this.abnValidationStatus = isAbnUsedForRegulatedFund
|
|
54
|
-
? AbnValidationStatus.AbnIsUsedForRegulatedFund
|
|
55
|
-
: AbnValidationStatus.Valid;
|
|
56
|
-
}
|
|
57
|
-
// We need to set a custom validity message to trigger css invalid styles for non valid cases
|
|
58
|
-
const validityMessage = this.abnValidationStatus === AbnValidationStatus.Valid
|
|
59
|
-
? ''
|
|
60
|
-
: 'Enter a valid fund ABN (digits only)';
|
|
61
|
-
abnInput.setCustomValidity(validityMessage);
|
|
62
|
-
this.updateFormField('isAbnValid', this.abnValidationStatus === AbnValidationStatus.Valid);
|
|
63
|
-
}, onBlur: () => (this.isAbnTouched = true) }),
|
|
64
|
-
this.renderAbnValidationError())),
|
|
65
|
-
h("div", { class: "mt-3" },
|
|
66
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Electronic service address alias (ESA)"),
|
|
67
|
-
h("div", { class: "mt-1" },
|
|
68
|
-
h("input", { type: "text", class: inputClass, required: true, minlength: "2", name: "fundEsa", id: "fundEsa", value: customFundState.selfManagedFundForm.fundEsa, onChange: (ev) => this.updateFormField('fundEsa', ev.target.value.trim()) }),
|
|
69
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid fund ESA"))),
|
|
70
|
-
h("div", { class: "mt-3" },
|
|
71
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Fund address"),
|
|
72
|
-
h("div", { class: "mt-1 rounded-md shadow-sm -space-y-px" },
|
|
73
|
-
h("input", { placeholder: "Address line 1", type: "text", class: Object.assign(Object.assign({}, inputClass), { 'rounded-none rounded-t-md shadow-none': true }), required: true, minlength: "2", name: "addressLine1", id: "addressLine1", value: customFundState.selfManagedFundForm.addressLine1, onChange: (ev) => {
|
|
74
|
-
this.updateFormField('addressLine1', ev.target.value.trim());
|
|
75
|
-
this.updateAddressErrorMessage();
|
|
76
|
-
}, ref: (el) => (this.addressLine1Element = el) }),
|
|
77
|
-
h("input", { placeholder: "Address line 2 (optional)", type: "text", class: Object.assign(Object.assign({}, inputClass), { 'rounded-none shadow-none': true }), name: "addressLine2", id: "addressLine2", value: customFundState.selfManagedFundForm.addressLine2, onChange: (ev) => this.updateFormField('addressLine2', ev.target.value.trim()) }),
|
|
78
|
-
h("input", { placeholder: "City/suburb", type: "text", class: Object.assign(Object.assign({}, inputClass), { 'rounded-none shadow-none': true }), name: "city", required: true, id: "city", value: customFundState.selfManagedFundForm.city, onChange: (ev) => {
|
|
79
|
-
this.updateFormField('city', ev.target.value.trim());
|
|
80
|
-
this.updateAddressErrorMessage();
|
|
81
|
-
}, ref: (el) => (this.cityElement = el) }),
|
|
82
|
-
h("div", { class: "flex -space-x-px" },
|
|
83
|
-
h("div", { class: "w-1/2 flex-1 min-w-0" },
|
|
84
|
-
h("input", { placeholder: "Postcode", type: "text", required: true, class: Object.assign(Object.assign({}, inputClass), { 'rounded-none rounded-bl-md shadow-none': true }), name: "postcode", minlength: "4", maxlength: "4", pattern: "[0-9]{4}", id: "postcode", value: customFundState.selfManagedFundForm.postcode, inputmode: "numeric", onChange: (ev) => {
|
|
85
|
-
this.updateFormField('postcode', ev.target.value.trim());
|
|
86
|
-
this.updateAddressErrorMessage();
|
|
87
|
-
}, ref: (el) => (this.postcodeElement = el) })),
|
|
88
|
-
h("div", { class: "flex-1 min-w-0" },
|
|
89
|
-
h("select", { class: Object.assign(Object.assign({}, inputClass), { 'rounded-none rounded-br-md shadow-none': true, 'text-gray-500': this.fundForm.state !== undefined }), name: "state", required: true, id: "state", onChange: (ev) => {
|
|
90
|
-
this.updateFormField('state', ev.target.value.trim());
|
|
91
|
-
this.updateAddressErrorMessage();
|
|
92
|
-
}, ref: (el) => (this.stateElement = el) },
|
|
93
|
-
h("option", { disabled: true, selected: this.fundForm.state !== undefined, value: "" }, "State"),
|
|
94
|
-
this.stateOptions.map((s) => (h("option", { value: s.value, selected: this.fundForm.state === s.value }, s.label))))))),
|
|
95
|
-
isSome(this.addressErrorMessage) && this.showValidationErrors && (h("div", { class: "mt-2 text-sm text-red-600" }, this.addressErrorMessage.value))),
|
|
96
|
-
h("div", { class: "flex space-x-4" },
|
|
97
|
-
h("div", { class: "mt-3 w-1/2" },
|
|
98
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Given name(s)"),
|
|
99
|
-
h("div", { class: "mt-1" },
|
|
100
|
-
h("sss-name-input", { testId: "member-given-names-input", name: "memberFirstName", readableName: "Member given name(s)", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFirstName, onChange: (ev) => this.updateFormField('memberFirstName', ev.target.value.trim()) }))),
|
|
101
|
-
h("div", { class: "mt-3 w-1/2" },
|
|
102
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Last name"),
|
|
103
|
-
h("div", { class: "mt-1" },
|
|
104
|
-
h("sss-name-input", { testId: "member-last-name-input", name: "memberFamilyName", readableName: "Member last name", showValidationErrors: this.showValidationErrors, value: customFundState.selfManagedFundForm.memberFamilyName, onChange: (ev) => this.updateFormField('memberFamilyName', ev.target.value.trim()) })))),
|
|
105
|
-
h("h3", { class: "text-lg font-bold mt-6" }, "Fund bank details"),
|
|
106
|
-
h("div", { class: "mt-3" },
|
|
107
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Account name"),
|
|
108
|
-
h("div", { class: "mt-1" },
|
|
109
|
-
h("input", { type: "text", required: true, class: inputClass, name: "bankAccountName", minlength: "2", id: "bankAccountName", value: customFundState.selfManagedFundForm.bankAccountName, onChange: (ev) => this.updateFormField('bankAccountName', ev.target.value.trim()) }),
|
|
110
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid bank account name"))),
|
|
111
|
-
h("div", { class: "mt-3" },
|
|
112
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "BSB"),
|
|
113
|
-
h("div", { class: "mt-1" },
|
|
114
|
-
h("input", { type: "text", required: true, class: inputClass, name: "bsb", id: "bsb", minlength: "6", maxlength: "7", inputmode: "numeric", onKeyUp: (ev) => this.updateCurrentBank(ev), pattern: this.bsbRegex.source, value: customFundState.selfManagedFundForm.bsb }),
|
|
115
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid BSB"))),
|
|
116
|
-
isSome(this.currentBank) && (h("div", { class: "mt-3" },
|
|
117
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Bank name"),
|
|
118
|
-
h("div", { class: "mt-1 shadow-sm px-3 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-500 text-sm" }, this.currentBank.value))),
|
|
119
|
-
h("div", { class: "mt-3" },
|
|
120
|
-
h("label", { class: "text-sm font-medium text-gray-700" }, "Account number"),
|
|
121
|
-
h("div", { class: "mt-1" },
|
|
122
|
-
h("input", { type: "text", required: true, class: inputClass, name: "bankAccountNumber", id: "bankAccountNumber", minlength: "2", maxlength: "11", pattern: this.bankAccountNumberRegex.source, inputmode: "numeric", value: customFundState.selfManagedFundForm.bankAccountNumber, onKeyUp: (ev) => this.updateCurrentBankAccountNumber(ev), onChange: (ev) => this.updateFormField('bankAccountNumber', ev.target.value.trim()) }),
|
|
123
|
-
h("div", { class: "invalid-feedback mt-2 text-sm text-red-600" }, "Enter a valid bank account number")))));
|
|
124
|
-
}
|
|
125
|
-
updateFormField(key, value) {
|
|
126
|
-
this.formChanged.emit({ [key]: value });
|
|
127
|
-
}
|
|
128
|
-
async isAbnUsedForRegulatedAsync(abn) {
|
|
129
|
-
return !(await customFundChoiceApi.validateAbnForSMSF(abn));
|
|
130
|
-
}
|
|
131
|
-
renderAbnValidationError() {
|
|
132
|
-
if (this.isAbnTouched || this.showValidationErrors) {
|
|
133
|
-
switch (this.abnValidationStatus) {
|
|
134
|
-
case AbnValidationStatus.Invalid:
|
|
135
|
-
return h("div", { class: "mt-2 text-sm text-red-600" }, "Enter a valid fund ABN (digits only)");
|
|
136
|
-
case AbnValidationStatus.AbnIsUsedForRegulatedFund:
|
|
137
|
-
return (h("div", { class: "mt-2 text-sm text-red-600" }, "The supplied ABN is for a regulated fund"));
|
|
138
|
-
case AbnValidationStatus.Valid:
|
|
139
|
-
return [];
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
filterDigits(str) {
|
|
145
|
-
return str.replace(/[^0-9]/g, '');
|
|
146
|
-
}
|
|
147
|
-
updateCurrentBank(ev) {
|
|
148
|
-
const value = this.filterDigits(ev.target.value);
|
|
149
|
-
const firstTwoNumbers = value.substring(0, 2);
|
|
150
|
-
const firstThreeNumbers = value.substring(0, 3);
|
|
151
|
-
const firstTwoNumberBankName = bsbNumbers[firstTwoNumbers];
|
|
152
|
-
const firstThreeNumberBankName = bsbNumbers[firstThreeNumbers];
|
|
153
|
-
if (firstTwoNumberBankName)
|
|
154
|
-
this.currentBank = some(firstTwoNumberBankName);
|
|
155
|
-
if (firstThreeNumberBankName)
|
|
156
|
-
this.currentBank = some(firstThreeNumberBankName);
|
|
157
|
-
if (value === '' || value.length > 6)
|
|
158
|
-
this.currentBank = none;
|
|
159
|
-
this.updateFormField('bsb', value);
|
|
160
|
-
}
|
|
161
|
-
updateCurrentBankAccountNumber(ev) {
|
|
162
|
-
const value = this.filterDigits(ev.target.value);
|
|
163
|
-
this.updateFormField('bankAccountNumber', value);
|
|
164
|
-
}
|
|
165
|
-
updateAddressErrorMessage() {
|
|
166
|
-
let message = none;
|
|
167
|
-
if (isNone(message) && !this.addressLine1Element.checkValidity()) {
|
|
168
|
-
message = some('Enter a valid address line 1');
|
|
169
|
-
}
|
|
170
|
-
if (isNone(message) && !this.cityElement.checkValidity()) {
|
|
171
|
-
message = some('Enter a valid city/suburb');
|
|
172
|
-
}
|
|
173
|
-
if (isNone(message) && !this.postcodeElement.checkValidity()) {
|
|
174
|
-
message = some('Enter a valid post code');
|
|
175
|
-
}
|
|
176
|
-
if (isNone(message) && !this.stateElement.checkValidity()) {
|
|
177
|
-
message = some('Select a state');
|
|
178
|
-
}
|
|
179
|
-
this.addressErrorMessage = message;
|
|
180
|
-
}
|
|
181
|
-
static get is() { return "sss-self-managed-fund-inputs"; }
|
|
182
|
-
static get properties() { return {
|
|
183
|
-
"fundForm": {
|
|
184
|
-
"type": "unknown",
|
|
185
|
-
"mutable": false,
|
|
186
|
-
"complexType": {
|
|
187
|
-
"original": "Partial<SelfManagedFundForm>",
|
|
188
|
-
"resolved": "{ fundName?: string | undefined; fundAbn?: string | undefined; fundEsa?: string | undefined; addressLine1?: string | undefined; addressLine2?: string | undefined; state?: string | undefined; postcode?: string | undefined; city?: string | undefined; bankAccountName?: string | undefined; bsb?: string | undefined; bankAccountNumber?: string | undefined; memberFirstName?: string | undefined; memberFamilyName?: string | undefined; }",
|
|
189
|
-
"references": {
|
|
190
|
-
"Partial": {
|
|
191
|
-
"location": "global"
|
|
192
|
-
},
|
|
193
|
-
"SelfManagedFundForm": {
|
|
194
|
-
"location": "import",
|
|
195
|
-
"path": "./self-managed-fund.form"
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
"required": false,
|
|
200
|
-
"optional": false,
|
|
201
|
-
"docs": {
|
|
202
|
-
"tags": [],
|
|
203
|
-
"text": ""
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
"showValidationErrors": {
|
|
207
|
-
"type": "boolean",
|
|
208
|
-
"mutable": false,
|
|
209
|
-
"complexType": {
|
|
210
|
-
"original": "boolean",
|
|
211
|
-
"resolved": "boolean",
|
|
212
|
-
"references": {}
|
|
213
|
-
},
|
|
214
|
-
"required": false,
|
|
215
|
-
"optional": false,
|
|
216
|
-
"docs": {
|
|
217
|
-
"tags": [],
|
|
218
|
-
"text": ""
|
|
219
|
-
},
|
|
220
|
-
"attribute": "show-validation-errors",
|
|
221
|
-
"reflect": false
|
|
222
|
-
}
|
|
223
|
-
}; }
|
|
224
|
-
static get states() { return {
|
|
225
|
-
"abnValidationStatus": {},
|
|
226
|
-
"isAbnTouched": {},
|
|
227
|
-
"currentBank": {},
|
|
228
|
-
"addressErrorMessage": {}
|
|
229
|
-
}; }
|
|
230
|
-
static get events() { return [{
|
|
231
|
-
"method": "formChanged",
|
|
232
|
-
"name": "formChanged",
|
|
233
|
-
"bubbles": true,
|
|
234
|
-
"cancelable": true,
|
|
235
|
-
"composed": true,
|
|
236
|
-
"docs": {
|
|
237
|
-
"tags": [],
|
|
238
|
-
"text": ""
|
|
239
|
-
},
|
|
240
|
-
"complexType": {
|
|
241
|
-
"original": "Partial<FormChangedEvent>",
|
|
242
|
-
"resolved": "{ isAbnValid?: boolean | undefined; fundName?: string | undefined; fundAbn?: string | undefined; fundEsa?: string | undefined; addressLine1?: string | undefined; addressLine2?: string | undefined; state?: string | undefined; postcode?: string | undefined; city?: string | undefined; bankAccountName?: string | undefined; bsb?: string | undefined; bankAccountNumber?: string | undefined; memberFirstName?: string | undefined; memberFamilyName?: string | undefined; }",
|
|
243
|
-
"references": {
|
|
244
|
-
"Partial": {
|
|
245
|
-
"location": "global"
|
|
246
|
-
},
|
|
247
|
-
"FormChangedEvent": {
|
|
248
|
-
"location": "local"
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}]; }
|
|
253
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Component, getAssetPath, h, Host, Prop, State } from '@stencil/core';
|
|
2
|
-
import { injectHistory } from '@stencil/router';
|
|
3
|
-
import * as O from 'fp-ts/Option';
|
|
4
|
-
import { EventTrackingService } from '../../../services/event-tracking.service';
|
|
5
|
-
import navigationService from '../../../services/navigation.service';
|
|
6
|
-
import { SuperSelectionAppRoutes } from '../../../services/super-selection-app.routes';
|
|
7
|
-
import superSelectionAppService from '../../../services/super-selection-app.service';
|
|
8
|
-
import customFundChoiceApi from '../api/custom-fund-choice.api';
|
|
9
|
-
import customFundState from '../custom-fund.store';
|
|
10
|
-
import { validateAbn } from './abn-validation';
|
|
11
|
-
export class SelfManagedFund {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.isSubmitDisabled = true;
|
|
14
|
-
this.isAbnValid = validateAbn(customFundState.selfManagedFundForm.fundAbn);
|
|
15
|
-
this.eventTrackingService = EventTrackingService.Instance;
|
|
16
|
-
this.success = () => {
|
|
17
|
-
navigationService.navigateInternallyToStandardChoice({
|
|
18
|
-
history: this.history,
|
|
19
|
-
fundName: 'Self-managed super fund',
|
|
20
|
-
fundDetails: {
|
|
21
|
-
type: 'smsf',
|
|
22
|
-
fundName: customFundState.selfManagedFundForm.fundName,
|
|
23
|
-
fundEsa: customFundState.selfManagedFundForm.fundEsa
|
|
24
|
-
},
|
|
25
|
-
handleSubmitFn: async (standardChoiceFormSignature) => {
|
|
26
|
-
const requestDto = Object.assign({ smsfChoice: {
|
|
27
|
-
abn: customFundState.selfManagedFundForm.fundAbn,
|
|
28
|
-
fundName: customFundState.selfManagedFundForm.fundName,
|
|
29
|
-
fundAddress: {
|
|
30
|
-
addressLine1: customFundState.selfManagedFundForm.addressLine1,
|
|
31
|
-
addressLine2: customFundState.selfManagedFundForm.addressLine2,
|
|
32
|
-
city: customFundState.selfManagedFundForm.city,
|
|
33
|
-
state: customFundState.selfManagedFundForm.state,
|
|
34
|
-
postcode: customFundState.selfManagedFundForm.postcode
|
|
35
|
-
},
|
|
36
|
-
bsb: customFundState.selfManagedFundForm.bsb,
|
|
37
|
-
bankAccountName: customFundState.selfManagedFundForm.bankAccountName,
|
|
38
|
-
bankAccountNumber: customFundState.selfManagedFundForm.bankAccountNumber,
|
|
39
|
-
electronicServiceAddress: customFundState.selfManagedFundForm.fundEsa,
|
|
40
|
-
memberFirstName: customFundState.selfManagedFundForm.memberFirstName,
|
|
41
|
-
memberFamilyName: customFundState.selfManagedFundForm.memberFamilyName
|
|
42
|
-
}, standardChoiceFormSignature }, superSelectionAppService.promotedFundsConfig);
|
|
43
|
-
await customFundChoiceApi.submitSelfManagedFundChoiceAsync(requestDto);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
componentDidLoad() {
|
|
49
|
-
this.updateIsSubmitDisabled();
|
|
50
|
-
return this.eventTrackingService.TrackSmsfSuperFundDetailViewedAsync({
|
|
51
|
-
promotedFundsShown: superSelectionAppService.promotedFunds,
|
|
52
|
-
defaultFundUsiSet: O.toUndefined(superSelectionAppService.defaultFundUsi)
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
return (h(Host, null,
|
|
57
|
-
h("sss-header-section", null),
|
|
58
|
-
h("div", { class: "flex justify-center mt-11" },
|
|
59
|
-
h("sss-custom-fund", null,
|
|
60
|
-
h("form", { noValidate: true, onSubmit: (ev) => ev.preventDefault(), class: {
|
|
61
|
-
'was-validated': this.formState === 'validated'
|
|
62
|
-
}, ref: (el) => (this.formElement = el), onInput: (_) => this.updateIsSubmitDisabled() },
|
|
63
|
-
h("div", { class: "p-4 sm:p-6 pb-6 sm:pb-8 border shadow-sm rounded-lg max-w-560" },
|
|
64
|
-
h("p", { class: "sm:text-lg font-bold" }, "Fund details"),
|
|
65
|
-
h("div", { class: "bg-yellow-50 border-l-4 border-yellow-400 p-4 my-3" },
|
|
66
|
-
h("div", { class: "flex" },
|
|
67
|
-
h("div", { class: "flex-shrink-0" },
|
|
68
|
-
h("img", { class: "h-5 w-5", src: getAssetPath('assets/icon-exclamation.svg') })),
|
|
69
|
-
h("div", { class: "ml-3 text-sm text-yellow-700 leading-5" }, "Make sure your Self-managed super fund (SMSF) is a registered fund before completing this step."))),
|
|
70
|
-
h("sss-self-managed-fund-inputs", { fundForm: customFundState.selfManagedFundForm, showValidationErrors: this.formState === 'validated', onFormChanged: (event) => {
|
|
71
|
-
customFundState.selfManagedFundForm = Object.assign(Object.assign({}, customFundState.selfManagedFundForm), event.detail);
|
|
72
|
-
if (event.detail.isAbnValid !== undefined)
|
|
73
|
-
this.isAbnValid = event.detail.isAbnValid;
|
|
74
|
-
this.updateIsSubmitDisabled();
|
|
75
|
-
} })),
|
|
76
|
-
h("div", { class: "flex justify-center mt-8" },
|
|
77
|
-
h("div", { class: "sm:max-w-320 w-full" },
|
|
78
|
-
h("div", { class: "mb-4", onClick:
|
|
79
|
-
// user clicks on disabled button (div wrapper) then validation errors will show
|
|
80
|
-
() => (this.formState = 'validated') },
|
|
81
|
-
h("sss-button", { testid: "continue-button", fillWidth: true, promiseFn: () => this.handleSubmitForm(), disabled: this.isSubmitDisabled }, "Continue")),
|
|
82
|
-
h("stencil-route-link", { url: SuperSelectionAppRoutes.ChoicePage },
|
|
83
|
-
h("sss-button", { testid: "back-button", fillWidth: true, variant: "secondary" }, "Back")))))))));
|
|
84
|
-
}
|
|
85
|
-
updateIsSubmitDisabled() {
|
|
86
|
-
this.isSubmitDisabled = !this.formElement.checkValidity() || !this.isAbnValid;
|
|
87
|
-
}
|
|
88
|
-
async handleSubmitForm() {
|
|
89
|
-
this.formState = 'validated';
|
|
90
|
-
if (this.formElement.checkValidity())
|
|
91
|
-
this.success();
|
|
92
|
-
}
|
|
93
|
-
static get is() { return "sss-self-managed-fund"; }
|
|
94
|
-
static get properties() { return {
|
|
95
|
-
"history": {
|
|
96
|
-
"type": "unknown",
|
|
97
|
-
"mutable": false,
|
|
98
|
-
"complexType": {
|
|
99
|
-
"original": "RouterHistory",
|
|
100
|
-
"resolved": "RouterHistory",
|
|
101
|
-
"references": {
|
|
102
|
-
"RouterHistory": {
|
|
103
|
-
"location": "import",
|
|
104
|
-
"path": "@stencil/router"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"required": false,
|
|
109
|
-
"optional": false,
|
|
110
|
-
"docs": {
|
|
111
|
-
"tags": [],
|
|
112
|
-
"text": ""
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}; }
|
|
116
|
-
static get states() { return {
|
|
117
|
-
"formState": {},
|
|
118
|
-
"isSubmitDisabled": {}
|
|
119
|
-
}; }
|
|
120
|
-
}
|
|
121
|
-
injectHistory(SelfManagedFund);
|