@adyen/kyc-components 2.61.0 → 2.61.2
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.
|
@@ -44,7 +44,6 @@ class UserEvents {
|
|
|
44
44
|
addEvent(eventName, properties) {
|
|
45
45
|
const completeEvent = { ...this.baseTrackingPayload, ...properties };
|
|
46
46
|
this.add({ type: "add_event", name: eventName, properties: { ...completeEvent } });
|
|
47
|
-
console.log("addevent", "name", eventName, completeEvent);
|
|
48
47
|
this.notifySubscribers();
|
|
49
48
|
}
|
|
50
49
|
/**
|
|
@@ -3748,11 +3747,11 @@ const Field = ({
|
|
|
3748
3747
|
const returnValue = typeof errorMessage === "string" && errorMessage || "invalid";
|
|
3749
3748
|
userEvents.addFieldEvent("Encountered error", {
|
|
3750
3749
|
actionType: "input",
|
|
3751
|
-
field:
|
|
3750
|
+
field: name,
|
|
3752
3751
|
returnType: "validation",
|
|
3753
3752
|
returnValue
|
|
3754
3753
|
});
|
|
3755
|
-
}, [
|
|
3754
|
+
}, [name, errorMessage]);
|
|
3756
3755
|
return /* @__PURE__ */ jsx(
|
|
3757
3756
|
"div",
|
|
3758
3757
|
{
|
|
@@ -4036,12 +4035,11 @@ function Checkbox({
|
|
|
4036
4035
|
enableTracking = false,
|
|
4037
4036
|
...props
|
|
4038
4037
|
}) {
|
|
4039
|
-
const field = typeof label === "string" ? label : props.name;
|
|
4040
4038
|
const handleChange = (newValue) => {
|
|
4041
4039
|
if (enableTracking) {
|
|
4042
4040
|
userEvents.addFieldEvent("Interacted with form field", {
|
|
4043
4041
|
actionType: "input",
|
|
4044
|
-
field,
|
|
4042
|
+
field: props.name,
|
|
4045
4043
|
returnValue: String(newValue)
|
|
4046
4044
|
});
|
|
4047
4045
|
}
|
|
@@ -11012,7 +11010,7 @@ const isExistingFile = (file) => "existing" in file && file.existing;
|
|
|
11012
11010
|
const isNewlyUploadedFile = (file) => !isExistingFile(file);
|
|
11013
11011
|
function DropzoneFile(props) {
|
|
11014
11012
|
var _a;
|
|
11015
|
-
const {
|
|
11013
|
+
const { file, errorMessage, onDelete } = props;
|
|
11016
11014
|
const { i18n } = useI18nContext();
|
|
11017
11015
|
let documentIcon;
|
|
11018
11016
|
const formatSize = (bytes) => {
|
|
@@ -11033,11 +11031,11 @@ function DropzoneFile(props) {
|
|
|
11033
11031
|
if (!errorMessage) return;
|
|
11034
11032
|
userEvents.addFieldEvent("Encountered error", {
|
|
11035
11033
|
actionType: "change",
|
|
11036
|
-
field:
|
|
11034
|
+
field: "dropzone file",
|
|
11037
11035
|
returnType: "validation",
|
|
11038
11036
|
returnValue: errorMessage
|
|
11039
11037
|
});
|
|
11040
|
-
}, [
|
|
11038
|
+
}, [errorMessage]);
|
|
11041
11039
|
return /* @__PURE__ */ jsxs(
|
|
11042
11040
|
"div",
|
|
11043
11041
|
{
|
|
@@ -11229,7 +11227,7 @@ function Dropzone(props) {
|
|
|
11229
11227
|
if (enableTracking) {
|
|
11230
11228
|
userEvents.addFieldEvent("Interacted with form field", {
|
|
11231
11229
|
actionType: "change",
|
|
11232
|
-
field:
|
|
11230
|
+
field: name || "file picker"
|
|
11233
11231
|
});
|
|
11234
11232
|
}
|
|
11235
11233
|
const currentFiles = (data == null ? void 0 : data[name]) || [];
|
|
@@ -11267,7 +11265,6 @@ function Dropzone(props) {
|
|
|
11267
11265
|
return /* @__PURE__ */ jsx(
|
|
11268
11266
|
DropzoneFile,
|
|
11269
11267
|
{
|
|
11270
|
-
label,
|
|
11271
11268
|
file,
|
|
11272
11269
|
onDelete: () => handleFileDelete(file),
|
|
11273
11270
|
errorMessage: (_a2 = errors == null ? void 0 : errors[name]) == null ? void 0 : _a2.errorMessage
|
|
@@ -19139,6 +19136,7 @@ function FilePicker({
|
|
|
19139
19136
|
errorMessage,
|
|
19140
19137
|
multiple = false,
|
|
19141
19138
|
label,
|
|
19139
|
+
name,
|
|
19142
19140
|
iconPrefix = "generic-document",
|
|
19143
19141
|
enableTracking = false,
|
|
19144
19142
|
// file validation options
|
|
@@ -19185,7 +19183,7 @@ function FilePicker({
|
|
|
19185
19183
|
if (enableTracking) {
|
|
19186
19184
|
userEvents.addFieldEvent("Interacted with form field", {
|
|
19187
19185
|
actionType: "change",
|
|
19188
|
-
field:
|
|
19186
|
+
field: name || "dropzone"
|
|
19189
19187
|
});
|
|
19190
19188
|
}
|
|
19191
19189
|
setFiles([...newFiles, ...files]);
|
|
@@ -19204,7 +19202,6 @@ function FilePicker({
|
|
|
19204
19202
|
files.map((file) => /* @__PURE__ */ jsx(
|
|
19205
19203
|
DropzoneFile,
|
|
19206
19204
|
{
|
|
19207
|
-
label,
|
|
19208
19205
|
file,
|
|
19209
19206
|
onDelete: () => handleFileDelete(file),
|
|
19210
19207
|
errorMessage,
|
|
@@ -19574,6 +19571,7 @@ function BankDocument(props) {
|
|
|
19574
19571
|
FilePicker,
|
|
19575
19572
|
{
|
|
19576
19573
|
...childProps,
|
|
19574
|
+
name: "bankStatementDocument",
|
|
19577
19575
|
files: data.bankStatementDocument ?? [],
|
|
19578
19576
|
setFiles: handleChangeFor("bankStatementDocument"),
|
|
19579
19577
|
isValid: valid.bankStatementDocument ?? isBankStatementOptional,
|
|
@@ -24133,7 +24131,7 @@ const useFormComposer = ({
|
|
|
24133
24131
|
...baseTrackingPayload,
|
|
24134
24132
|
actionLevel: "page",
|
|
24135
24133
|
actionType: "next",
|
|
24136
|
-
page:
|
|
24134
|
+
page: formName
|
|
24137
24135
|
});
|
|
24138
24136
|
};
|
|
24139
24137
|
const gotoFormByFormIndex = (nextFormIndex) => {
|
|
@@ -30788,7 +30786,9 @@ const DecisionMakersComponent = ({
|
|
|
30788
30786
|
const decisionMakers = getOwnDecisionMakers(legalEntityResponse);
|
|
30789
30787
|
const registeredCountry = (_b = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.registeredAddress) == null ? void 0 : _b.country;
|
|
30790
30788
|
const availableDecisionMakers = getAvailableDecisionMakerRoleTypes(registeredCountry);
|
|
30791
|
-
const
|
|
30789
|
+
const translationKeys = {
|
|
30790
|
+
home: "saveAndGoToOverview"
|
|
30791
|
+
};
|
|
30792
30792
|
const { remediationMessages } = useDataMissingRemediations({
|
|
30793
30793
|
legalEntityId: legalEntityResponse.id,
|
|
30794
30794
|
problems: capabilityProblems
|
|
@@ -30817,10 +30817,10 @@ const DecisionMakersComponent = ({
|
|
|
30817
30817
|
task: TaskTypes.DECISION_MAKER_OVERVIEW,
|
|
30818
30818
|
actionLevel: "task",
|
|
30819
30819
|
actionType: "alert",
|
|
30820
|
-
label:
|
|
30820
|
+
label: "missingDecisionMaker"
|
|
30821
30821
|
});
|
|
30822
30822
|
}
|
|
30823
|
-
}, [showWarning]);
|
|
30823
|
+
}, [remediationMessages.DECISION_MAKER, showWarning]);
|
|
30824
30824
|
const uniqueDecisionMakersPerType = (roleType) => uniqueDecisionMakers.filter(({ types }) => types.includes(roleType)).length;
|
|
30825
30825
|
const allowedDecisionMakerTypes = getAllowedDecisionMakerRoles(
|
|
30826
30826
|
legalEntityResponse,
|
|
@@ -30957,12 +30957,12 @@ const DecisionMakersComponent = ({
|
|
|
30957
30957
|
task: TaskTypes.DECISION_MAKER_OVERVIEW,
|
|
30958
30958
|
actionLevel: "task",
|
|
30959
30959
|
actionType: "back",
|
|
30960
|
-
label:
|
|
30960
|
+
label: translationKeys.home,
|
|
30961
30961
|
noOfDecisionMakers: decisionMakers.length
|
|
30962
30962
|
});
|
|
30963
30963
|
navigateBackToTaskList();
|
|
30964
30964
|
},
|
|
30965
|
-
homeButtonLabel
|
|
30965
|
+
homeButtonLabel: i18n.get(translationKeys.home)
|
|
30966
30966
|
}
|
|
30967
30967
|
)
|
|
30968
30968
|
] })
|
|
@@ -31147,11 +31147,11 @@ const Introduction = ({
|
|
|
31147
31147
|
onExitIntroduction();
|
|
31148
31148
|
}
|
|
31149
31149
|
}, [introductionScreens]);
|
|
31150
|
-
const
|
|
31151
|
-
skip:
|
|
31152
|
-
back:
|
|
31153
|
-
next:
|
|
31154
|
-
start:
|
|
31150
|
+
const translationKeys = {
|
|
31151
|
+
skip: "goToOverviewFromIntroduction",
|
|
31152
|
+
back: "back",
|
|
31153
|
+
next: "next",
|
|
31154
|
+
start: "start"
|
|
31155
31155
|
};
|
|
31156
31156
|
return (introductionScreens == null ? void 0 : introductionScreens.length) ? /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-introduction", children: [
|
|
31157
31157
|
/* @__PURE__ */ jsx(
|
|
@@ -31164,12 +31164,12 @@ const Introduction = ({
|
|
|
31164
31164
|
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-introduction__skip", children: /* @__PURE__ */ jsx(
|
|
31165
31165
|
Button,
|
|
31166
31166
|
{
|
|
31167
|
-
label:
|
|
31167
|
+
label: i18n.get(translationKeys.skip),
|
|
31168
31168
|
onClick: () => {
|
|
31169
31169
|
userEvents.addEvent("Clicked button", {
|
|
31170
31170
|
...pageEventDetails,
|
|
31171
31171
|
actionType: "skip",
|
|
31172
|
-
label:
|
|
31172
|
+
label: translationKeys.skip
|
|
31173
31173
|
});
|
|
31174
31174
|
onExitIntroduction();
|
|
31175
31175
|
},
|
|
@@ -31191,12 +31191,12 @@ const Introduction = ({
|
|
|
31191
31191
|
Button,
|
|
31192
31192
|
{
|
|
31193
31193
|
disabled: activeIndex === 0,
|
|
31194
|
-
label:
|
|
31194
|
+
label: i18n.get(translationKeys.back),
|
|
31195
31195
|
onClick: () => {
|
|
31196
31196
|
userEvents.addEvent("Clicked button", {
|
|
31197
31197
|
...pageEventDetails,
|
|
31198
31198
|
actionType: "back",
|
|
31199
|
-
label:
|
|
31199
|
+
label: translationKeys.back
|
|
31200
31200
|
});
|
|
31201
31201
|
setActiveIndex((currentValue) => currentValue - 1);
|
|
31202
31202
|
},
|
|
@@ -31207,12 +31207,12 @@ const Introduction = ({
|
|
|
31207
31207
|
activeIndex + 1 === introductionScreens.length ? /* @__PURE__ */ jsx(
|
|
31208
31208
|
Button,
|
|
31209
31209
|
{
|
|
31210
|
-
label:
|
|
31210
|
+
label: i18n.get(translationKeys.start),
|
|
31211
31211
|
onClick: () => {
|
|
31212
31212
|
userEvents.addEvent("Success", {
|
|
31213
31213
|
actionLevel: "task",
|
|
31214
31214
|
actionType: "start",
|
|
31215
|
-
label:
|
|
31215
|
+
label: translationKeys.start
|
|
31216
31216
|
});
|
|
31217
31217
|
onExitIntroduction();
|
|
31218
31218
|
},
|
|
@@ -31221,12 +31221,12 @@ const Introduction = ({
|
|
|
31221
31221
|
) : /* @__PURE__ */ jsx(
|
|
31222
31222
|
Button,
|
|
31223
31223
|
{
|
|
31224
|
-
label:
|
|
31224
|
+
label: i18n.get(translationKeys.next),
|
|
31225
31225
|
onClick: () => {
|
|
31226
31226
|
userEvents.addEvent("Clicked button", {
|
|
31227
31227
|
...pageEventDetails,
|
|
31228
31228
|
actionType: "next",
|
|
31229
|
-
label:
|
|
31229
|
+
label: translationKeys.next
|
|
31230
31230
|
});
|
|
31231
31231
|
setActiveIndex((currentValue) => currentValue + 1);
|
|
31232
31232
|
},
|
|
@@ -31850,7 +31850,7 @@ function TaskListComponent({
|
|
|
31850
31850
|
task: TaskTypes.TASKS_OVERVIEW,
|
|
31851
31851
|
actionLevel: "task",
|
|
31852
31852
|
actionType: "alert",
|
|
31853
|
-
label:
|
|
31853
|
+
label: "missingDecisionMaker"
|
|
31854
31854
|
});
|
|
31855
31855
|
}
|
|
31856
31856
|
}, [showDecisionMakersWarning]);
|
|
@@ -32780,7 +32780,7 @@ function IndividualDropinComponent({
|
|
|
32780
32780
|
legalEntityId: updatedLegalEntity.id,
|
|
32781
32781
|
entityType: updatedLegalEntity.type,
|
|
32782
32782
|
countryOfRegistration: ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.residencyCountry) || null,
|
|
32783
|
-
|
|
32783
|
+
documentType: idDocumentType || null
|
|
32784
32784
|
});
|
|
32785
32785
|
}
|
|
32786
32786
|
return updatedLegalEntity;
|
|
@@ -32892,7 +32892,7 @@ function IndividualDropinComponent({
|
|
|
32892
32892
|
actionLevel: "task",
|
|
32893
32893
|
actionType: "submit",
|
|
32894
32894
|
countryOfRegistration: ((_b2 = dataSubmitted == null ? void 0 : dataSubmitted.personalDetails) == null ? void 0 : _b2.residencyCountry) || null,
|
|
32895
|
-
|
|
32895
|
+
documentType: idDocumentType || null
|
|
32896
32896
|
});
|
|
32897
32897
|
legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
|
|
32898
32898
|
taskType,
|
|
@@ -33729,8 +33729,10 @@ function PciDropinComponent({
|
|
|
33729
33729
|
const { showToast } = useToastContext();
|
|
33730
33730
|
const [loadingStatus, setLoadingStatus] = useState();
|
|
33731
33731
|
const hasExpired = useHasExpired();
|
|
33732
|
-
const
|
|
33733
|
-
|
|
33732
|
+
const translationKeys = {
|
|
33733
|
+
sign: "sign",
|
|
33734
|
+
home: "goToOverview"
|
|
33735
|
+
};
|
|
33734
33736
|
const { handleChangeFor, triggerValidation, data, valid, isValid, errors } = useForm({
|
|
33735
33737
|
schema: PciFields,
|
|
33736
33738
|
rules: pciValidationRules
|
|
@@ -33760,7 +33762,7 @@ function PciDropinComponent({
|
|
|
33760
33762
|
const baseTracking = {
|
|
33761
33763
|
actionLevel: "task",
|
|
33762
33764
|
actionType: "sign",
|
|
33763
|
-
label:
|
|
33765
|
+
label: translationKeys.sign
|
|
33764
33766
|
};
|
|
33765
33767
|
userEvents.addEvent("Clicked button", baseTracking);
|
|
33766
33768
|
triggerValidation();
|
|
@@ -33793,7 +33795,7 @@ function PciDropinComponent({
|
|
|
33793
33795
|
userEvents.addEvent("Clicked button", {
|
|
33794
33796
|
actionLevel: "task",
|
|
33795
33797
|
actionType: "back",
|
|
33796
|
-
label:
|
|
33798
|
+
label: translationKeys.home
|
|
33797
33799
|
});
|
|
33798
33800
|
handleHomeClick();
|
|
33799
33801
|
};
|
|
@@ -33867,9 +33869,9 @@ function PciDropinComponent({
|
|
|
33867
33869
|
ActionBar,
|
|
33868
33870
|
{
|
|
33869
33871
|
onHome: goHome,
|
|
33870
|
-
homeButtonLabel,
|
|
33872
|
+
homeButtonLabel: i18n.get(translationKeys.home),
|
|
33871
33873
|
onNext: handleSignClick,
|
|
33872
|
-
nextButtonLabel:
|
|
33874
|
+
nextButtonLabel: i18n.get(translationKeys.sign)
|
|
33873
33875
|
}
|
|
33874
33876
|
);
|
|
33875
33877
|
return /* @__PURE__ */ jsx(DropinLayout, { content, footer });
|
|
@@ -34740,8 +34742,10 @@ function ServiceAgreementDropinComponent({
|
|
|
34740
34742
|
const [activeForm, setActiveForm] = useState(forms[activeFormIndex]);
|
|
34741
34743
|
const canSign = (serviceAgreementTypes == null ? void 0 : serviceAgreementTypes.includes(activeForm == null ? void 0 : activeForm.serviceAgreementType)) && !(activeForm == null ? void 0 : activeForm.acceptanceId);
|
|
34742
34744
|
const showSignedAlert = !!(activeForm == null ? void 0 : activeForm.acceptanceId);
|
|
34743
|
-
const
|
|
34744
|
-
|
|
34745
|
+
const translationKeys = {
|
|
34746
|
+
home: "goToOverview",
|
|
34747
|
+
next: canSign ? "sign" : "next"
|
|
34748
|
+
};
|
|
34745
34749
|
const handleServiceAgreementIsNotAvailableInThatLanguage = useCallback(() => {
|
|
34746
34750
|
showToast({
|
|
34747
34751
|
label: i18n.get("failedToGetServiceAgreementInSelectedLanguageFallbackToEn"),
|
|
@@ -34786,7 +34790,7 @@ function ServiceAgreementDropinComponent({
|
|
|
34786
34790
|
actionLevel: "task",
|
|
34787
34791
|
actionType: "sign"
|
|
34788
34792
|
};
|
|
34789
|
-
userEvents.addEvent("Clicked button", { ...baseTracking, label:
|
|
34793
|
+
userEvents.addEvent("Clicked button", { ...baseTracking, label: translationKeys.next });
|
|
34790
34794
|
triggerValidation();
|
|
34791
34795
|
if (loadingStatus === "loading" || !serviceAgreement || !data.signer) return;
|
|
34792
34796
|
if (isValid) {
|
|
@@ -34822,7 +34826,7 @@ function ServiceAgreementDropinComponent({
|
|
|
34822
34826
|
userEvents.addEvent("Clicked button", {
|
|
34823
34827
|
actionLevel: "task",
|
|
34824
34828
|
actionType: "back",
|
|
34825
|
-
label:
|
|
34829
|
+
label: translationKeys.home
|
|
34826
34830
|
});
|
|
34827
34831
|
handleHomeClick();
|
|
34828
34832
|
};
|
|
@@ -35029,9 +35033,9 @@ function ServiceAgreementDropinComponent({
|
|
|
35029
35033
|
ActionBar,
|
|
35030
35034
|
{
|
|
35031
35035
|
onHome: goHome,
|
|
35032
|
-
homeButtonLabel,
|
|
35036
|
+
homeButtonLabel: i18n.get(translationKeys.home),
|
|
35033
35037
|
onNext: canSign ? handleSignClick : () => gotoForm(activeFormIndex + 1),
|
|
35034
|
-
nextButtonLabel,
|
|
35038
|
+
nextButtonLabel: i18n.get(translationKeys.next),
|
|
35035
35039
|
nextButtonDisabled: forms.length === 0 || !canSign && activeFormIndex === forms.length - 1,
|
|
35036
35040
|
onBack: () => gotoForm(activeFormIndex - 1),
|
|
35037
35041
|
hideBackButton: activeFormIndex === 0,
|
|
@@ -39676,7 +39680,7 @@ const ConfigurationApiProvider = ({
|
|
|
39676
39680
|
}) => {
|
|
39677
39681
|
const authContext = useAuthContext();
|
|
39678
39682
|
const { isEmbeddedDropin, loadingContext } = authContext;
|
|
39679
|
-
const sdkVersion = "2.61.
|
|
39683
|
+
const sdkVersion = "2.61.2";
|
|
39680
39684
|
useAnalytics({
|
|
39681
39685
|
onUserEvent,
|
|
39682
39686
|
legalEntityId: rootLegalEntityId,
|
|
@@ -40349,7 +40353,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
40349
40353
|
};
|
|
40350
40354
|
const copyToClipboard = async () => {
|
|
40351
40355
|
const toCopy = {
|
|
40352
|
-
sdkVersion: "2.61.
|
|
40356
|
+
sdkVersion: "2.61.2",
|
|
40353
40357
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
40354
40358
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
40355
40359
|
};
|
|
@@ -40414,7 +40418,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
40414
40418
|
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
|
|
40415
40419
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
40416
40420
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
|
|
40417
|
-
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.61.
|
|
40421
|
+
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.61.2" })
|
|
40418
40422
|
] }) }),
|
|
40419
40423
|
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
40420
40424
|
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
|
|
@@ -10,7 +10,8 @@ export interface FilePickerProps extends FileValidationOptions {
|
|
|
10
10
|
errorMessage?: TranslationKey;
|
|
11
11
|
multiple?: boolean;
|
|
12
12
|
label?: string;
|
|
13
|
+
name: string;
|
|
13
14
|
iconPrefix?: string;
|
|
14
15
|
enableTracking?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare function FilePicker({ files, setFiles, isValid, errorMessage, multiple, label, iconPrefix, enableTracking, allowedFileTypes, maxSize, isOptional, maxNumberOfFiles, }: FilePickerProps): JSX.Element;
|
|
17
|
+
export declare function FilePicker({ files, setFiles, isValid, errorMessage, multiple, label, name, iconPrefix, enableTracking, allowedFileTypes, maxSize, isOptional, maxNumberOfFiles, }: FilePickerProps): JSX.Element;
|