@saasquatch/mint-components 2.1.7 → 2.1.8-0
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +391 -50
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/formDefinitions.js +75 -37
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +688 -13
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +109 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +391 -50
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-17b32de7.system.entry.js +1 -0
- package/dist/mint-components/p-7d16ee0e.entry.js +108 -0
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/formDefinitions.d.ts +2 -0
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +4 -0
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.d.ts +165 -0
- package/dist/types/components.d.ts +240 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/mint-components/p-cacb897d.system.entry.js +0 -1
- package/dist/mint-components/p-ff378015.entry.js +0 -106
|
@@ -22,7 +22,7 @@ const keys = require('./keys-cff24974.js');
|
|
|
22
22
|
const usePayoutStatus = require('./usePayoutStatus-0192fccd.js');
|
|
23
23
|
|
|
24
24
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32;
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70;
|
|
26
26
|
const { errors, ...formState } = props.states.formState;
|
|
27
27
|
return {
|
|
28
28
|
0: {
|
|
@@ -31,44 +31,54 @@ function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
|
31
31
|
helpText: getValidationErrorMessage({
|
|
32
32
|
type: (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _b === void 0 ? void 0 : _b.beneficiaryAccountName) === null || _c === void 0 ? void 0 : _c.type,
|
|
33
33
|
label: props.text.beneficiaryAccountNameLabel,
|
|
34
|
+
errorCode: (_e = (_d = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _d === void 0 ? void 0 : _d.beneficiaryAccountName) === null || _e === void 0 ? void 0 : _e.errorCode,
|
|
35
|
+
fieldName: "beneficiaryAccountName",
|
|
34
36
|
}),
|
|
35
37
|
})))),
|
|
36
38
|
},
|
|
37
39
|
1: {
|
|
38
|
-
input: (index.h("sl-select", Object.assign({ required: true, label: props.text.bankAccountTypeLabel, name: "/bankAccountType", id: "bankAccountType", key: "bankAccountType" }, (((
|
|
40
|
+
input: (index.h("sl-select", Object.assign({ required: true, label: props.text.bankAccountTypeLabel, name: "/bankAccountType", id: "bankAccountType", key: "bankAccountType" }, (((_f = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _f === void 0 ? void 0 : _f.bankAccountType) && {
|
|
39
41
|
class: "error-input",
|
|
40
42
|
helpText: getValidationErrorMessage({
|
|
41
|
-
type: (
|
|
43
|
+
type: (_h = (_g = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _g === void 0 ? void 0 : _g.bankAccountType) === null || _h === void 0 ? void 0 : _h.type,
|
|
42
44
|
label: props.text.bankAccountTypeLabel,
|
|
45
|
+
errorCode: (_k = (_j = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _j === void 0 ? void 0 : _j.bankAccountType) === null || _k === void 0 ? void 0 : _k.errorCode,
|
|
46
|
+
fieldName: "bankAccountType",
|
|
43
47
|
}),
|
|
44
48
|
})),
|
|
45
49
|
index.h("sl-menu-item", { value: "CHECKING" }, props.text.checkingSelectItemLabel),
|
|
46
50
|
index.h("sl-menu-item", { value: "SAVINGS" }, props.text.savingsSelectItemLabel))),
|
|
47
51
|
},
|
|
48
52
|
2: {
|
|
49
|
-
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.bankAccountNumberLabel, name: "/bankAccountNumber", id: "bankAccountNumber", key: "bankAccountNumber", value: formState.bankAccountNumber, type: "text" }, (((
|
|
53
|
+
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.bankAccountNumberLabel, name: "/bankAccountNumber", id: "bankAccountNumber", key: "bankAccountNumber", value: formState.bankAccountNumber, type: "text" }, (((_l = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _l === void 0 ? void 0 : _l.bankAccountNumber) && {
|
|
50
54
|
class: "error-input",
|
|
51
55
|
helpText: getValidationErrorMessage({
|
|
52
|
-
type: (
|
|
56
|
+
type: (_o = (_m = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _m === void 0 ? void 0 : _m.bankAccountNumber) === null || _o === void 0 ? void 0 : _o.type,
|
|
53
57
|
label: props.text.bankAccountNumberLabel,
|
|
58
|
+
errorCode: (_q = (_p = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _p === void 0 ? void 0 : _p.bankAccountNumber) === null || _q === void 0 ? void 0 : _q.errorCode,
|
|
59
|
+
fieldName: "bankAccountNumber",
|
|
54
60
|
}),
|
|
55
61
|
})))),
|
|
56
62
|
},
|
|
57
63
|
3: {
|
|
58
|
-
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.ibanLabel, name: "/bankAccountNumber", id: "iban", key: "iban", type: "text", value: formState.bankAccountNumber }, (((
|
|
64
|
+
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.ibanLabel, name: "/bankAccountNumber", id: "iban", key: "iban", type: "text", value: formState.bankAccountNumber }, (((_r = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _r === void 0 ? void 0 : _r.bankAccountNumber) && {
|
|
59
65
|
class: "error-input",
|
|
60
66
|
helpText: getValidationErrorMessage({
|
|
61
|
-
type: (
|
|
67
|
+
type: (_t = (_s = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _s === void 0 ? void 0 : _s.bankAccountNumber) === null || _t === void 0 ? void 0 : _t.type,
|
|
62
68
|
label: props.text.ibanLabel,
|
|
69
|
+
errorCode: (_v = (_u = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _u === void 0 ? void 0 : _u.bankAccountNumber) === null || _v === void 0 ? void 0 : _v.errorCode,
|
|
70
|
+
fieldName: "bankAccountNumber",
|
|
63
71
|
}),
|
|
64
72
|
})))),
|
|
65
73
|
},
|
|
66
74
|
4: {
|
|
67
|
-
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.swiftCodeLabel, name: "/swiftCode", id: "swiftCode", key: "swiftCode", type: "text" }, (((
|
|
75
|
+
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.swiftCodeLabel, name: "/swiftCode", id: "swiftCode", key: "swiftCode", type: "text" }, (((_w = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _w === void 0 ? void 0 : _w.swiftCode) && {
|
|
68
76
|
class: "error-input",
|
|
69
77
|
helpText: getValidationErrorMessage({
|
|
70
|
-
type: (
|
|
78
|
+
type: (_y = (_x = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _x === void 0 ? void 0 : _x.swiftCode) === null || _y === void 0 ? void 0 : _y.type,
|
|
71
79
|
label: props.text.swiftCodeLabel,
|
|
80
|
+
errorCode: (_0 = (_z = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _z === void 0 ? void 0 : _z.swiftCode) === null || _0 === void 0 ? void 0 : _0.errorCode,
|
|
81
|
+
fieldName: "swiftCode",
|
|
72
82
|
}),
|
|
73
83
|
})))),
|
|
74
84
|
},
|
|
@@ -78,35 +88,41 @@ function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
|
78
88
|
defaultMessage: props.text.routingCodeLabel,
|
|
79
89
|
}, {
|
|
80
90
|
bankCountry,
|
|
81
|
-
}), name: "/routingCode", id: "routingCode", key: "routingCode", type: "text" }, (((
|
|
91
|
+
}), name: "/routingCode", id: "routingCode", key: "routingCode", type: "text" }, (((_1 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _1 === void 0 ? void 0 : _1.routingCode) && {
|
|
82
92
|
class: "error-input",
|
|
83
93
|
helpText: getValidationErrorMessage({
|
|
84
|
-
type: (
|
|
94
|
+
type: (_3 = (_2 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _2 === void 0 ? void 0 : _2.routingCode) === null || _3 === void 0 ? void 0 : _3.type,
|
|
85
95
|
label: global.intl.formatMessage({
|
|
86
96
|
id: "routingCodeErrorText",
|
|
87
97
|
defaultMessage: props.text.routingCodeLabel,
|
|
88
98
|
}, {
|
|
89
99
|
bankCountry,
|
|
90
100
|
}),
|
|
101
|
+
errorCode: (_5 = (_4 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _4 === void 0 ? void 0 : _4.routingCode) === null || _5 === void 0 ? void 0 : _5.errorCode,
|
|
102
|
+
fieldName: "routingCode",
|
|
91
103
|
}),
|
|
92
104
|
})))),
|
|
93
105
|
},
|
|
94
106
|
6: {
|
|
95
|
-
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.bankNameLabel, name: "/bankName", id: "bankName", key: "bankName", type: "text" }, (((
|
|
107
|
+
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.bankNameLabel, name: "/bankName", id: "bankName", key: "bankName", type: "text" }, (((_6 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _6 === void 0 ? void 0 : _6.bankName) && {
|
|
96
108
|
class: "error-input",
|
|
97
109
|
helpText: getValidationErrorMessage({
|
|
98
|
-
type: (
|
|
110
|
+
type: (_8 = (_7 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _7 === void 0 ? void 0 : _7.bankName) === null || _8 === void 0 ? void 0 : _8.type,
|
|
99
111
|
label: props.text.bankNameLabel,
|
|
112
|
+
errorCode: (_10 = (_9 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _9 === void 0 ? void 0 : _9.bankName) === null || _10 === void 0 ? void 0 : _10.errorCode,
|
|
113
|
+
fieldName: "bankName",
|
|
100
114
|
}),
|
|
101
115
|
})))),
|
|
102
116
|
},
|
|
103
117
|
7: {
|
|
104
118
|
input: [
|
|
105
|
-
index.h("sl-select", Object.assign({ required: true, label: props.text.classificationLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((
|
|
119
|
+
index.h("sl-select", Object.assign({ required: true, label: props.text.classificationLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((_11 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _11 === void 0 ? void 0 : _11.beneficiaryClassification) && {
|
|
106
120
|
class: "error-input",
|
|
107
121
|
helpText: getValidationErrorMessage({
|
|
108
|
-
type: (
|
|
122
|
+
type: (_13 = (_12 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _12 === void 0 ? void 0 : _12.beneficiaryClassification) === null || _13 === void 0 ? void 0 : _13.type,
|
|
109
123
|
label: props.text.classificationLabel,
|
|
124
|
+
errorCode: (_15 = (_14 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _14 === void 0 ? void 0 : _14.beneficiaryClassification) === null || _15 === void 0 ? void 0 : _15.errorCode,
|
|
125
|
+
fieldName: "beneficiaryClassification",
|
|
110
126
|
}),
|
|
111
127
|
})),
|
|
112
128
|
index.h("sl-menu-item", { value: "BUSINESS" }, props.text.businessSelectItemLabel),
|
|
@@ -117,100 +133,122 @@ function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
|
117
133
|
defaultMessage: props.text.taxPayerIdLabel,
|
|
118
134
|
}, {
|
|
119
135
|
bankCountry,
|
|
120
|
-
}), type: "text", name: "/beneficiaryTaxPayerId", id: "beneficiaryTaxPayerId", key: "beneficiaryTaxPayerId" }, (((
|
|
136
|
+
}), type: "text", name: "/beneficiaryTaxPayerId", id: "beneficiaryTaxPayerId", key: "beneficiaryTaxPayerId" }, (((_16 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _16 === void 0 ? void 0 : _16.beneficiaryTaxPayerId) && {
|
|
121
137
|
class: "error-input",
|
|
122
138
|
helpText: getValidationErrorMessage({
|
|
123
|
-
type: (
|
|
139
|
+
type: (_18 = (_17 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _17 === void 0 ? void 0 : _17.beneficiaryTaxPayerId) === null || _18 === void 0 ? void 0 : _18.type,
|
|
124
140
|
label: props.text.taxPayerIdLabel,
|
|
141
|
+
errorCode: (_20 = (_19 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _19 === void 0 ? void 0 : _19.taxPayerId) === null || _20 === void 0 ? void 0 : _20.errorCode,
|
|
142
|
+
fieldName: "taxPayerId",
|
|
125
143
|
}),
|
|
126
144
|
}))),
|
|
127
145
|
],
|
|
128
146
|
},
|
|
129
147
|
8: {
|
|
130
|
-
input: (index.h("sl-select", Object.assign({ required: true, label: props.text.classificationCPFLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((
|
|
148
|
+
input: (index.h("sl-select", Object.assign({ required: true, label: props.text.classificationCPFLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((_21 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _21 === void 0 ? void 0 : _21.beneficiaryClassification) && {
|
|
131
149
|
class: "error-input",
|
|
132
150
|
helpText: getValidationErrorMessage({
|
|
133
|
-
type: (
|
|
151
|
+
type: (_23 = (_22 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _22 === void 0 ? void 0 : _22.beneficiaryClassification) === null || _23 === void 0 ? void 0 : _23.type,
|
|
134
152
|
label: props.text.classificationCPFLabel,
|
|
153
|
+
errorCode: (_25 = (_24 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _24 === void 0 ? void 0 : _24.beneficiaryClassification) === null || _25 === void 0 ? void 0 : _25.errorCode,
|
|
154
|
+
fieldName: "beneficiaryClassification",
|
|
135
155
|
}),
|
|
136
156
|
})),
|
|
137
157
|
index.h("sl-menu-item", { value: "CPF" }, "CPF"),
|
|
138
158
|
index.h("sl-menu-item", { value: "CNPJ" }, "CNPJ"))),
|
|
139
159
|
},
|
|
140
160
|
9: {
|
|
141
|
-
input: (index.h("sl-input", Object.assign({ key: "patronymicName", required: true, label: props.text.patronymicNameLabel, name: "/patronymicName", id: "patronymicName", type: "text" }, (((
|
|
161
|
+
input: (index.h("sl-input", Object.assign({ key: "patronymicName", required: true, label: props.text.patronymicNameLabel, name: "/patronymicName", id: "patronymicName", type: "text" }, (((_26 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _26 === void 0 ? void 0 : _26.patronymicName) && {
|
|
142
162
|
class: "error-input",
|
|
143
163
|
helpText: getValidationErrorMessage({
|
|
144
|
-
type: (
|
|
164
|
+
type: (_28 = (_27 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _27 === void 0 ? void 0 : _27.patronymicName) === null || _28 === void 0 ? void 0 : _28.type,
|
|
145
165
|
label: props.text.patronymicNameLabel,
|
|
166
|
+
errorCode: (_30 = (_29 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _29 === void 0 ? void 0 : _29.patronymicName) === null || _30 === void 0 ? void 0 : _30.errorCode,
|
|
167
|
+
fieldName: "patronymicName",
|
|
146
168
|
}),
|
|
147
169
|
})))),
|
|
148
170
|
},
|
|
149
171
|
10: {
|
|
150
|
-
input: (index.h("sl-input", Object.assign({ key: "voCode", label: props.text.voCodeLabel, name: "/voCode", id: "voCode", type: "text" }, (((
|
|
172
|
+
input: (index.h("sl-input", Object.assign({ key: "voCode", label: props.text.voCodeLabel, name: "/voCode", id: "voCode", type: "text" }, (((_31 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _31 === void 0 ? void 0 : _31.voCode) && {
|
|
151
173
|
class: "error-input",
|
|
152
174
|
helpText: getValidationErrorMessage({
|
|
153
|
-
type: (
|
|
175
|
+
type: (_33 = (_32 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _32 === void 0 ? void 0 : _32.voCode) === null || _33 === void 0 ? void 0 : _33.type,
|
|
154
176
|
label: props.text.voCodeLabel,
|
|
177
|
+
errorCode: (_35 = (_34 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _34 === void 0 ? void 0 : _34.voCode) === null || _35 === void 0 ? void 0 : _35.errorCode,
|
|
178
|
+
fieldName: "voCode",
|
|
155
179
|
}),
|
|
156
180
|
})))),
|
|
157
181
|
},
|
|
158
182
|
11: {
|
|
159
|
-
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.agencyCodeLabel, name: "/agencyCode", id: "agencyCode", key: "agencyCode", type: "text" }, (((
|
|
183
|
+
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.agencyCodeLabel, name: "/agencyCode", id: "agencyCode", key: "agencyCode", type: "text" }, (((_36 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _36 === void 0 ? void 0 : _36.agencyCode) && {
|
|
160
184
|
class: "error-input",
|
|
161
185
|
helpText: getValidationErrorMessage({
|
|
162
|
-
type: (
|
|
186
|
+
type: (_38 = (_37 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _37 === void 0 ? void 0 : _37.agencyCode) === null || _38 === void 0 ? void 0 : _38.type,
|
|
163
187
|
label: props.text.agencyCodeLabel,
|
|
188
|
+
errorCode: (_40 = (_39 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _39 === void 0 ? void 0 : _39.agencyCode) === null || _40 === void 0 ? void 0 : _40.errorCode,
|
|
189
|
+
fieldName: "agencyCode",
|
|
164
190
|
}),
|
|
165
191
|
})))),
|
|
166
192
|
},
|
|
167
193
|
12: {
|
|
168
194
|
input: [
|
|
169
|
-
index.h("sl-input", Object.assign({ required: true, label: props.text.bankAddressLabel, name: "/bankAddress", id: "bankAddress", key: "bankAddress", type: "text" }, (((
|
|
195
|
+
index.h("sl-input", Object.assign({ required: true, label: props.text.bankAddressLabel, name: "/bankAddress", id: "bankAddress", key: "bankAddress", type: "text" }, (((_41 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _41 === void 0 ? void 0 : _41.bankAddress) && {
|
|
170
196
|
class: "error-input",
|
|
171
197
|
helpText: getValidationErrorMessage({
|
|
172
|
-
type: (
|
|
198
|
+
type: (_43 = (_42 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _42 === void 0 ? void 0 : _42.bankAddress) === null || _43 === void 0 ? void 0 : _43.type,
|
|
173
199
|
label: props.text.bankAddressLabel,
|
|
200
|
+
errorCode: (_45 = (_44 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _44 === void 0 ? void 0 : _44.bankAddress) === null || _45 === void 0 ? void 0 : _45.errorCode,
|
|
201
|
+
fieldName: "bankAddress",
|
|
174
202
|
}),
|
|
175
203
|
}))),
|
|
176
|
-
index.h("sl-input", Object.assign({ required: true, label: props.text.bankCityLabel, name: "/bankCity", id: "bankCity", key: "bankCity", type: "text" }, (((
|
|
204
|
+
index.h("sl-input", Object.assign({ required: true, label: props.text.bankCityLabel, name: "/bankCity", id: "bankCity", key: "bankCity", type: "text" }, (((_46 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _46 === void 0 ? void 0 : _46.bankCity) && {
|
|
177
205
|
class: "error-input",
|
|
178
206
|
helpText: getValidationErrorMessage({
|
|
179
|
-
type: (
|
|
207
|
+
type: (_48 = (_47 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _47 === void 0 ? void 0 : _47.bankCity) === null || _48 === void 0 ? void 0 : _48.type,
|
|
180
208
|
label: props.text.bankCityLabel,
|
|
209
|
+
errorCode: (_50 = (_49 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _49 === void 0 ? void 0 : _49.bankCity) === null || _50 === void 0 ? void 0 : _50.errorCode,
|
|
210
|
+
fieldName: "bankCity",
|
|
181
211
|
}),
|
|
182
212
|
}))),
|
|
183
|
-
index.h("sl-input", Object.assign({ required: true, label: props.text.bankStateLabel, name: "/bankState", id: "bankState", key: "bankState", type: "text" }, (((
|
|
213
|
+
index.h("sl-input", Object.assign({ required: true, label: props.text.bankStateLabel, name: "/bankState", id: "bankState", key: "bankState", type: "text" }, (((_51 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _51 === void 0 ? void 0 : _51.bankState) && {
|
|
184
214
|
class: "error-input",
|
|
185
215
|
helpText: getValidationErrorMessage({
|
|
186
|
-
type: (
|
|
216
|
+
type: (_53 = (_52 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _52 === void 0 ? void 0 : _52.bankState) === null || _53 === void 0 ? void 0 : _53.type,
|
|
187
217
|
label: props.text.bankStateLabel,
|
|
218
|
+
errorCode: (_55 = (_54 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _54 === void 0 ? void 0 : _54.bankState) === null || _55 === void 0 ? void 0 : _55.errorCode,
|
|
219
|
+
fieldName: "bankState",
|
|
188
220
|
}),
|
|
189
221
|
}))),
|
|
190
|
-
index.h("sl-input", Object.assign({ required: true, label: props.text.bankPostalCodeLabel, name: "/bankPostalCode", id: "bankPostalCode", key: "bankPostalCode", type: "text" }, (((
|
|
222
|
+
index.h("sl-input", Object.assign({ required: true, label: props.text.bankPostalCodeLabel, name: "/bankPostalCode", id: "bankPostalCode", key: "bankPostalCode", type: "text" }, (((_56 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _56 === void 0 ? void 0 : _56.bankPostalCode) && {
|
|
191
223
|
class: "error-input",
|
|
192
224
|
helpText: getValidationErrorMessage({
|
|
193
|
-
type: (
|
|
225
|
+
type: (_58 = (_57 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _57 === void 0 ? void 0 : _57.bankPostalCode) === null || _58 === void 0 ? void 0 : _58.type,
|
|
194
226
|
label: props.text.bankPostalCodeLabel,
|
|
227
|
+
errorCode: (_60 = (_59 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _59 === void 0 ? void 0 : _59.bankPostalCode) === null || _60 === void 0 ? void 0 : _60.errorCode,
|
|
228
|
+
fieldName: "bankPostalCode",
|
|
195
229
|
}),
|
|
196
230
|
}))),
|
|
197
231
|
],
|
|
198
232
|
},
|
|
199
233
|
13: {
|
|
200
|
-
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.branchCodeLabel, name: "/branchCode", id: "branchCode", key: "branchCode", type: "text" }, (((
|
|
234
|
+
input: (index.h("sl-input", Object.assign({ required: true, label: props.text.branchCodeLabel, name: "/branchCode", id: "branchCode", key: "branchCode", type: "text" }, (((_61 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _61 === void 0 ? void 0 : _61.branchCode) && {
|
|
201
235
|
class: "error-input",
|
|
202
236
|
helpText: getValidationErrorMessage({
|
|
203
|
-
type: (
|
|
237
|
+
type: (_63 = (_62 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _62 === void 0 ? void 0 : _62.branchCode) === null || _63 === void 0 ? void 0 : _63.type,
|
|
204
238
|
label: props.text.branchCodeLabel,
|
|
239
|
+
errorCode: (_65 = (_64 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _64 === void 0 ? void 0 : _64.branchCode) === null || _65 === void 0 ? void 0 : _65.errorCode,
|
|
240
|
+
fieldName: "branchCode",
|
|
205
241
|
}),
|
|
206
242
|
})))),
|
|
207
243
|
},
|
|
208
244
|
14: {
|
|
209
|
-
input: (index.h("sl-select", Object.assign({ required: true, label: props.text.classificationLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((
|
|
245
|
+
input: (index.h("sl-select", Object.assign({ required: true, label: props.text.classificationLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((_66 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _66 === void 0 ? void 0 : _66.beneficiaryClassification) && {
|
|
210
246
|
class: "error-input",
|
|
211
247
|
helpText: getValidationErrorMessage({
|
|
212
|
-
type: (
|
|
248
|
+
type: (_68 = (_67 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _67 === void 0 ? void 0 : _67.beneficiaryClassification) === null || _68 === void 0 ? void 0 : _68.type,
|
|
213
249
|
label: props.text.classificationLabel,
|
|
250
|
+
errorCode: (_70 = (_69 = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _69 === void 0 ? void 0 : _69.beneficiaryClassification) === null || _70 === void 0 ? void 0 : _70.errorCode,
|
|
251
|
+
fieldName: "beneficiaryClassification",
|
|
214
252
|
}),
|
|
215
253
|
})),
|
|
216
254
|
index.h("sl-menu-item", { value: "BUSINESS" }, props.text.businessSelectItemLabel),
|
|
@@ -803,6 +841,109 @@ const paypalFeeMap = {
|
|
|
803
841
|
const ACH_PAYMENT_METHOD = 3;
|
|
804
842
|
const WIRE_PAYMENT_METHOD = 5;
|
|
805
843
|
const PAYPAL_PAYMENT_METHOD = 7;
|
|
844
|
+
/**
|
|
845
|
+
* Maps GraphQL validation error field names to form field names.
|
|
846
|
+
*
|
|
847
|
+
* The Impact API returns UpperCamelCase field names (e.g. `BankAccountNumber`).
|
|
848
|
+
* The GraphQL layer in `UserServiceImpl.java` converts these to lowerCamelCase
|
|
849
|
+
* via `CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, errorDto.field)`.
|
|
850
|
+
*
|
|
851
|
+
* Most converted field names already match the form field names exactly
|
|
852
|
+
* (e.g. `bankAccountNumber`, `swiftCode`, `routingCode`). Only entries
|
|
853
|
+
* where the GraphQL field name differs from the form field name need
|
|
854
|
+
* to be listed here.
|
|
855
|
+
*/
|
|
856
|
+
const API_FIELD_TO_FORM_FIELD = {
|
|
857
|
+
// bankProvinceState → form uses bankState
|
|
858
|
+
bankProvinceState: "bankState",
|
|
859
|
+
};
|
|
860
|
+
/**
|
|
861
|
+
* Maps Impact API error code paths (from validationErrors[].errorPath) to short,
|
|
862
|
+
* readable frontend error codes used in the ICU select props.
|
|
863
|
+
*
|
|
864
|
+
* The Impact API returns a stable dot-delimited error path (e.g.
|
|
865
|
+
* "withdrawal.settings.error.routingcode") alongside the human-readable message.
|
|
866
|
+
* The GraphQL layer exposes this as `errorPath`. The keys below match those paths
|
|
867
|
+
* to short frontend codes used in the ICU `{errorCode, select, ...}` props.
|
|
868
|
+
*/
|
|
869
|
+
const API_ERROR_PATH_TO_FRONTEND = {
|
|
870
|
+
// Beneficiary account name
|
|
871
|
+
"withdrawal.settings.error.empty_beneficiaryname": "empty",
|
|
872
|
+
"withdrawal.settings.error.invalid_character_beneficiaryname": "invalidCharacters",
|
|
873
|
+
"withdrawal.settings.error.numeric_beneficiaryname": "numeric",
|
|
874
|
+
"withdrawal_settings.error.beneficiaryname.size": "tooLong",
|
|
875
|
+
"withdrawal.settings.error.non_english_beneficiaryname": "nonEnglish",
|
|
876
|
+
"withdrawal_settings.error.business_beneficiaryname_match": "businessNameMismatch",
|
|
877
|
+
"withdrawal_settings.error.beneficiaryname_match": "nameMismatch",
|
|
878
|
+
"withdrawal_settings.error.business_checkpayeename_match": "businessPayeeMismatch",
|
|
879
|
+
"withdrawal_settings.error.checkpayeename_match": "payeeMismatch",
|
|
880
|
+
// Bank account number
|
|
881
|
+
"withdrawal.settings.error.accountnumber.empty": "empty",
|
|
882
|
+
"withdrawal.settings.error.accountnumber.uk": "invalidUk",
|
|
883
|
+
"withdrawal.settings.error.bankaccount.invalid": "invalid",
|
|
884
|
+
// IBAN
|
|
885
|
+
"withdrawal.settings.error.iban": "ibanEmpty",
|
|
886
|
+
"withdrawal.settings.error.iban.alphanumeric": "ibanAlphanumeric",
|
|
887
|
+
"withdrawal.settings.error.iban.invalid": "ibanInvalid",
|
|
888
|
+
"withdrawal.settings.error.iban.uk.country.mismatch": "ibanCountryMismatch",
|
|
889
|
+
// Routing code
|
|
890
|
+
"withdrawal.settings.error.bsbNumber": "invalidBsb",
|
|
891
|
+
"withdrawal.settings.error.sortcode": "invalidSortCode",
|
|
892
|
+
"withdrawal.settings.error.routingNumber": "empty",
|
|
893
|
+
"withdrawal.settings.error.routingcode": "invalid",
|
|
894
|
+
// SWIFT / BIC
|
|
895
|
+
"withdrawal.settings.error.bic": "empty",
|
|
896
|
+
"withdrawal.settings.error.bic.alphanumeric": "alphanumeric",
|
|
897
|
+
"withdrawal.settings.error.bic.invalid": "invalid",
|
|
898
|
+
// Bank account type
|
|
899
|
+
"global.error.invalid.accounttype": "empty",
|
|
900
|
+
// Bank name
|
|
901
|
+
"withdrawal.settings.error.bankName": "empty",
|
|
902
|
+
// Tax payer ID
|
|
903
|
+
"withdrawal.settings.error.taxPayerId": "empty",
|
|
904
|
+
"withdrawal.settings.error.taxPayerId.ar": "emptyAr",
|
|
905
|
+
"withdrawal.settings.error.taxPayerId.kr": "emptyKr",
|
|
906
|
+
"withdrawal.settings.error.taxPayerId.alphanumeric": "alphanumeric",
|
|
907
|
+
"withdrawal.settings.error.taxPayerId.alphanumeric.ar": "alphanumericAr",
|
|
908
|
+
"withdrawal.settings.error.taxPayerId.alphanumeric.kr": "alphanumericKr",
|
|
909
|
+
"withdrawal.settings.error.taxPayerId.invalid": "invalid",
|
|
910
|
+
"withdrawal.settings.error.taxPayerId.invalid.ar": "invalidAr",
|
|
911
|
+
"withdrawal.settings.error.taxPayerId.invalid.kr": "invalidKr",
|
|
912
|
+
"withdrawal.settings.error.taxPayerId.invalid.kzt": "invalidKzt",
|
|
913
|
+
"withdrawal.settings.error.taxPayerId.cnpj": "cnpjTooShort",
|
|
914
|
+
"withdrawal.settings.error.taxPayerId.cpf": "cpfTooShort",
|
|
915
|
+
// Patronymic name
|
|
916
|
+
"withdrawal.settings.error.patronymicName": "empty",
|
|
917
|
+
"withdrawal.settings.error.patronymicName.alphanumeric": "alphanumeric",
|
|
918
|
+
// VO code
|
|
919
|
+
"withdrawal.settings.error.voCode": "empty",
|
|
920
|
+
"withdrawal.settings.error.voCode.alphanumeric": "alphanumeric",
|
|
921
|
+
// Agency code
|
|
922
|
+
"withdrawal.settings.error.agencyCode": "empty",
|
|
923
|
+
"withdrawal.settings.error.agencyCode.alphanumeric": "alphanumeric",
|
|
924
|
+
"withdrawal.settings.error.agencyCode.length": "tooShort",
|
|
925
|
+
// Bank address fields
|
|
926
|
+
"withdrawal.settings.error.bankAddress": "empty",
|
|
927
|
+
"withdrawal.settings.error.bankCity": "empty",
|
|
928
|
+
"withdrawal.settings.error.bankProvinceState": "empty",
|
|
929
|
+
"withdrawal.settings.error.bankPostalCode": "empty",
|
|
930
|
+
// Branch code / name
|
|
931
|
+
"withdrawal.settings.error.branchCode": "invalid",
|
|
932
|
+
"withdrawal.settings.error.branchName": "empty",
|
|
933
|
+
// Classification code
|
|
934
|
+
"withdrawal.settings.error.classificationCode.invalid": "empty",
|
|
935
|
+
"withdrawal.settings.error.classificationCode.invalid.kzt": "invalidKzt",
|
|
936
|
+
// PayPal
|
|
937
|
+
"payment.error.email": "empty",
|
|
938
|
+
"payment.error.paypal_not_supported": "unsupportedCurrency",
|
|
939
|
+
"payment.error.email.invalid": "invalidEmail",
|
|
940
|
+
"payment.error.paypal_verification_incomplete": "verificationIncomplete",
|
|
941
|
+
// Payment schedule
|
|
942
|
+
"payment.error.no_threshold": "empty",
|
|
943
|
+
"payment.error.invalid_threshold": "invalid",
|
|
944
|
+
"payment.error.no_dayOfMonth": "empty",
|
|
945
|
+
"payment.error.invalid_dayOfMonth": "invalid",
|
|
946
|
+
};
|
|
806
947
|
function getFormInputs({ bitset, formMap }) {
|
|
807
948
|
// Convert bitset to binary representation
|
|
808
949
|
const binary = bitset.toString(2).padStart(Object.keys(formMap).length, "0");
|
|
@@ -826,6 +967,7 @@ const SAVE_WITHDRAWAL_SETTINGS = index_module.dist.gql `
|
|
|
826
967
|
validationErrors {
|
|
827
968
|
field
|
|
828
969
|
message
|
|
970
|
+
errorPath
|
|
829
971
|
}
|
|
830
972
|
}
|
|
831
973
|
}
|
|
@@ -841,6 +983,7 @@ const UPDATE_WITHDRAWAL_SETTINGS = index_module.dist.gql `
|
|
|
841
983
|
validationErrors {
|
|
842
984
|
field
|
|
843
985
|
message
|
|
986
|
+
errorPath
|
|
844
987
|
}
|
|
845
988
|
}
|
|
846
989
|
}
|
|
@@ -1013,10 +1156,13 @@ function useBankingInfoForm(props) {
|
|
|
1013
1156
|
else if (!success) {
|
|
1014
1157
|
console.error("Validation failed: ", validationErrors);
|
|
1015
1158
|
const mappedValidationErrors = validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.reduce((agg, error) => {
|
|
1159
|
+
const formField = API_FIELD_TO_FORM_FIELD[error.field] || error.field;
|
|
1160
|
+
const errorCode = API_ERROR_PATH_TO_FRONTEND[error.errorPath] || error.errorPath;
|
|
1016
1161
|
return {
|
|
1017
1162
|
...agg,
|
|
1018
|
-
[
|
|
1163
|
+
[formField]: {
|
|
1019
1164
|
type: "invalid",
|
|
1165
|
+
errorCode,
|
|
1020
1166
|
},
|
|
1021
1167
|
};
|
|
1022
1168
|
}, {});
|
|
@@ -1431,6 +1577,156 @@ const BankingInfoForm = class {
|
|
|
1431
1577
|
* @uiName Information modal button text
|
|
1432
1578
|
*/
|
|
1433
1579
|
this.modalButtonText = "I understand, update my information";
|
|
1580
|
+
// ──────────────────────────────────────────────────────────────────
|
|
1581
|
+
// Per-field validation error messages
|
|
1582
|
+
// Each prop uses ICU select on {errorCode} to pick the right message.
|
|
1583
|
+
// Error codes are short frontend keys mapped from the API error codes.
|
|
1584
|
+
// The `other` branch displays the raw API message directly via {errorCode},
|
|
1585
|
+
// which is already human-readable English (e.g. "Invalid Routing Code").
|
|
1586
|
+
// ──────────────────────────────────────────────────────────────────
|
|
1587
|
+
/**
|
|
1588
|
+
* Error messages for the beneficiary / account holder name field.
|
|
1589
|
+
* Supports error codes: empty, invalidCharacters, numeric, tooLong,
|
|
1590
|
+
* nonEnglish, businessNameMismatch, nameMismatch, businessPayeeMismatch, payeeMismatch
|
|
1591
|
+
* @uiName Beneficiary account name error
|
|
1592
|
+
* @uiWidget textArea
|
|
1593
|
+
*/
|
|
1594
|
+
this.beneficiaryAccountNameError = "{errorCode, select, empty {Account holder name is required} invalidCharacters {Account holder name contains invalid characters} numeric {Account holder name cannot be purely numeric} tooLong {Account holder name must be 70 characters or fewer} nonEnglish {Account holder name must contain only English characters for this currency} businessNameMismatch {Beneficiary name must match the name on your tax document} nameMismatch {Beneficiary name must match the name on your tax document} businessPayeeMismatch {Payee name must match the name on your tax document} payeeMismatch {Payee name must match the name on your tax document} other {{errorCode}}}";
|
|
1595
|
+
/**
|
|
1596
|
+
* Error messages for the bank account number / IBAN field.
|
|
1597
|
+
* Supports error codes: empty, invalidUk, invalid, ibanEmpty,
|
|
1598
|
+
* ibanAlphanumeric, ibanInvalid, ibanCountryMismatch
|
|
1599
|
+
* @uiName Bank account number / IBAN error
|
|
1600
|
+
* @uiWidget textArea
|
|
1601
|
+
*/
|
|
1602
|
+
this.bankAccountNumberError = "{errorCode, select, empty {Account number is required} invalidUk {Please enter a valid UK account number} invalid {Account number is invalid} ibanEmpty {IBAN is required} ibanAlphanumeric {IBAN must contain only letters and numbers} ibanInvalid {IBAN is invalid} ibanCountryMismatch {UK accounts must use an IBAN starting with GB} other {{errorCode}}}";
|
|
1603
|
+
/**
|
|
1604
|
+
* Error messages for the routing code / sort code / BSB field.
|
|
1605
|
+
* Supports error codes: invalidBsb, invalidSortCode, empty, invalid
|
|
1606
|
+
* @uiName Routing code error
|
|
1607
|
+
* @uiWidget textArea
|
|
1608
|
+
*/
|
|
1609
|
+
this.routingCodeError = "{errorCode, select, invalidBsb {Please enter a valid BSB number} invalidSortCode {Please enter a valid sort code} empty {Routing number is required} invalid {Routing number is invalid} other {{errorCode}}}";
|
|
1610
|
+
/**
|
|
1611
|
+
* Error messages for the SWIFT / BIC code field.
|
|
1612
|
+
* Supports error codes: empty, alphanumeric, invalid
|
|
1613
|
+
* @uiName SWIFT code error
|
|
1614
|
+
* @uiWidget textArea
|
|
1615
|
+
*/
|
|
1616
|
+
this.swiftCodeError = "{errorCode, select, empty {SWIFT/BIC code is required} alphanumeric {SWIFT/BIC code must contain only letters and numbers} invalid {SWIFT/BIC code is invalid} other {{errorCode}}}";
|
|
1617
|
+
/**
|
|
1618
|
+
* Error messages for the bank account type field.
|
|
1619
|
+
* Supports error codes: empty
|
|
1620
|
+
* @uiName Bank account type error
|
|
1621
|
+
* @uiWidget textArea
|
|
1622
|
+
*/
|
|
1623
|
+
this.bankAccountTypeError = "{errorCode, select, empty {Bank account type is required} other {{errorCode}}}";
|
|
1624
|
+
/**
|
|
1625
|
+
* Error messages for the bank name field.
|
|
1626
|
+
* Supports error codes: empty
|
|
1627
|
+
* @uiName Bank name error
|
|
1628
|
+
* @uiWidget textArea
|
|
1629
|
+
*/
|
|
1630
|
+
this.bankNameError = "{errorCode, select, empty {Bank name is required} other {{errorCode}}}";
|
|
1631
|
+
/**
|
|
1632
|
+
* Error messages for the tax payer ID / classification entity field.
|
|
1633
|
+
* Supports error codes: empty, emptyAr, emptyKr, alphanumeric, alphanumericAr,
|
|
1634
|
+
* alphanumericKr, invalid, invalidAr, invalidKr, invalidKzt, cnpjTooShort, cpfTooShort
|
|
1635
|
+
* @uiName Tax payer ID error
|
|
1636
|
+
* @uiWidget textArea
|
|
1637
|
+
*/
|
|
1638
|
+
this.taxPayerIdError = "{errorCode, select, empty {Tax payer ID is required} emptyAr {CUIT/CUIL is required} emptyKr {Classification ID is required} alphanumeric {Tax payer ID must contain only letters and numbers} alphanumericAr {CUIT/CUIL must contain only letters and numbers} alphanumericKr {Classification ID must contain only letters and numbers} invalid {Tax payer ID is invalid} invalidAr {CUIT/CUIL must be 11 characters} invalidKr {Classification ID length is invalid} invalidKzt {Tax payer ID must be 12 characters for KZT} cnpjTooShort {CNPJ must be at least 14 characters} cpfTooShort {CPF must be at least 11 characters} other {{errorCode}}}";
|
|
1639
|
+
/**
|
|
1640
|
+
* Error messages for the patronymic name field.
|
|
1641
|
+
* Supports error codes: empty, alphanumeric
|
|
1642
|
+
* @uiName Patronymic name error
|
|
1643
|
+
* @uiWidget textArea
|
|
1644
|
+
*/
|
|
1645
|
+
this.patronymicNameError = "{errorCode, select, empty {Patronymic name is required} alphanumeric {Patronymic name must contain only letters and numbers} other {{errorCode}}}";
|
|
1646
|
+
/**
|
|
1647
|
+
* Error messages for the VO code field.
|
|
1648
|
+
* Supports error codes: empty, alphanumeric
|
|
1649
|
+
* @uiName VO code error
|
|
1650
|
+
* @uiWidget textArea
|
|
1651
|
+
*/
|
|
1652
|
+
this.voCodeError = "{errorCode, select, empty {VO code is required} alphanumeric {VO code must contain only letters and numbers} other {{errorCode}}}";
|
|
1653
|
+
/**
|
|
1654
|
+
* Error messages for the agency code field.
|
|
1655
|
+
* Supports error codes: empty, alphanumeric, tooShort
|
|
1656
|
+
* @uiName Agency code error
|
|
1657
|
+
* @uiWidget textArea
|
|
1658
|
+
*/
|
|
1659
|
+
this.agencyCodeError = "{errorCode, select, empty {Agency code is required} alphanumeric {Agency code must contain only letters and numbers} tooShort {Agency code must be at least 5 characters} other {{errorCode}}}";
|
|
1660
|
+
/**
|
|
1661
|
+
* Error messages for the bank address field.
|
|
1662
|
+
* Supports error codes: empty
|
|
1663
|
+
* @uiName Bank address error
|
|
1664
|
+
* @uiWidget textArea
|
|
1665
|
+
*/
|
|
1666
|
+
this.bankAddressError = "{errorCode, select, empty {Bank address is required} other {{errorCode}}}";
|
|
1667
|
+
/**
|
|
1668
|
+
* Error messages for the bank city field.
|
|
1669
|
+
* Supports error codes: empty
|
|
1670
|
+
* @uiName Bank city error
|
|
1671
|
+
* @uiWidget textArea
|
|
1672
|
+
*/
|
|
1673
|
+
this.bankCityError = "{errorCode, select, empty {Bank city is required} other {{errorCode}}}";
|
|
1674
|
+
/**
|
|
1675
|
+
* Error messages for the bank province/state field.
|
|
1676
|
+
* Supports error codes: empty
|
|
1677
|
+
* @uiName Bank province/state error
|
|
1678
|
+
* @uiWidget textArea
|
|
1679
|
+
*/
|
|
1680
|
+
this.bankStateError = "{errorCode, select, empty {Bank province/state is required} other {{errorCode}}}";
|
|
1681
|
+
/**
|
|
1682
|
+
* Error messages for the bank postal code field.
|
|
1683
|
+
* Supports error codes: empty
|
|
1684
|
+
* @uiName Bank postal code error
|
|
1685
|
+
* @uiWidget textArea
|
|
1686
|
+
*/
|
|
1687
|
+
this.bankPostalCodeError = "{errorCode, select, empty {Bank postal code is required} other {{errorCode}}}";
|
|
1688
|
+
/**
|
|
1689
|
+
* Error messages for the branch code field.
|
|
1690
|
+
* Supports error codes: invalid
|
|
1691
|
+
* @uiName Branch code error
|
|
1692
|
+
* @uiWidget textArea
|
|
1693
|
+
*/
|
|
1694
|
+
this.branchCodeError = "{errorCode, select, invalid {Branch code is invalid} other {{errorCode}}}";
|
|
1695
|
+
/**
|
|
1696
|
+
* Error messages for the branch name field.
|
|
1697
|
+
* Supports error codes: empty
|
|
1698
|
+
* @uiName Branch name error
|
|
1699
|
+
* @uiWidget textArea
|
|
1700
|
+
*/
|
|
1701
|
+
this.branchNameError = "{errorCode, select, empty {Branch name is required} other {{errorCode}}}";
|
|
1702
|
+
/**
|
|
1703
|
+
* Error messages for the classification code field.
|
|
1704
|
+
* Supports error codes: empty, invalidKzt
|
|
1705
|
+
* @uiName Classification code error
|
|
1706
|
+
* @uiWidget textArea
|
|
1707
|
+
*/
|
|
1708
|
+
this.classificationCodeError = "{errorCode, select, empty {Classification code is required} invalidKzt {Classification code must be exactly 2 characters} other {{errorCode}}}";
|
|
1709
|
+
/**
|
|
1710
|
+
* Error messages for the PayPal email field.
|
|
1711
|
+
* Supports error codes: empty, unsupportedCurrency, invalidEmail, verificationIncomplete
|
|
1712
|
+
* @uiName PayPal email error
|
|
1713
|
+
* @uiWidget textArea
|
|
1714
|
+
*/
|
|
1715
|
+
this.paypalEmailError = "{errorCode, select, empty {PayPal email is required} unsupportedCurrency {PayPal is not supported for this currency} invalidEmail {Please enter a valid email address} verificationIncomplete {PayPal verification is not complete} other {{errorCode}}}";
|
|
1716
|
+
/**
|
|
1717
|
+
* Error messages for the payment threshold field.
|
|
1718
|
+
* Supports error codes: empty, invalid
|
|
1719
|
+
* @uiName Payment threshold error
|
|
1720
|
+
* @uiWidget textArea
|
|
1721
|
+
*/
|
|
1722
|
+
this.paymentThresholdError = "{errorCode, select, empty {Payment threshold is required} invalid {Payment threshold is invalid} other {{errorCode}}}";
|
|
1723
|
+
/**
|
|
1724
|
+
* Error messages for the payment day field.
|
|
1725
|
+
* Supports error codes: empty, invalid
|
|
1726
|
+
* @uiName Payment day error
|
|
1727
|
+
* @uiWidget textArea
|
|
1728
|
+
*/
|
|
1729
|
+
this.paymentDayError = "{errorCode, select, empty {Payment day is required} invalid {Payment day must be the 1st or the 15th} other {{errorCode}}}";
|
|
1434
1730
|
domContextHooks_module.h$1(this);
|
|
1435
1731
|
}
|
|
1436
1732
|
disconnectedCallback() { }
|
|
@@ -1444,17 +1740,54 @@ const BankingInfoForm = class {
|
|
|
1444
1740
|
loadingErrorAlertDescription: props.loadingErrorAlertDescription,
|
|
1445
1741
|
loadingErrorAlertHeader: props.loadingErrorAlertHeader,
|
|
1446
1742
|
},
|
|
1743
|
+
errorMessages: {
|
|
1744
|
+
beneficiaryAccountName: props.beneficiaryAccountNameError,
|
|
1745
|
+
bankAccountNumber: props.bankAccountNumberError,
|
|
1746
|
+
routingCode: props.routingCodeError,
|
|
1747
|
+
swiftCode: props.swiftCodeError,
|
|
1748
|
+
bankAccountType: props.bankAccountTypeError,
|
|
1749
|
+
bankName: props.bankNameError,
|
|
1750
|
+
taxPayerId: props.taxPayerIdError,
|
|
1751
|
+
patronymicName: props.patronymicNameError,
|
|
1752
|
+
voCode: props.voCodeError,
|
|
1753
|
+
agencyCode: props.agencyCodeError,
|
|
1754
|
+
bankAddress: props.bankAddressError,
|
|
1755
|
+
bankCity: props.bankCityError,
|
|
1756
|
+
bankState: props.bankStateError,
|
|
1757
|
+
bankPostalCode: props.bankPostalCodeError,
|
|
1758
|
+
branchCode: props.branchCodeError,
|
|
1759
|
+
branchName: props.branchNameError,
|
|
1760
|
+
beneficiaryClassification: props.classificationCodeError,
|
|
1761
|
+
paypalEmailAddress: props.paypalEmailError,
|
|
1762
|
+
paymentThreshold: props.paymentThresholdError,
|
|
1763
|
+
paymentDay: props.paymentDayError,
|
|
1764
|
+
},
|
|
1447
1765
|
};
|
|
1448
1766
|
}
|
|
1449
1767
|
render() {
|
|
1450
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
1768
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
1451
1769
|
const props = index_module.isDemo()
|
|
1452
1770
|
? useDemoBankingInfoForm(this)
|
|
1453
1771
|
: useBankingInfoForm(this);
|
|
1454
1772
|
const { errors } = props.states.formState;
|
|
1455
1773
|
const fieldRequiredError = this.fieldRequiredError;
|
|
1456
1774
|
const fieldInvalidError = this.fieldInvalidError;
|
|
1457
|
-
function getValidationErrorMessage({ type, label, }) {
|
|
1775
|
+
function getValidationErrorMessage({ type, label, errorCode, fieldName, }) {
|
|
1776
|
+
var _a;
|
|
1777
|
+
// If we have a specific error code from the API, try to use
|
|
1778
|
+
// the per-field ICU error message template for a rich message
|
|
1779
|
+
if (type === "invalid" && errorCode && fieldName) {
|
|
1780
|
+
const errorTemplate = (_a = props.text.errorMessages) === null || _a === void 0 ? void 0 : _a[fieldName];
|
|
1781
|
+
if (errorTemplate) {
|
|
1782
|
+
return global.intl.formatMessage({
|
|
1783
|
+
id: `fieldError-${fieldName}-${errorCode}`,
|
|
1784
|
+
defaultMessage: errorTemplate,
|
|
1785
|
+
}, {
|
|
1786
|
+
errorCode,
|
|
1787
|
+
fieldName: label,
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1458
1791
|
if (type === "required") {
|
|
1459
1792
|
return global.intl.formatMessage({
|
|
1460
1793
|
id: `requiredText-${label}`,
|
|
@@ -1537,37 +1870,45 @@ const BankingInfoForm = class {
|
|
|
1537
1870
|
helpText: getValidationErrorMessage({
|
|
1538
1871
|
type: (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _b === void 0 ? void 0 : _b.bankCountry) === null || _c === void 0 ? void 0 : _c.type,
|
|
1539
1872
|
label: props.text.bankLocationLabel,
|
|
1873
|
+
errorCode: (_e = (_d = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _d === void 0 ? void 0 : _d.bankCountry) === null || _e === void 0 ? void 0 : _e.errorCode,
|
|
1874
|
+
fieldName: "bankCountry",
|
|
1540
1875
|
}),
|
|
1541
1876
|
})), index.h("sl-input", { disabled: props.states.saveLoading, class: sheet.classes.SearchInput, placeholder: this.searchForCountryText, onKeyDown: (e) => {
|
|
1542
1877
|
// Stop shoelace intercepting key presses
|
|
1543
1878
|
e.stopPropagation();
|
|
1544
1879
|
}, "onSl-input": (e) => {
|
|
1545
1880
|
props.callbacks.setCountrySearch(e.target.value);
|
|
1546
|
-
} }), (
|
|
1547
|
-
|
|
1881
|
+
} }), (_f = props.states.countries) === null || _f === void 0 ? void 0 :
|
|
1882
|
+
_f.map((country) => {
|
|
1548
1883
|
return (index.h("sl-menu-item", { value: country.countryCode }, country.displayName));
|
|
1549
|
-
}), (
|
|
1550
|
-
|
|
1884
|
+
}), (_h = (_g = props.states) === null || _g === void 0 ? void 0 : _g.allCountries) === null || _h === void 0 ? void 0 :
|
|
1885
|
+
_h.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName))))),
|
|
1551
1886
|
paymentMethodSlot: (index.h("sl-input", { key: "paymentMethod", label: props.text.paymentMethod, placeholder: props.states.paymentMethodFeeLabel, disabled: true })),
|
|
1552
|
-
paymentThresholdSelectSlot: (index.h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentThresholdSelectLabel, name: "/paymentThreshold", id: "paymentThreshold", value: ((
|
|
1887
|
+
paymentThresholdSelectSlot: (index.h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentThresholdSelectLabel, name: "/paymentThreshold", id: "paymentThreshold", value: ((_k = (_j = props.states) === null || _j === void 0 ? void 0 : _j.formState) === null || _k === void 0 ? void 0 : _k.paymentThreshold) || "" }, (((_l = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _l === void 0 ? void 0 : _l.paymentThreshold) && {
|
|
1553
1888
|
class: "error-input",
|
|
1554
1889
|
helpText: getValidationErrorMessage({
|
|
1555
|
-
type: (
|
|
1890
|
+
type: (_o = (_m = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _m === void 0 ? void 0 : _m.paymentThreshold) === null || _o === void 0 ? void 0 : _o.type,
|
|
1556
1891
|
label: props.text.paymentThresholdSelectLabel,
|
|
1892
|
+
errorCode: (_q = (_p = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _p === void 0 ? void 0 : _p.paymentThreshold) === null || _q === void 0 ? void 0 : _q.errorCode,
|
|
1893
|
+
fieldName: "paymentThreshold",
|
|
1557
1894
|
}),
|
|
1558
1895
|
})), props.states.thresholds.map((t) => (index.h("sl-menu-item", { value: t }, `${props.states.currency}${t}`))))),
|
|
1559
|
-
paymentFixedDaySelectSlot: (index.h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentDaySelectLabel, value: ((
|
|
1896
|
+
paymentFixedDaySelectSlot: (index.h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentDaySelectLabel, value: ((_s = (_r = props.states) === null || _r === void 0 ? void 0 : _r.formState) === null || _s === void 0 ? void 0 : _s.paymentDay) || "", name: "/paymentDay", id: "paymentDay" }, (((_t = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _t === void 0 ? void 0 : _t.paymentDay) && {
|
|
1560
1897
|
class: "error-input",
|
|
1561
1898
|
helpText: getValidationErrorMessage({
|
|
1562
|
-
type: (
|
|
1899
|
+
type: (_v = (_u = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _u === void 0 ? void 0 : _u.paymentDay) === null || _v === void 0 ? void 0 : _v.type,
|
|
1563
1900
|
label: props.text.paymentDaySelectLabel,
|
|
1901
|
+
errorCode: (_x = (_w = errors === null || errors === void 0 ? void 0 : errors.inputErrors) === null || _w === void 0 ? void 0 : _w.paymentDay) === null || _x === void 0 ? void 0 : _x.errorCode,
|
|
1902
|
+
fieldName: "paymentDay",
|
|
1564
1903
|
}),
|
|
1565
1904
|
})), index.h("sl-menu-item", { value: "1" }, props.text.paymentDayFirstOfMonthLabelText), index.h("sl-menu-item", { value: "15" }, props.text.paymentDayFifteenthOfMonthLabelText))),
|
|
1566
|
-
paypalInputSlot: (index.h("sl-input", Object.assign({ required: true, disabled: props.states.saveLoading, value: ((
|
|
1905
|
+
paypalInputSlot: (index.h("sl-input", Object.assign({ required: true, disabled: props.states.saveLoading, value: ((_z = (_y = props.states) === null || _y === void 0 ? void 0 : _y.formState) === null || _z === void 0 ? void 0 : _z.paypalEmailAddress) || "", label: props.text.payPalInputLabel, key: "paypalEmailAddress", name: "/paypalEmailAddress", id: "paypalEmailAddress", type: "text" }, (((_2 = (_1 = (_0 = props.states.formState) === null || _0 === void 0 ? void 0 : _0.errors) === null || _1 === void 0 ? void 0 : _1.inputErrors) === null || _2 === void 0 ? void 0 : _2.paypalEmailAddress) && {
|
|
1567
1906
|
class: "error-input",
|
|
1568
1907
|
helpText: getValidationErrorMessage({
|
|
1569
|
-
type: (
|
|
1908
|
+
type: (_6 = (_5 = (_4 = (_3 = props.states.formState) === null || _3 === void 0 ? void 0 : _3.errors) === null || _4 === void 0 ? void 0 : _4.inputErrors) === null || _5 === void 0 ? void 0 : _5.paypalEmailAddress) === null || _6 === void 0 ? void 0 : _6.type,
|
|
1570
1909
|
label: props.text.payPalInputLabel,
|
|
1910
|
+
errorCode: (_10 = (_9 = (_8 = (_7 = props.states.formState) === null || _7 === void 0 ? void 0 : _7.errors) === null || _8 === void 0 ? void 0 : _8.inputErrors) === null || _9 === void 0 ? void 0 : _9.paypalEmailAddress) === null || _10 === void 0 ? void 0 : _10.errorCode,
|
|
1911
|
+
fieldName: "paypalEmailAddress",
|
|
1571
1912
|
}),
|
|
1572
1913
|
})))),
|
|
1573
1914
|
} })));
|