@saasquatch/mint-components 2.1.7 → 2.1.8-1
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/{ShadowViewAddon-1d15cdf7.js → ShadowViewAddon-5ce32291.js} +89 -0
- 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 +377 -50
- package/dist/cjs/{sqm-big-stat_45.cjs.entry.js → sqm-big-stat_46.cjs.entry.js} +329 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +158 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sqm-partner-info-modal/PartnerInfoModal.stories.js +143 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +90 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +462 -0
- package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +180 -0
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +2 -0
- 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 +95 -1
- package/dist/esm/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.js} +89 -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 +377 -50
- package/dist/esm/{sqm-big-stat_45.entry.js → sqm-big-stat_46.entry.js} +333 -6
- package/dist/esm/sqm-stencilbook.entry.js +158 -1
- package/dist/esm-es5/{ShadowViewAddon-53b9090b.js → ShadowViewAddon-9d97b5d5.js} +1 -1
- 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/esm-es5/sqm-big-stat_46.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-0f036907.system.js +1 -0
- package/dist/mint-components/{p-0e6c90b1.entry.js → p-22e39d2c.entry.js} +90 -21
- package/dist/mint-components/p-499885aa.entry.js +9 -0
- package/dist/mint-components/p-a6621899.system.entry.js +1 -0
- package/dist/mint-components/{p-e980472a.js → p-adc4e263.js} +25 -25
- package/dist/mint-components/p-b0253f4c.entry.js +108 -0
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/mint-components/p-d93e19e9.system.entry.js +1 -0
- package/dist/mint-components/p-e45a9966.system.entry.js +1 -0
- package/dist/types/components/sqm-partner-info-modal/PartnerInfoModal.stories.d.ts +13 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +41 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +80 -0
- package/dist/types/components/sqm-partner-info-modal/usePartnerInfoModal.d.ts +16 -0
- 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 +378 -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/esm-es5/sqm-big-stat_45.entry.js +0 -1
- package/dist/mint-components/p-54ea8b9b.system.entry.js +0 -1
- package/dist/mint-components/p-807ed3bf.system.js +0 -1
- package/dist/mint-components/p-cacb897d.system.entry.js +0 -1
- package/dist/mint-components/p-de7bb373.entry.js +0 -9
- package/dist/mint-components/p-e9258d20.system.entry.js +0 -1
- package/dist/mint-components/p-ff378015.entry.js +0 -106
|
@@ -18,7 +18,7 @@ import { b as VERIFICATION_EVENT_KEY } from './keys-406491dc.js';
|
|
|
18
18
|
import { T as TAX_FORM_UPDATED_EVENT_KEY, a as useVeriffApp, g as getStatus, V as VERIFF_COMPLETE_EVENT_KEY } from './usePayoutStatus-46c0c289.js';
|
|
19
19
|
|
|
20
20
|
function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
21
|
-
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;
|
|
21
|
+
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;
|
|
22
22
|
const { errors, ...formState } = props.states.formState;
|
|
23
23
|
return {
|
|
24
24
|
0: {
|
|
@@ -27,44 +27,54 @@ function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
|
27
27
|
helpText: getValidationErrorMessage({
|
|
28
28
|
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,
|
|
29
29
|
label: props.text.beneficiaryAccountNameLabel,
|
|
30
|
+
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,
|
|
31
|
+
fieldName: "beneficiaryAccountName",
|
|
30
32
|
}),
|
|
31
33
|
})))),
|
|
32
34
|
},
|
|
33
35
|
1: {
|
|
34
|
-
input: (h("sl-select", Object.assign({ required: true, label: props.text.bankAccountTypeLabel, name: "/bankAccountType", id: "bankAccountType", key: "bankAccountType" }, (((
|
|
36
|
+
input: (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) && {
|
|
35
37
|
class: "error-input",
|
|
36
38
|
helpText: getValidationErrorMessage({
|
|
37
|
-
type: (
|
|
39
|
+
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,
|
|
38
40
|
label: props.text.bankAccountTypeLabel,
|
|
41
|
+
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,
|
|
42
|
+
fieldName: "bankAccountType",
|
|
39
43
|
}),
|
|
40
44
|
})),
|
|
41
45
|
h("sl-menu-item", { value: "CHECKING" }, props.text.checkingSelectItemLabel),
|
|
42
46
|
h("sl-menu-item", { value: "SAVINGS" }, props.text.savingsSelectItemLabel))),
|
|
43
47
|
},
|
|
44
48
|
2: {
|
|
45
|
-
input: (h("sl-input", Object.assign({ required: true, label: props.text.bankAccountNumberLabel, name: "/bankAccountNumber", id: "bankAccountNumber", key: "bankAccountNumber", value: formState.bankAccountNumber, type: "text" }, (((
|
|
49
|
+
input: (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) && {
|
|
46
50
|
class: "error-input",
|
|
47
51
|
helpText: getValidationErrorMessage({
|
|
48
|
-
type: (
|
|
52
|
+
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,
|
|
49
53
|
label: props.text.bankAccountNumberLabel,
|
|
54
|
+
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,
|
|
55
|
+
fieldName: "bankAccountNumber",
|
|
50
56
|
}),
|
|
51
57
|
})))),
|
|
52
58
|
},
|
|
53
59
|
3: {
|
|
54
|
-
input: (h("sl-input", Object.assign({ required: true, label: props.text.ibanLabel, name: "/bankAccountNumber", id: "iban", key: "iban", type: "text", value: formState.bankAccountNumber }, (((
|
|
60
|
+
input: (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) && {
|
|
55
61
|
class: "error-input",
|
|
56
62
|
helpText: getValidationErrorMessage({
|
|
57
|
-
type: (
|
|
63
|
+
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,
|
|
58
64
|
label: props.text.ibanLabel,
|
|
65
|
+
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,
|
|
66
|
+
fieldName: "bankAccountNumber",
|
|
59
67
|
}),
|
|
60
68
|
})))),
|
|
61
69
|
},
|
|
62
70
|
4: {
|
|
63
|
-
input: (h("sl-input", Object.assign({ required: true, label: props.text.swiftCodeLabel, name: "/swiftCode", id: "swiftCode", key: "swiftCode", type: "text" }, (((
|
|
71
|
+
input: (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) && {
|
|
64
72
|
class: "error-input",
|
|
65
73
|
helpText: getValidationErrorMessage({
|
|
66
|
-
type: (
|
|
74
|
+
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,
|
|
67
75
|
label: props.text.swiftCodeLabel,
|
|
76
|
+
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,
|
|
77
|
+
fieldName: "swiftCode",
|
|
68
78
|
}),
|
|
69
79
|
})))),
|
|
70
80
|
},
|
|
@@ -74,35 +84,41 @@ function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
|
74
84
|
defaultMessage: props.text.routingCodeLabel,
|
|
75
85
|
}, {
|
|
76
86
|
bankCountry,
|
|
77
|
-
}), name: "/routingCode", id: "routingCode", key: "routingCode", type: "text" }, (((
|
|
87
|
+
}), 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) && {
|
|
78
88
|
class: "error-input",
|
|
79
89
|
helpText: getValidationErrorMessage({
|
|
80
|
-
type: (
|
|
90
|
+
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,
|
|
81
91
|
label: intl.formatMessage({
|
|
82
92
|
id: "routingCodeErrorText",
|
|
83
93
|
defaultMessage: props.text.routingCodeLabel,
|
|
84
94
|
}, {
|
|
85
95
|
bankCountry,
|
|
86
96
|
}),
|
|
97
|
+
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,
|
|
98
|
+
fieldName: "routingCode",
|
|
87
99
|
}),
|
|
88
100
|
})))),
|
|
89
101
|
},
|
|
90
102
|
6: {
|
|
91
|
-
input: (h("sl-input", Object.assign({ required: true, label: props.text.bankNameLabel, name: "/bankName", id: "bankName", key: "bankName", type: "text" }, (((
|
|
103
|
+
input: (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) && {
|
|
92
104
|
class: "error-input",
|
|
93
105
|
helpText: getValidationErrorMessage({
|
|
94
|
-
type: (
|
|
106
|
+
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,
|
|
95
107
|
label: props.text.bankNameLabel,
|
|
108
|
+
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,
|
|
109
|
+
fieldName: "bankName",
|
|
96
110
|
}),
|
|
97
111
|
})))),
|
|
98
112
|
},
|
|
99
113
|
7: {
|
|
100
114
|
input: [
|
|
101
|
-
h("sl-select", Object.assign({ required: true, label: props.text.classificationLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((
|
|
115
|
+
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) && {
|
|
102
116
|
class: "error-input",
|
|
103
117
|
helpText: getValidationErrorMessage({
|
|
104
|
-
type: (
|
|
118
|
+
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,
|
|
105
119
|
label: props.text.classificationLabel,
|
|
120
|
+
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,
|
|
121
|
+
fieldName: "beneficiaryClassification",
|
|
106
122
|
}),
|
|
107
123
|
})),
|
|
108
124
|
h("sl-menu-item", { value: "BUSINESS" }, props.text.businessSelectItemLabel),
|
|
@@ -113,100 +129,122 @@ function getFormMap({ props, getValidationErrorMessage, bankCountry, }) {
|
|
|
113
129
|
defaultMessage: props.text.taxPayerIdLabel,
|
|
114
130
|
}, {
|
|
115
131
|
bankCountry,
|
|
116
|
-
}), type: "text", name: "/beneficiaryTaxPayerId", id: "beneficiaryTaxPayerId", key: "beneficiaryTaxPayerId" }, (((
|
|
132
|
+
}), 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) && {
|
|
117
133
|
class: "error-input",
|
|
118
134
|
helpText: getValidationErrorMessage({
|
|
119
|
-
type: (
|
|
135
|
+
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,
|
|
120
136
|
label: props.text.taxPayerIdLabel,
|
|
137
|
+
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,
|
|
138
|
+
fieldName: "taxPayerId",
|
|
121
139
|
}),
|
|
122
140
|
}))),
|
|
123
141
|
],
|
|
124
142
|
},
|
|
125
143
|
8: {
|
|
126
|
-
input: (h("sl-select", Object.assign({ required: true, label: props.text.classificationCPFLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((
|
|
144
|
+
input: (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) && {
|
|
127
145
|
class: "error-input",
|
|
128
146
|
helpText: getValidationErrorMessage({
|
|
129
|
-
type: (
|
|
147
|
+
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,
|
|
130
148
|
label: props.text.classificationCPFLabel,
|
|
149
|
+
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,
|
|
150
|
+
fieldName: "beneficiaryClassification",
|
|
131
151
|
}),
|
|
132
152
|
})),
|
|
133
153
|
h("sl-menu-item", { value: "CPF" }, "CPF"),
|
|
134
154
|
h("sl-menu-item", { value: "CNPJ" }, "CNPJ"))),
|
|
135
155
|
},
|
|
136
156
|
9: {
|
|
137
|
-
input: (h("sl-input", Object.assign({ key: "patronymicName", required: true, label: props.text.patronymicNameLabel, name: "/patronymicName", id: "patronymicName", type: "text" }, (((
|
|
157
|
+
input: (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) && {
|
|
138
158
|
class: "error-input",
|
|
139
159
|
helpText: getValidationErrorMessage({
|
|
140
|
-
type: (
|
|
160
|
+
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,
|
|
141
161
|
label: props.text.patronymicNameLabel,
|
|
162
|
+
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,
|
|
163
|
+
fieldName: "patronymicName",
|
|
142
164
|
}),
|
|
143
165
|
})))),
|
|
144
166
|
},
|
|
145
167
|
10: {
|
|
146
|
-
input: (h("sl-input", Object.assign({ key: "voCode", label: props.text.voCodeLabel, name: "/voCode", id: "voCode", type: "text" }, (((
|
|
168
|
+
input: (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) && {
|
|
147
169
|
class: "error-input",
|
|
148
170
|
helpText: getValidationErrorMessage({
|
|
149
|
-
type: (
|
|
171
|
+
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,
|
|
150
172
|
label: props.text.voCodeLabel,
|
|
173
|
+
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,
|
|
174
|
+
fieldName: "voCode",
|
|
151
175
|
}),
|
|
152
176
|
})))),
|
|
153
177
|
},
|
|
154
178
|
11: {
|
|
155
|
-
input: (h("sl-input", Object.assign({ required: true, label: props.text.agencyCodeLabel, name: "/agencyCode", id: "agencyCode", key: "agencyCode", type: "text" }, (((
|
|
179
|
+
input: (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) && {
|
|
156
180
|
class: "error-input",
|
|
157
181
|
helpText: getValidationErrorMessage({
|
|
158
|
-
type: (
|
|
182
|
+
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,
|
|
159
183
|
label: props.text.agencyCodeLabel,
|
|
184
|
+
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,
|
|
185
|
+
fieldName: "agencyCode",
|
|
160
186
|
}),
|
|
161
187
|
})))),
|
|
162
188
|
},
|
|
163
189
|
12: {
|
|
164
190
|
input: [
|
|
165
|
-
h("sl-input", Object.assign({ required: true, label: props.text.bankAddressLabel, name: "/bankAddress", id: "bankAddress", key: "bankAddress", type: "text" }, (((
|
|
191
|
+
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) && {
|
|
166
192
|
class: "error-input",
|
|
167
193
|
helpText: getValidationErrorMessage({
|
|
168
|
-
type: (
|
|
194
|
+
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,
|
|
169
195
|
label: props.text.bankAddressLabel,
|
|
196
|
+
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,
|
|
197
|
+
fieldName: "bankAddress",
|
|
170
198
|
}),
|
|
171
199
|
}))),
|
|
172
|
-
h("sl-input", Object.assign({ required: true, label: props.text.bankCityLabel, name: "/bankCity", id: "bankCity", key: "bankCity", type: "text" }, (((
|
|
200
|
+
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) && {
|
|
173
201
|
class: "error-input",
|
|
174
202
|
helpText: getValidationErrorMessage({
|
|
175
|
-
type: (
|
|
203
|
+
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,
|
|
176
204
|
label: props.text.bankCityLabel,
|
|
205
|
+
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,
|
|
206
|
+
fieldName: "bankCity",
|
|
177
207
|
}),
|
|
178
208
|
}))),
|
|
179
|
-
h("sl-input", Object.assign({ required: true, label: props.text.bankStateLabel, name: "/bankState", id: "bankState", key: "bankState", type: "text" }, (((
|
|
209
|
+
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) && {
|
|
180
210
|
class: "error-input",
|
|
181
211
|
helpText: getValidationErrorMessage({
|
|
182
|
-
type: (
|
|
212
|
+
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,
|
|
183
213
|
label: props.text.bankStateLabel,
|
|
214
|
+
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,
|
|
215
|
+
fieldName: "bankState",
|
|
184
216
|
}),
|
|
185
217
|
}))),
|
|
186
|
-
h("sl-input", Object.assign({ required: true, label: props.text.bankPostalCodeLabel, name: "/bankPostalCode", id: "bankPostalCode", key: "bankPostalCode", type: "text" }, (((
|
|
218
|
+
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) && {
|
|
187
219
|
class: "error-input",
|
|
188
220
|
helpText: getValidationErrorMessage({
|
|
189
|
-
type: (
|
|
221
|
+
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,
|
|
190
222
|
label: props.text.bankPostalCodeLabel,
|
|
223
|
+
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,
|
|
224
|
+
fieldName: "bankPostalCode",
|
|
191
225
|
}),
|
|
192
226
|
}))),
|
|
193
227
|
],
|
|
194
228
|
},
|
|
195
229
|
13: {
|
|
196
|
-
input: (h("sl-input", Object.assign({ required: true, label: props.text.branchCodeLabel, name: "/branchCode", id: "branchCode", key: "branchCode", type: "text" }, (((
|
|
230
|
+
input: (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) && {
|
|
197
231
|
class: "error-input",
|
|
198
232
|
helpText: getValidationErrorMessage({
|
|
199
|
-
type: (
|
|
233
|
+
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,
|
|
200
234
|
label: props.text.branchCodeLabel,
|
|
235
|
+
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,
|
|
236
|
+
fieldName: "branchCode",
|
|
201
237
|
}),
|
|
202
238
|
})))),
|
|
203
239
|
},
|
|
204
240
|
14: {
|
|
205
|
-
input: (h("sl-select", Object.assign({ required: true, label: props.text.classificationLabel, name: "/beneficiaryClassification", id: "beneficiaryClassification", key: "beneficiaryClassification" }, (((
|
|
241
|
+
input: (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) && {
|
|
206
242
|
class: "error-input",
|
|
207
243
|
helpText: getValidationErrorMessage({
|
|
208
|
-
type: (
|
|
244
|
+
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,
|
|
209
245
|
label: props.text.classificationLabel,
|
|
246
|
+
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,
|
|
247
|
+
fieldName: "beneficiaryClassification",
|
|
210
248
|
}),
|
|
211
249
|
})),
|
|
212
250
|
h("sl-menu-item", { value: "BUSINESS" }, props.text.businessSelectItemLabel),
|
|
@@ -799,6 +837,95 @@ const paypalFeeMap = {
|
|
|
799
837
|
const ACH_PAYMENT_METHOD = 3;
|
|
800
838
|
const WIRE_PAYMENT_METHOD = 5;
|
|
801
839
|
const PAYPAL_PAYMENT_METHOD = 7;
|
|
840
|
+
/**
|
|
841
|
+
* Maps GraphQL validation error field names to form field names.
|
|
842
|
+
*/
|
|
843
|
+
const API_FIELD_TO_FORM_FIELD = {
|
|
844
|
+
// bankProvinceState → form uses bankState
|
|
845
|
+
bankProvinceState: "bankState",
|
|
846
|
+
};
|
|
847
|
+
/**
|
|
848
|
+
* Maps Impact API error code paths (from validationErrors[].errorPath) to short,
|
|
849
|
+
* readable frontend error codes used in the ICU select props.
|
|
850
|
+
*/
|
|
851
|
+
const API_ERROR_PATH_TO_FRONTEND = {
|
|
852
|
+
// Beneficiary account name
|
|
853
|
+
"withdrawal.settings.error.empty_beneficiaryname": "empty",
|
|
854
|
+
"withdrawal.settings.error.invalid_character_beneficiaryname": "invalidCharacters",
|
|
855
|
+
"withdrawal.settings.error.numeric_beneficiaryname": "numeric",
|
|
856
|
+
"withdrawal_settings.error.beneficiaryname.size": "tooLong",
|
|
857
|
+
"withdrawal.settings.error.non_english_beneficiaryname": "nonEnglish",
|
|
858
|
+
"withdrawal_settings.error.business_beneficiaryname_match": "businessNameMismatch",
|
|
859
|
+
"withdrawal_settings.error.beneficiaryname_match": "nameMismatch",
|
|
860
|
+
"withdrawal_settings.error.business_checkpayeename_match": "businessPayeeMismatch",
|
|
861
|
+
"withdrawal_settings.error.checkpayeename_match": "payeeMismatch",
|
|
862
|
+
// Bank account number
|
|
863
|
+
"withdrawal.settings.error.accountnumber.empty": "empty",
|
|
864
|
+
"withdrawal.settings.error.accountnumber.uk": "invalidUk",
|
|
865
|
+
"withdrawal.settings.error.bankaccount.invalid": "invalid",
|
|
866
|
+
// IBAN
|
|
867
|
+
"withdrawal.settings.error.iban": "ibanEmpty",
|
|
868
|
+
"withdrawal.settings.error.iban.alphanumeric": "ibanAlphanumeric",
|
|
869
|
+
"withdrawal.settings.error.iban.invalid": "ibanInvalid",
|
|
870
|
+
"withdrawal.settings.error.iban.uk.country.mismatch": "ibanCountryMismatch",
|
|
871
|
+
// Routing code
|
|
872
|
+
"withdrawal.settings.error.bsbNumber": "invalidBsb",
|
|
873
|
+
"withdrawal.settings.error.sortcode": "invalidSortCode",
|
|
874
|
+
"withdrawal.settings.error.routingNumber": "empty",
|
|
875
|
+
"withdrawal.settings.error.routingcode": "invalid",
|
|
876
|
+
// SWIFT / BIC
|
|
877
|
+
"withdrawal.settings.error.bic": "empty",
|
|
878
|
+
"withdrawal.settings.error.bic.alphanumeric": "alphanumeric",
|
|
879
|
+
"withdrawal.settings.error.bic.invalid": "invalid",
|
|
880
|
+
// Bank account type
|
|
881
|
+
"global.error.invalid.accounttype": "empty",
|
|
882
|
+
// Bank name
|
|
883
|
+
"withdrawal.settings.error.bankName": "empty",
|
|
884
|
+
// Tax payer ID
|
|
885
|
+
"withdrawal.settings.error.taxPayerId": "empty",
|
|
886
|
+
"withdrawal.settings.error.taxPayerId.ar": "emptyAr",
|
|
887
|
+
"withdrawal.settings.error.taxPayerId.kr": "emptyKr",
|
|
888
|
+
"withdrawal.settings.error.taxPayerId.alphanumeric": "alphanumeric",
|
|
889
|
+
"withdrawal.settings.error.taxPayerId.alphanumeric.ar": "alphanumericAr",
|
|
890
|
+
"withdrawal.settings.error.taxPayerId.alphanumeric.kr": "alphanumericKr",
|
|
891
|
+
"withdrawal.settings.error.taxPayerId.invalid": "invalid",
|
|
892
|
+
"withdrawal.settings.error.taxPayerId.invalid.ar": "invalidAr",
|
|
893
|
+
"withdrawal.settings.error.taxPayerId.invalid.kr": "invalidKr",
|
|
894
|
+
"withdrawal.settings.error.taxPayerId.invalid.kzt": "invalidKzt",
|
|
895
|
+
"withdrawal.settings.error.taxPayerId.cnpj": "cnpjTooShort",
|
|
896
|
+
"withdrawal.settings.error.taxPayerId.cpf": "cpfTooShort",
|
|
897
|
+
// Patronymic name
|
|
898
|
+
"withdrawal.settings.error.patronymicName": "empty",
|
|
899
|
+
"withdrawal.settings.error.patronymicName.alphanumeric": "alphanumeric",
|
|
900
|
+
// VO code
|
|
901
|
+
"withdrawal.settings.error.voCode": "empty",
|
|
902
|
+
"withdrawal.settings.error.voCode.alphanumeric": "alphanumeric",
|
|
903
|
+
// Agency code
|
|
904
|
+
"withdrawal.settings.error.agencyCode": "empty",
|
|
905
|
+
"withdrawal.settings.error.agencyCode.alphanumeric": "alphanumeric",
|
|
906
|
+
"withdrawal.settings.error.agencyCode.length": "tooShort",
|
|
907
|
+
// Bank address fields
|
|
908
|
+
"withdrawal.settings.error.bankAddress": "empty",
|
|
909
|
+
"withdrawal.settings.error.bankCity": "empty",
|
|
910
|
+
"withdrawal.settings.error.bankProvinceState": "empty",
|
|
911
|
+
"withdrawal.settings.error.bankPostalCode": "empty",
|
|
912
|
+
// Branch code / name
|
|
913
|
+
"withdrawal.settings.error.branchCode": "invalid",
|
|
914
|
+
"withdrawal.settings.error.branchName": "empty",
|
|
915
|
+
// Classification code
|
|
916
|
+
"withdrawal.settings.error.classificationCode.invalid": "empty",
|
|
917
|
+
"withdrawal.settings.error.classificationCode.invalid.kzt": "invalidKzt",
|
|
918
|
+
// PayPal
|
|
919
|
+
"payment.error.email": "empty",
|
|
920
|
+
"payment.error.paypal_not_supported": "unsupportedCurrency",
|
|
921
|
+
"payment.error.email.invalid": "invalidEmail",
|
|
922
|
+
"payment.error.paypal_verification_incomplete": "verificationIncomplete",
|
|
923
|
+
// Payment schedule
|
|
924
|
+
"payment.error.no_threshold": "empty",
|
|
925
|
+
"payment.error.invalid_threshold": "invalid",
|
|
926
|
+
"payment.error.no_dayOfMonth": "empty",
|
|
927
|
+
"payment.error.invalid_dayOfMonth": "invalid",
|
|
928
|
+
};
|
|
802
929
|
function getFormInputs({ bitset, formMap }) {
|
|
803
930
|
// Convert bitset to binary representation
|
|
804
931
|
const binary = bitset.toString(2).padStart(Object.keys(formMap).length, "0");
|
|
@@ -822,6 +949,7 @@ const SAVE_WITHDRAWAL_SETTINGS = dist.gql `
|
|
|
822
949
|
validationErrors {
|
|
823
950
|
field
|
|
824
951
|
message
|
|
952
|
+
code
|
|
825
953
|
}
|
|
826
954
|
}
|
|
827
955
|
}
|
|
@@ -837,6 +965,7 @@ const UPDATE_WITHDRAWAL_SETTINGS = dist.gql `
|
|
|
837
965
|
validationErrors {
|
|
838
966
|
field
|
|
839
967
|
message
|
|
968
|
+
code
|
|
840
969
|
}
|
|
841
970
|
}
|
|
842
971
|
}
|
|
@@ -1009,10 +1138,13 @@ function useBankingInfoForm(props) {
|
|
|
1009
1138
|
else if (!success) {
|
|
1010
1139
|
console.error("Validation failed: ", validationErrors);
|
|
1011
1140
|
const mappedValidationErrors = validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.reduce((agg, error) => {
|
|
1141
|
+
const formField = API_FIELD_TO_FORM_FIELD[error.field] || error.field;
|
|
1142
|
+
const errorCode = API_ERROR_PATH_TO_FRONTEND[error.errorPath] || error.errorPath;
|
|
1012
1143
|
return {
|
|
1013
1144
|
...agg,
|
|
1014
|
-
[
|
|
1145
|
+
[formField]: {
|
|
1015
1146
|
type: "invalid",
|
|
1147
|
+
errorCode,
|
|
1016
1148
|
},
|
|
1017
1149
|
};
|
|
1018
1150
|
}, {});
|
|
@@ -1427,6 +1559,156 @@ const BankingInfoForm = class {
|
|
|
1427
1559
|
* @uiName Information modal button text
|
|
1428
1560
|
*/
|
|
1429
1561
|
this.modalButtonText = "I understand, update my information";
|
|
1562
|
+
// ──────────────────────────────────────────────────────────────────
|
|
1563
|
+
// Per-field validation error messages
|
|
1564
|
+
// Each prop uses ICU select on {errorCode} to pick the right message.
|
|
1565
|
+
// Error codes are short frontend keys mapped from the API error codes.
|
|
1566
|
+
// The `other` branch displays the raw API message directly via {errorCode},
|
|
1567
|
+
// which is already human-readable English (e.g. "Invalid Routing Code").
|
|
1568
|
+
// ──────────────────────────────────────────────────────────────────
|
|
1569
|
+
/**
|
|
1570
|
+
* Error messages for the beneficiary / account holder name field.
|
|
1571
|
+
* Supports error codes: empty, invalidCharacters, numeric, tooLong,
|
|
1572
|
+
* nonEnglish, businessNameMismatch, nameMismatch, businessPayeeMismatch, payeeMismatch
|
|
1573
|
+
* @uiName Beneficiary account name error
|
|
1574
|
+
* @uiWidget textArea
|
|
1575
|
+
*/
|
|
1576
|
+
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}}}";
|
|
1577
|
+
/**
|
|
1578
|
+
* Error messages for the bank account number / IBAN field.
|
|
1579
|
+
* Supports error codes: empty, invalidUk, invalid, ibanEmpty,
|
|
1580
|
+
* ibanAlphanumeric, ibanInvalid, ibanCountryMismatch
|
|
1581
|
+
* @uiName Bank account number / IBAN error
|
|
1582
|
+
* @uiWidget textArea
|
|
1583
|
+
*/
|
|
1584
|
+
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}}}";
|
|
1585
|
+
/**
|
|
1586
|
+
* Error messages for the routing code / sort code / BSB field.
|
|
1587
|
+
* Supports error codes: invalidBsb, invalidSortCode, empty, invalid
|
|
1588
|
+
* @uiName Routing code error
|
|
1589
|
+
* @uiWidget textArea
|
|
1590
|
+
*/
|
|
1591
|
+
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}}}";
|
|
1592
|
+
/**
|
|
1593
|
+
* Error messages for the SWIFT / BIC code field.
|
|
1594
|
+
* Supports error codes: empty, alphanumeric, invalid
|
|
1595
|
+
* @uiName SWIFT code error
|
|
1596
|
+
* @uiWidget textArea
|
|
1597
|
+
*/
|
|
1598
|
+
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}}}";
|
|
1599
|
+
/**
|
|
1600
|
+
* Error messages for the bank account type field.
|
|
1601
|
+
* Supports error codes: empty
|
|
1602
|
+
* @uiName Bank account type error
|
|
1603
|
+
* @uiWidget textArea
|
|
1604
|
+
*/
|
|
1605
|
+
this.bankAccountTypeError = "{errorCode, select, empty {Bank account type is required} other {{errorCode}}}";
|
|
1606
|
+
/**
|
|
1607
|
+
* Error messages for the bank name field.
|
|
1608
|
+
* Supports error codes: empty
|
|
1609
|
+
* @uiName Bank name error
|
|
1610
|
+
* @uiWidget textArea
|
|
1611
|
+
*/
|
|
1612
|
+
this.bankNameError = "{errorCode, select, empty {Bank name is required} other {{errorCode}}}";
|
|
1613
|
+
/**
|
|
1614
|
+
* Error messages for the tax payer ID / classification entity field.
|
|
1615
|
+
* Supports error codes: empty, emptyAr, emptyKr, alphanumeric, alphanumericAr,
|
|
1616
|
+
* alphanumericKr, invalid, invalidAr, invalidKr, invalidKzt, cnpjTooShort, cpfTooShort
|
|
1617
|
+
* @uiName Tax payer ID error
|
|
1618
|
+
* @uiWidget textArea
|
|
1619
|
+
*/
|
|
1620
|
+
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}}}";
|
|
1621
|
+
/**
|
|
1622
|
+
* Error messages for the patronymic name field.
|
|
1623
|
+
* Supports error codes: empty, alphanumeric
|
|
1624
|
+
* @uiName Patronymic name error
|
|
1625
|
+
* @uiWidget textArea
|
|
1626
|
+
*/
|
|
1627
|
+
this.patronymicNameError = "{errorCode, select, empty {Patronymic name is required} alphanumeric {Patronymic name must contain only letters and numbers} other {{errorCode}}}";
|
|
1628
|
+
/**
|
|
1629
|
+
* Error messages for the VO code field.
|
|
1630
|
+
* Supports error codes: empty, alphanumeric
|
|
1631
|
+
* @uiName VO code error
|
|
1632
|
+
* @uiWidget textArea
|
|
1633
|
+
*/
|
|
1634
|
+
this.voCodeError = "{errorCode, select, empty {VO code is required} alphanumeric {VO code must contain only letters and numbers} other {{errorCode}}}";
|
|
1635
|
+
/**
|
|
1636
|
+
* Error messages for the agency code field.
|
|
1637
|
+
* Supports error codes: empty, alphanumeric, tooShort
|
|
1638
|
+
* @uiName Agency code error
|
|
1639
|
+
* @uiWidget textArea
|
|
1640
|
+
*/
|
|
1641
|
+
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}}}";
|
|
1642
|
+
/**
|
|
1643
|
+
* Error messages for the bank address field.
|
|
1644
|
+
* Supports error codes: empty
|
|
1645
|
+
* @uiName Bank address error
|
|
1646
|
+
* @uiWidget textArea
|
|
1647
|
+
*/
|
|
1648
|
+
this.bankAddressError = "{errorCode, select, empty {Bank address is required} other {{errorCode}}}";
|
|
1649
|
+
/**
|
|
1650
|
+
* Error messages for the bank city field.
|
|
1651
|
+
* Supports error codes: empty
|
|
1652
|
+
* @uiName Bank city error
|
|
1653
|
+
* @uiWidget textArea
|
|
1654
|
+
*/
|
|
1655
|
+
this.bankCityError = "{errorCode, select, empty {Bank city is required} other {{errorCode}}}";
|
|
1656
|
+
/**
|
|
1657
|
+
* Error messages for the bank province/state field.
|
|
1658
|
+
* Supports error codes: empty
|
|
1659
|
+
* @uiName Bank province/state error
|
|
1660
|
+
* @uiWidget textArea
|
|
1661
|
+
*/
|
|
1662
|
+
this.bankStateError = "{errorCode, select, empty {Bank province/state is required} other {{errorCode}}}";
|
|
1663
|
+
/**
|
|
1664
|
+
* Error messages for the bank postal code field.
|
|
1665
|
+
* Supports error codes: empty
|
|
1666
|
+
* @uiName Bank postal code error
|
|
1667
|
+
* @uiWidget textArea
|
|
1668
|
+
*/
|
|
1669
|
+
this.bankPostalCodeError = "{errorCode, select, empty {Bank postal code is required} other {{errorCode}}}";
|
|
1670
|
+
/**
|
|
1671
|
+
* Error messages for the branch code field.
|
|
1672
|
+
* Supports error codes: invalid
|
|
1673
|
+
* @uiName Branch code error
|
|
1674
|
+
* @uiWidget textArea
|
|
1675
|
+
*/
|
|
1676
|
+
this.branchCodeError = "{errorCode, select, invalid {Branch code is invalid} other {{errorCode}}}";
|
|
1677
|
+
/**
|
|
1678
|
+
* Error messages for the branch name field.
|
|
1679
|
+
* Supports error codes: empty
|
|
1680
|
+
* @uiName Branch name error
|
|
1681
|
+
* @uiWidget textArea
|
|
1682
|
+
*/
|
|
1683
|
+
this.branchNameError = "{errorCode, select, empty {Branch name is required} other {{errorCode}}}";
|
|
1684
|
+
/**
|
|
1685
|
+
* Error messages for the classification code field.
|
|
1686
|
+
* Supports error codes: empty, invalidKzt
|
|
1687
|
+
* @uiName Classification code error
|
|
1688
|
+
* @uiWidget textArea
|
|
1689
|
+
*/
|
|
1690
|
+
this.classificationCodeError = "{errorCode, select, empty {Classification code is required} invalidKzt {Classification code must be exactly 2 characters} other {{errorCode}}}";
|
|
1691
|
+
/**
|
|
1692
|
+
* Error messages for the PayPal email field.
|
|
1693
|
+
* Supports error codes: empty, unsupportedCurrency, invalidEmail, verificationIncomplete
|
|
1694
|
+
* @uiName PayPal email error
|
|
1695
|
+
* @uiWidget textArea
|
|
1696
|
+
*/
|
|
1697
|
+
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}}}";
|
|
1698
|
+
/**
|
|
1699
|
+
* Error messages for the payment threshold field.
|
|
1700
|
+
* Supports error codes: empty, invalid
|
|
1701
|
+
* @uiName Payment threshold error
|
|
1702
|
+
* @uiWidget textArea
|
|
1703
|
+
*/
|
|
1704
|
+
this.paymentThresholdError = "{errorCode, select, empty {Payment threshold is required} invalid {Payment threshold is invalid} other {{errorCode}}}";
|
|
1705
|
+
/**
|
|
1706
|
+
* Error messages for the payment day field.
|
|
1707
|
+
* Supports error codes: empty, invalid
|
|
1708
|
+
* @uiName Payment day error
|
|
1709
|
+
* @uiWidget textArea
|
|
1710
|
+
*/
|
|
1711
|
+
this.paymentDayError = "{errorCode, select, empty {Payment day is required} invalid {Payment day must be the 1st or the 15th} other {{errorCode}}}";
|
|
1430
1712
|
h$1(this);
|
|
1431
1713
|
}
|
|
1432
1714
|
disconnectedCallback() { }
|
|
@@ -1440,17 +1722,54 @@ const BankingInfoForm = class {
|
|
|
1440
1722
|
loadingErrorAlertDescription: props.loadingErrorAlertDescription,
|
|
1441
1723
|
loadingErrorAlertHeader: props.loadingErrorAlertHeader,
|
|
1442
1724
|
},
|
|
1725
|
+
errorMessages: {
|
|
1726
|
+
beneficiaryAccountName: props.beneficiaryAccountNameError,
|
|
1727
|
+
bankAccountNumber: props.bankAccountNumberError,
|
|
1728
|
+
routingCode: props.routingCodeError,
|
|
1729
|
+
swiftCode: props.swiftCodeError,
|
|
1730
|
+
bankAccountType: props.bankAccountTypeError,
|
|
1731
|
+
bankName: props.bankNameError,
|
|
1732
|
+
taxPayerId: props.taxPayerIdError,
|
|
1733
|
+
patronymicName: props.patronymicNameError,
|
|
1734
|
+
voCode: props.voCodeError,
|
|
1735
|
+
agencyCode: props.agencyCodeError,
|
|
1736
|
+
bankAddress: props.bankAddressError,
|
|
1737
|
+
bankCity: props.bankCityError,
|
|
1738
|
+
bankState: props.bankStateError,
|
|
1739
|
+
bankPostalCode: props.bankPostalCodeError,
|
|
1740
|
+
branchCode: props.branchCodeError,
|
|
1741
|
+
branchName: props.branchNameError,
|
|
1742
|
+
beneficiaryClassification: props.classificationCodeError,
|
|
1743
|
+
paypalEmailAddress: props.paypalEmailError,
|
|
1744
|
+
paymentThreshold: props.paymentThresholdError,
|
|
1745
|
+
paymentDay: props.paymentDayError,
|
|
1746
|
+
},
|
|
1443
1747
|
};
|
|
1444
1748
|
}
|
|
1445
1749
|
render() {
|
|
1446
|
-
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;
|
|
1750
|
+
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;
|
|
1447
1751
|
const props = isDemo()
|
|
1448
1752
|
? useDemoBankingInfoForm(this)
|
|
1449
1753
|
: useBankingInfoForm(this);
|
|
1450
1754
|
const { errors } = props.states.formState;
|
|
1451
1755
|
const fieldRequiredError = this.fieldRequiredError;
|
|
1452
1756
|
const fieldInvalidError = this.fieldInvalidError;
|
|
1453
|
-
function getValidationErrorMessage({ type, label, }) {
|
|
1757
|
+
function getValidationErrorMessage({ type, label, errorCode, fieldName, }) {
|
|
1758
|
+
var _a;
|
|
1759
|
+
// If we have a specific error code from the API, try to use
|
|
1760
|
+
// the per-field ICU error message template for a rich message
|
|
1761
|
+
if (type === "invalid" && errorCode && fieldName) {
|
|
1762
|
+
const errorTemplate = (_a = props.text.errorMessages) === null || _a === void 0 ? void 0 : _a[fieldName];
|
|
1763
|
+
if (errorTemplate) {
|
|
1764
|
+
return intl.formatMessage({
|
|
1765
|
+
id: `fieldError-${fieldName}-${errorCode}`,
|
|
1766
|
+
defaultMessage: errorTemplate,
|
|
1767
|
+
}, {
|
|
1768
|
+
errorCode,
|
|
1769
|
+
fieldName: label,
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1454
1773
|
if (type === "required") {
|
|
1455
1774
|
return intl.formatMessage({
|
|
1456
1775
|
id: `requiredText-${label}`,
|
|
@@ -1533,37 +1852,45 @@ const BankingInfoForm = class {
|
|
|
1533
1852
|
helpText: getValidationErrorMessage({
|
|
1534
1853
|
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,
|
|
1535
1854
|
label: props.text.bankLocationLabel,
|
|
1855
|
+
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,
|
|
1856
|
+
fieldName: "bankCountry",
|
|
1536
1857
|
}),
|
|
1537
1858
|
})), h("sl-input", { disabled: props.states.saveLoading, class: sheet.classes.SearchInput, placeholder: this.searchForCountryText, onKeyDown: (e) => {
|
|
1538
1859
|
// Stop shoelace intercepting key presses
|
|
1539
1860
|
e.stopPropagation();
|
|
1540
1861
|
}, "onSl-input": (e) => {
|
|
1541
1862
|
props.callbacks.setCountrySearch(e.target.value);
|
|
1542
|
-
} }), (
|
|
1543
|
-
|
|
1863
|
+
} }), (_f = props.states.countries) === null || _f === void 0 ? void 0 :
|
|
1864
|
+
_f.map((country) => {
|
|
1544
1865
|
return (h("sl-menu-item", { value: country.countryCode }, country.displayName));
|
|
1545
|
-
}), (
|
|
1546
|
-
|
|
1866
|
+
}), (_h = (_g = props.states) === null || _g === void 0 ? void 0 : _g.allCountries) === null || _h === void 0 ? void 0 :
|
|
1867
|
+
_h.map((c) => (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName))))),
|
|
1547
1868
|
paymentMethodSlot: (h("sl-input", { key: "paymentMethod", label: props.text.paymentMethod, placeholder: props.states.paymentMethodFeeLabel, disabled: true })),
|
|
1548
|
-
paymentThresholdSelectSlot: (h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentThresholdSelectLabel, name: "/paymentThreshold", id: "paymentThreshold", value: ((
|
|
1869
|
+
paymentThresholdSelectSlot: (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) && {
|
|
1549
1870
|
class: "error-input",
|
|
1550
1871
|
helpText: getValidationErrorMessage({
|
|
1551
|
-
type: (
|
|
1872
|
+
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,
|
|
1552
1873
|
label: props.text.paymentThresholdSelectLabel,
|
|
1874
|
+
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,
|
|
1875
|
+
fieldName: "paymentThreshold",
|
|
1553
1876
|
}),
|
|
1554
1877
|
})), props.states.thresholds.map((t) => (h("sl-menu-item", { value: t }, `${props.states.currency}${t}`))))),
|
|
1555
|
-
paymentFixedDaySelectSlot: (h("sl-select", Object.assign({ required: true, disabled: props.states.saveLoading, label: props.text.paymentDaySelectLabel, value: ((
|
|
1878
|
+
paymentFixedDaySelectSlot: (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) && {
|
|
1556
1879
|
class: "error-input",
|
|
1557
1880
|
helpText: getValidationErrorMessage({
|
|
1558
|
-
type: (
|
|
1881
|
+
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,
|
|
1559
1882
|
label: props.text.paymentDaySelectLabel,
|
|
1883
|
+
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,
|
|
1884
|
+
fieldName: "paymentDay",
|
|
1560
1885
|
}),
|
|
1561
1886
|
})), h("sl-menu-item", { value: "1" }, props.text.paymentDayFirstOfMonthLabelText), h("sl-menu-item", { value: "15" }, props.text.paymentDayFifteenthOfMonthLabelText))),
|
|
1562
|
-
paypalInputSlot: (h("sl-input", Object.assign({ required: true, disabled: props.states.saveLoading, value: ((
|
|
1887
|
+
paypalInputSlot: (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) && {
|
|
1563
1888
|
class: "error-input",
|
|
1564
1889
|
helpText: getValidationErrorMessage({
|
|
1565
|
-
type: (
|
|
1890
|
+
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,
|
|
1566
1891
|
label: props.text.payPalInputLabel,
|
|
1892
|
+
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,
|
|
1893
|
+
fieldName: "paypalEmailAddress",
|
|
1567
1894
|
}),
|
|
1568
1895
|
})))),
|
|
1569
1896
|
} })));
|