@adyen/kyc-components 2.47.0 → 2.47.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.
- package/dist/es/adyen-kyc-components.es.js +267 -383
- package/dist/types/components/CompanyRegistrationDetails/types.d.ts +2 -2
- package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +9 -0
- package/dist/types/components/internal/Modal/Modal.d.ts +1 -2
- package/dist/types/components/internal/{VatNumber → VatNumberField}/fieldConfig.d.ts +4 -3
- package/dist/types/utils/mapping/componentApiMapping.d.ts +1 -2
- package/package.json +1 -1
- package/dist/types/components/internal/VatNumber/VatNumber.d.ts +0 -3
- package/dist/types/components/internal/VatNumber/index.d.ts +0 -1
- package/dist/types/components/internal/VatNumber/types.d.ts +0 -12
|
@@ -6489,17 +6489,27 @@ const taxIdNumberOptions = {
|
|
|
6489
6489
|
name: "socialSecurityNumber",
|
|
6490
6490
|
applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
|
|
6491
6491
|
}],
|
|
6492
|
+
[CountryCodes.PuertoRico]: [{
|
|
6493
|
+
id: "EIN",
|
|
6494
|
+
name: "ein"
|
|
6495
|
+
}, {
|
|
6496
|
+
id: "SSN",
|
|
6497
|
+
name: "ssn",
|
|
6498
|
+
applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
|
|
6499
|
+
}],
|
|
6492
6500
|
[CountryCodes.UnitedStates]: [{
|
|
6493
6501
|
id: "EIN",
|
|
6494
6502
|
name: "ein"
|
|
6495
6503
|
}, {
|
|
6496
6504
|
id: "SSN",
|
|
6497
|
-
name: "ssn"
|
|
6505
|
+
name: "ssn",
|
|
6506
|
+
applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
|
|
6498
6507
|
}]
|
|
6499
6508
|
};
|
|
6500
6509
|
const getTaxIdNumberOptions = (country2, companyType2) => {
|
|
6501
6510
|
const optionsForCountry = taxIdNumberOptions[country2];
|
|
6502
6511
|
if (!companyType2 || !optionsForCountry) return optionsForCountry;
|
|
6512
|
+
if (country2 === "US" || country2 === "PR") return optionsForCountry.filter((option) => option.id === "EIN");
|
|
6503
6513
|
return optionsForCountry.filter((option) => {
|
|
6504
6514
|
var _a;
|
|
6505
6515
|
return ((_a = option.applicableOnlyFor) == null ? void 0 : _a.includes(companyType2)) ?? true;
|
|
@@ -8749,159 +8759,6 @@ function InputDate(props) {
|
|
|
8749
8759
|
maxLength: 10
|
|
8750
8760
|
});
|
|
8751
8761
|
}
|
|
8752
|
-
const STOCK_EXCHANGE_MIC_FIELD = ["stockExchangeMIC"];
|
|
8753
|
-
function StockExchangeMICField({
|
|
8754
|
-
data,
|
|
8755
|
-
valid,
|
|
8756
|
-
errors,
|
|
8757
|
-
labels: labels2,
|
|
8758
|
-
placeholders,
|
|
8759
|
-
readonly,
|
|
8760
|
-
mask,
|
|
8761
|
-
guidanceText,
|
|
8762
|
-
shouldValidate,
|
|
8763
|
-
handleChangeFor
|
|
8764
|
-
}) {
|
|
8765
|
-
return jsx(MaskedInputText, {
|
|
8766
|
-
name: "stockExchangeMIC",
|
|
8767
|
-
label: labels2.stockExchangeMIC ?? "",
|
|
8768
|
-
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockExchangeMIC,
|
|
8769
|
-
placeholder: placeholders == null ? void 0 : placeholders.stockExchangeMIC,
|
|
8770
|
-
...mask,
|
|
8771
|
-
classNameModifiers: {
|
|
8772
|
-
field: ["stockExchangeMIC"],
|
|
8773
|
-
input: ["stockExchangeMIC"]
|
|
8774
|
-
},
|
|
8775
|
-
errorMessage: errors.stockExchangeMIC,
|
|
8776
|
-
isValid: valid.stockExchangeMIC ?? false,
|
|
8777
|
-
value: data.stockExchangeMIC ?? "",
|
|
8778
|
-
readonly,
|
|
8779
|
-
shouldValidate,
|
|
8780
|
-
onInput: handleChangeFor("stockExchangeMIC", "input"),
|
|
8781
|
-
onBlur: handleChangeFor("stockExchangeMIC", "blur"),
|
|
8782
|
-
"aria-required": true,
|
|
8783
|
-
"aria-label": labels2.stockExchangeMIC,
|
|
8784
|
-
"aria-invalid": !valid.stockExchangeMIC
|
|
8785
|
-
});
|
|
8786
|
-
}
|
|
8787
|
-
const stockExchangeMICFieldMetadata = {
|
|
8788
|
-
label: "stockExchangeMIC",
|
|
8789
|
-
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
|
|
8790
|
-
mask: {
|
|
8791
|
-
mask: makeMask(...alphanumericInputs(4)),
|
|
8792
|
-
transformOnType: uppercase
|
|
8793
|
-
},
|
|
8794
|
-
guidanceText: {
|
|
8795
|
-
key: "enterNCharactersForExample",
|
|
8796
|
-
values: {
|
|
8797
|
-
numChars: "4",
|
|
8798
|
-
example: "XNAS"
|
|
8799
|
-
}
|
|
8800
|
-
}
|
|
8801
|
-
};
|
|
8802
|
-
const STOCK_ISIN_FIELD = ["stockISIN"];
|
|
8803
|
-
function StockISINField({
|
|
8804
|
-
data,
|
|
8805
|
-
valid,
|
|
8806
|
-
errors,
|
|
8807
|
-
labels: labels2,
|
|
8808
|
-
placeholders,
|
|
8809
|
-
readonly,
|
|
8810
|
-
mask,
|
|
8811
|
-
guidanceText,
|
|
8812
|
-
shouldValidate,
|
|
8813
|
-
handleChangeFor
|
|
8814
|
-
}) {
|
|
8815
|
-
return jsx(MaskedInputText, {
|
|
8816
|
-
name: "stockISIN",
|
|
8817
|
-
label: labels2.stockISIN ?? "",
|
|
8818
|
-
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockISIN,
|
|
8819
|
-
placeholder: placeholders == null ? void 0 : placeholders.stockISIN,
|
|
8820
|
-
...mask,
|
|
8821
|
-
classNameModifiers: {
|
|
8822
|
-
field: ["stockISIN"],
|
|
8823
|
-
input: ["stockISIN"]
|
|
8824
|
-
},
|
|
8825
|
-
errorMessage: errors.stockISIN,
|
|
8826
|
-
isValid: valid.stockISIN ?? false,
|
|
8827
|
-
value: data.stockISIN ?? "",
|
|
8828
|
-
readonly,
|
|
8829
|
-
shouldValidate,
|
|
8830
|
-
onInput: handleChangeFor("stockISIN", "input"),
|
|
8831
|
-
onBlur: handleChangeFor("stockISIN", "blur"),
|
|
8832
|
-
"aria-required": true,
|
|
8833
|
-
"aria-label": labels2.stockISIN,
|
|
8834
|
-
"aria-invalid": !valid.stockISIN
|
|
8835
|
-
});
|
|
8836
|
-
}
|
|
8837
|
-
const stockISINFieldMetadata = {
|
|
8838
|
-
label: "stockISIN",
|
|
8839
|
-
validators: [validateNotEmptyOnBlur, {
|
|
8840
|
-
modes: ["blur"],
|
|
8841
|
-
validate: (value) => !!value && isISIN(value)
|
|
8842
|
-
}],
|
|
8843
|
-
mask: {
|
|
8844
|
-
mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
|
|
8845
|
-
transformOnType: uppercase
|
|
8846
|
-
},
|
|
8847
|
-
helperText: "stockISINHelper",
|
|
8848
|
-
guidanceText: {
|
|
8849
|
-
key: "validationPleaseEnterAValidStockISIN",
|
|
8850
|
-
values: {
|
|
8851
|
-
example: "NL0012969182"
|
|
8852
|
-
}
|
|
8853
|
-
}
|
|
8854
|
-
};
|
|
8855
|
-
const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
|
|
8856
|
-
function StockTickerSymbolField({
|
|
8857
|
-
data,
|
|
8858
|
-
valid,
|
|
8859
|
-
errors,
|
|
8860
|
-
labels: labels2,
|
|
8861
|
-
placeholders,
|
|
8862
|
-
readonly,
|
|
8863
|
-
mask,
|
|
8864
|
-
guidanceText,
|
|
8865
|
-
shouldValidate,
|
|
8866
|
-
handleChangeFor
|
|
8867
|
-
}) {
|
|
8868
|
-
return jsx(MaskedInputText, {
|
|
8869
|
-
name: "stockTickerSymbol",
|
|
8870
|
-
label: labels2.stockTickerSymbol ?? "",
|
|
8871
|
-
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
|
|
8872
|
-
placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
|
|
8873
|
-
...mask,
|
|
8874
|
-
classNameModifiers: {
|
|
8875
|
-
field: ["stockTickerSymbol"],
|
|
8876
|
-
input: ["stockTickerSymbol"]
|
|
8877
|
-
},
|
|
8878
|
-
errorMessage: errors.stockTickerSymbol,
|
|
8879
|
-
isValid: valid.stockTickerSymbol ?? false,
|
|
8880
|
-
value: data.stockTickerSymbol ?? "",
|
|
8881
|
-
readonly,
|
|
8882
|
-
shouldValidate,
|
|
8883
|
-
onInput: handleChangeFor("stockTickerSymbol", "input"),
|
|
8884
|
-
onBlur: handleChangeFor("stockTickerSymbol", "blur"),
|
|
8885
|
-
"aria-required": true,
|
|
8886
|
-
"aria-label": labels2.stockTickerSymbol,
|
|
8887
|
-
"aria-invalid": !valid.stockTickerSymbol
|
|
8888
|
-
});
|
|
8889
|
-
}
|
|
8890
|
-
const stockTickerSymbolFieldMetadata = {
|
|
8891
|
-
label: "stockTickerSymbol",
|
|
8892
|
-
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
|
|
8893
|
-
mask: {
|
|
8894
|
-
mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
|
|
8895
|
-
transformOnType: uppercase
|
|
8896
|
-
},
|
|
8897
|
-
guidanceText: {
|
|
8898
|
-
key: "enterAMaximumOfNCharactersForExample",
|
|
8899
|
-
values: {
|
|
8900
|
-
maxChars: "5",
|
|
8901
|
-
example: "ADYEN"
|
|
8902
|
-
}
|
|
8903
|
-
}
|
|
8904
|
-
};
|
|
8905
8762
|
const defaultFieldMetadata$8 = {
|
|
8906
8763
|
label: "taxId"
|
|
8907
8764
|
};
|
|
@@ -9201,6 +9058,9 @@ const defaultFieldConfig$8 = {
|
|
|
9201
9058
|
validators: validatePatternOnBlur(/^\d{12}$/)
|
|
9202
9059
|
}
|
|
9203
9060
|
};
|
|
9061
|
+
const vatAbsenceReasonMetadata = {
|
|
9062
|
+
validators: [validateNotEmptyOnBlur]
|
|
9063
|
+
};
|
|
9204
9064
|
const defaultFieldMetadata$7 = {
|
|
9205
9065
|
label: "vatNumber"
|
|
9206
9066
|
};
|
|
@@ -9848,6 +9708,159 @@ const inferTaxIdNumberType = (taxId2, country2, companyType2) => {
|
|
|
9848
9708
|
}
|
|
9849
9709
|
}
|
|
9850
9710
|
};
|
|
9711
|
+
const STOCK_EXCHANGE_MIC_FIELD = ["stockExchangeMIC"];
|
|
9712
|
+
function StockExchangeMICField({
|
|
9713
|
+
data,
|
|
9714
|
+
valid,
|
|
9715
|
+
errors,
|
|
9716
|
+
labels: labels2,
|
|
9717
|
+
placeholders,
|
|
9718
|
+
readonly,
|
|
9719
|
+
mask,
|
|
9720
|
+
guidanceText,
|
|
9721
|
+
shouldValidate,
|
|
9722
|
+
handleChangeFor
|
|
9723
|
+
}) {
|
|
9724
|
+
return jsx(MaskedInputText, {
|
|
9725
|
+
name: "stockExchangeMIC",
|
|
9726
|
+
label: labels2.stockExchangeMIC ?? "",
|
|
9727
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockExchangeMIC,
|
|
9728
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockExchangeMIC,
|
|
9729
|
+
...mask,
|
|
9730
|
+
classNameModifiers: {
|
|
9731
|
+
field: ["stockExchangeMIC"],
|
|
9732
|
+
input: ["stockExchangeMIC"]
|
|
9733
|
+
},
|
|
9734
|
+
errorMessage: errors.stockExchangeMIC,
|
|
9735
|
+
isValid: valid.stockExchangeMIC ?? false,
|
|
9736
|
+
value: data.stockExchangeMIC ?? "",
|
|
9737
|
+
readonly,
|
|
9738
|
+
shouldValidate,
|
|
9739
|
+
onInput: handleChangeFor("stockExchangeMIC", "input"),
|
|
9740
|
+
onBlur: handleChangeFor("stockExchangeMIC", "blur"),
|
|
9741
|
+
"aria-required": true,
|
|
9742
|
+
"aria-label": labels2.stockExchangeMIC,
|
|
9743
|
+
"aria-invalid": !valid.stockExchangeMIC
|
|
9744
|
+
});
|
|
9745
|
+
}
|
|
9746
|
+
const stockExchangeMICFieldMetadata = {
|
|
9747
|
+
label: "stockExchangeMIC",
|
|
9748
|
+
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
|
|
9749
|
+
mask: {
|
|
9750
|
+
mask: makeMask(...alphanumericInputs(4)),
|
|
9751
|
+
transformOnType: uppercase
|
|
9752
|
+
},
|
|
9753
|
+
guidanceText: {
|
|
9754
|
+
key: "enterNCharactersForExample",
|
|
9755
|
+
values: {
|
|
9756
|
+
numChars: "4",
|
|
9757
|
+
example: "XNAS"
|
|
9758
|
+
}
|
|
9759
|
+
}
|
|
9760
|
+
};
|
|
9761
|
+
const STOCK_ISIN_FIELD = ["stockISIN"];
|
|
9762
|
+
function StockISINField({
|
|
9763
|
+
data,
|
|
9764
|
+
valid,
|
|
9765
|
+
errors,
|
|
9766
|
+
labels: labels2,
|
|
9767
|
+
placeholders,
|
|
9768
|
+
readonly,
|
|
9769
|
+
mask,
|
|
9770
|
+
guidanceText,
|
|
9771
|
+
shouldValidate,
|
|
9772
|
+
handleChangeFor
|
|
9773
|
+
}) {
|
|
9774
|
+
return jsx(MaskedInputText, {
|
|
9775
|
+
name: "stockISIN",
|
|
9776
|
+
label: labels2.stockISIN ?? "",
|
|
9777
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockISIN,
|
|
9778
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockISIN,
|
|
9779
|
+
...mask,
|
|
9780
|
+
classNameModifiers: {
|
|
9781
|
+
field: ["stockISIN"],
|
|
9782
|
+
input: ["stockISIN"]
|
|
9783
|
+
},
|
|
9784
|
+
errorMessage: errors.stockISIN,
|
|
9785
|
+
isValid: valid.stockISIN ?? false,
|
|
9786
|
+
value: data.stockISIN ?? "",
|
|
9787
|
+
readonly,
|
|
9788
|
+
shouldValidate,
|
|
9789
|
+
onInput: handleChangeFor("stockISIN", "input"),
|
|
9790
|
+
onBlur: handleChangeFor("stockISIN", "blur"),
|
|
9791
|
+
"aria-required": true,
|
|
9792
|
+
"aria-label": labels2.stockISIN,
|
|
9793
|
+
"aria-invalid": !valid.stockISIN
|
|
9794
|
+
});
|
|
9795
|
+
}
|
|
9796
|
+
const stockISINFieldMetadata = {
|
|
9797
|
+
label: "stockISIN",
|
|
9798
|
+
validators: [validateNotEmptyOnBlur, {
|
|
9799
|
+
modes: ["blur"],
|
|
9800
|
+
validate: (value) => !!value && isISIN(value)
|
|
9801
|
+
}],
|
|
9802
|
+
mask: {
|
|
9803
|
+
mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
|
|
9804
|
+
transformOnType: uppercase
|
|
9805
|
+
},
|
|
9806
|
+
helperText: "stockISINHelper",
|
|
9807
|
+
guidanceText: {
|
|
9808
|
+
key: "validationPleaseEnterAValidStockISIN",
|
|
9809
|
+
values: {
|
|
9810
|
+
example: "NL0012969182"
|
|
9811
|
+
}
|
|
9812
|
+
}
|
|
9813
|
+
};
|
|
9814
|
+
const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
|
|
9815
|
+
function StockTickerSymbolField({
|
|
9816
|
+
data,
|
|
9817
|
+
valid,
|
|
9818
|
+
errors,
|
|
9819
|
+
labels: labels2,
|
|
9820
|
+
placeholders,
|
|
9821
|
+
readonly,
|
|
9822
|
+
mask,
|
|
9823
|
+
guidanceText,
|
|
9824
|
+
shouldValidate,
|
|
9825
|
+
handleChangeFor
|
|
9826
|
+
}) {
|
|
9827
|
+
return jsx(MaskedInputText, {
|
|
9828
|
+
name: "stockTickerSymbol",
|
|
9829
|
+
label: labels2.stockTickerSymbol ?? "",
|
|
9830
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
|
|
9831
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
|
|
9832
|
+
...mask,
|
|
9833
|
+
classNameModifiers: {
|
|
9834
|
+
field: ["stockTickerSymbol"],
|
|
9835
|
+
input: ["stockTickerSymbol"]
|
|
9836
|
+
},
|
|
9837
|
+
errorMessage: errors.stockTickerSymbol,
|
|
9838
|
+
isValid: valid.stockTickerSymbol ?? false,
|
|
9839
|
+
value: data.stockTickerSymbol ?? "",
|
|
9840
|
+
readonly,
|
|
9841
|
+
shouldValidate,
|
|
9842
|
+
onInput: handleChangeFor("stockTickerSymbol", "input"),
|
|
9843
|
+
onBlur: handleChangeFor("stockTickerSymbol", "blur"),
|
|
9844
|
+
"aria-required": true,
|
|
9845
|
+
"aria-label": labels2.stockTickerSymbol,
|
|
9846
|
+
"aria-invalid": !valid.stockTickerSymbol
|
|
9847
|
+
});
|
|
9848
|
+
}
|
|
9849
|
+
const stockTickerSymbolFieldMetadata = {
|
|
9850
|
+
label: "stockTickerSymbol",
|
|
9851
|
+
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
|
|
9852
|
+
mask: {
|
|
9853
|
+
mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
|
|
9854
|
+
transformOnType: uppercase
|
|
9855
|
+
},
|
|
9856
|
+
guidanceText: {
|
|
9857
|
+
key: "enterAMaximumOfNCharactersForExample",
|
|
9858
|
+
values: {
|
|
9859
|
+
maxChars: "5",
|
|
9860
|
+
example: "ADYEN"
|
|
9861
|
+
}
|
|
9862
|
+
}
|
|
9863
|
+
};
|
|
9851
9864
|
function TaxIdNumberTypeSelector({
|
|
9852
9865
|
country: country2,
|
|
9853
9866
|
companyType: companyType2,
|
|
@@ -10071,16 +10084,24 @@ const vatAbsenceReasons = [
|
|
|
10071
10084
|
"belowTaxThreshold"
|
|
10072
10085
|
/* BelowTaxThreshold */
|
|
10073
10086
|
];
|
|
10074
|
-
const
|
|
10075
|
-
function
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10087
|
+
const VAT_NUMBER_FIELD = ["vatNumber", "exemptedFromVat", "vatAbsenceReason"];
|
|
10088
|
+
function VatNumberField({
|
|
10089
|
+
data,
|
|
10090
|
+
valid,
|
|
10091
|
+
errors,
|
|
10092
|
+
labels: labels2,
|
|
10093
|
+
mask,
|
|
10094
|
+
guidanceText,
|
|
10095
|
+
placeholders,
|
|
10096
|
+
readonly,
|
|
10097
|
+
shouldValidate,
|
|
10098
|
+
handleChangeFor,
|
|
10099
|
+
canExempt,
|
|
10100
|
+
country: country2,
|
|
10101
|
+
vatNumberType,
|
|
10102
|
+
setVatNumberType
|
|
10103
|
+
}) {
|
|
10104
|
+
var _a;
|
|
10084
10105
|
const {
|
|
10085
10106
|
isExperimentEnabled
|
|
10086
10107
|
} = useExperimentsContext();
|
|
@@ -10092,115 +10113,64 @@ function VatNumber(props) {
|
|
|
10092
10113
|
id: VatAbsenceReason.CountryWithoutVatOrGstSystem,
|
|
10093
10114
|
name: VatAbsenceReason.CountryWithoutVatOrGstSystem
|
|
10094
10115
|
}]);
|
|
10095
|
-
const
|
|
10096
|
-
const
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
vatNumberType: taxIdNumberType
|
|
10100
|
-
}, defaultFieldMetadata$7);
|
|
10101
|
-
const mergedProps = mergeFieldMetadataIntoProps("vatNumber", metadata, props);
|
|
10102
|
-
const {
|
|
10103
|
-
i18n
|
|
10104
|
-
} = useI18nContext();
|
|
10105
|
-
const formUtils = formUtilities(mergedProps, i18n);
|
|
10106
|
-
const stateRef = useRef({
|
|
10107
|
-
setState: null
|
|
10108
|
-
});
|
|
10109
|
-
const {
|
|
10110
|
-
handleChangeFor,
|
|
10111
|
-
data,
|
|
10112
|
-
valid,
|
|
10113
|
-
errors,
|
|
10114
|
-
isValid,
|
|
10115
|
-
fieldProblems
|
|
10116
|
-
} = useForm({
|
|
10117
|
-
...mergedProps,
|
|
10118
|
-
schema: (data2) => data2.exemptedFromVat ? ["vatAbsenceReason", "exemptedFromVat"] : ["vatNumber", "exemptedFromVat"],
|
|
10119
|
-
rules: mergedProps.validators,
|
|
10120
|
-
defaultData: {
|
|
10121
|
-
...propData,
|
|
10122
|
-
exemptedFromVat: !!(propData == null ? void 0 : propData.exemptedFromVat)
|
|
10123
|
-
},
|
|
10124
|
-
// exemptedFromVat should be a boolean
|
|
10125
|
-
fieldProblems: fieldValidationErrors
|
|
10126
|
-
});
|
|
10127
|
-
useEffect(() => {
|
|
10128
|
-
if (data.vatNumber || taxIdNumberType) {
|
|
10129
|
-
handleChangeFor("vatNumber", "blur")(data.vatNumber);
|
|
10130
|
-
}
|
|
10131
|
-
}, [taxIdNumberType, country2]);
|
|
10132
|
-
useEffect(() => {
|
|
10133
|
-
var _a2, _b2;
|
|
10134
|
-
(_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b2.call(_a2, {
|
|
10135
|
-
type: "addToState",
|
|
10136
|
-
value: {
|
|
10137
|
-
data,
|
|
10138
|
-
valid,
|
|
10139
|
-
errors,
|
|
10140
|
-
caller: "vatNumber",
|
|
10141
|
-
dataStoreId
|
|
10142
|
-
}
|
|
10143
|
-
});
|
|
10144
|
-
}, [data, valid, errors, isValid]);
|
|
10145
|
-
if (!formUtils.isRequiredField("vatNumber")) return null;
|
|
10146
|
-
const exemptionIsPossible = ((_b = mergedProps.requiredFields) == null ? void 0 : _b.includes("exemptedFromVat")) ?? false;
|
|
10147
|
-
const showTaxIdExemptedOption = exemptionIsPossible && ((_c = taxIdNumberOptions[country2]) == null ? void 0 : _c.length) > 1;
|
|
10148
|
-
const handleTaxIdNumberTypeChange = (taxIdType) => {
|
|
10149
|
-
if (taxIdType === "exempted") {
|
|
10150
|
-
if (!exemptionIsPossible) {
|
|
10116
|
+
const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
|
|
10117
|
+
const handleVatNumberTypeChange = (vatType) => {
|
|
10118
|
+
if (vatType === "exempted") {
|
|
10119
|
+
if (!canExempt) {
|
|
10151
10120
|
throw Error(`${country2} does not allow VAT exemptions`);
|
|
10152
10121
|
}
|
|
10153
10122
|
handleChangeFor("exemptedFromVat")(true);
|
|
10154
|
-
|
|
10123
|
+
setVatNumberType(void 0);
|
|
10155
10124
|
return;
|
|
10156
10125
|
}
|
|
10157
|
-
if (
|
|
10126
|
+
if (canExempt && data.exemptedFromVat === true) {
|
|
10158
10127
|
handleChangeFor("exemptedFromVat")(false);
|
|
10159
10128
|
}
|
|
10160
|
-
|
|
10129
|
+
setVatNumberType(vatType);
|
|
10161
10130
|
};
|
|
10162
10131
|
return jsxs("div", {
|
|
10163
|
-
className: "adyen-kyc-
|
|
10164
|
-
children: [jsx(
|
|
10165
|
-
stateRef
|
|
10166
|
-
}), jsx(TaxIdNumberTypeSelector, {
|
|
10132
|
+
className: "adyen-kyc-field__vat-number",
|
|
10133
|
+
children: [jsx(TaxIdNumberTypeSelector, {
|
|
10167
10134
|
country: country2,
|
|
10168
|
-
setSelected:
|
|
10169
|
-
selected: data.exemptedFromVat ? "exempted" :
|
|
10170
|
-
exemptedOption:
|
|
10135
|
+
setSelected: handleVatNumberTypeChange,
|
|
10136
|
+
selected: data.exemptedFromVat ? "exempted" : vatNumberType,
|
|
10137
|
+
exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
|
|
10171
10138
|
}), jsx(MaskedInputText, {
|
|
10172
|
-
|
|
10173
|
-
label:
|
|
10174
|
-
|
|
10175
|
-
...formUtils.getMask("vatNumber"),
|
|
10139
|
+
"aria-required": true,
|
|
10140
|
+
"aria-label": labels2.vatNumber,
|
|
10141
|
+
"aria-invalid": !valid.vatNumber,
|
|
10176
10142
|
classNameModifiers: {
|
|
10177
10143
|
field: ["tax-id"],
|
|
10178
10144
|
input: ["vatNumber"]
|
|
10179
10145
|
},
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10146
|
+
name: "vatNumber",
|
|
10147
|
+
value: (data == null ? void 0 : data.vatNumber) ?? "",
|
|
10148
|
+
label: labels2.vatNumber ?? "",
|
|
10149
|
+
formatGuidance: (guidanceText == null ? void 0 : guidanceText.vatNumber) ?? "",
|
|
10150
|
+
placeholder: placeholders == null ? void 0 : placeholders.vatNumber,
|
|
10151
|
+
errorMessage: errors.vatNumber,
|
|
10152
|
+
isValid: Boolean(valid.vatNumber),
|
|
10185
10153
|
onInput: handleChangeFor("vatNumber", "input"),
|
|
10186
10154
|
onBlur: handleChangeFor("vatNumber", "blur"),
|
|
10187
|
-
disabled: data.exemptedFromVat
|
|
10188
|
-
|
|
10155
|
+
disabled: data.exemptedFromVat,
|
|
10156
|
+
readonly,
|
|
10157
|
+
shouldValidate,
|
|
10158
|
+
...mask
|
|
10159
|
+
}), canExempt && !showVatExemptedOption && jsx(Checkbox, {
|
|
10160
|
+
"aria-required": false,
|
|
10161
|
+
"aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
10162
|
+
"aria-invalid": false,
|
|
10189
10163
|
name: "exemptedFromVat",
|
|
10190
|
-
label:
|
|
10164
|
+
label: labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
10191
10165
|
value: "exemptedFromVat",
|
|
10192
|
-
readonly: formUtils.isReadOnly("exemptedFromVat"),
|
|
10193
10166
|
classNameModifiers: ["exempted-from-tax"],
|
|
10194
10167
|
checked: data.exemptedFromVat ?? false,
|
|
10195
|
-
onChange: handleChangeFor("exemptedFromVat")
|
|
10196
|
-
|
|
10197
|
-
"aria-label": formUtils.getLabel("exemptedFromVat"),
|
|
10198
|
-
"aria-invalid": false
|
|
10199
|
-
}), data.exemptedFromVat ? jsx(Field, {
|
|
10168
|
+
onChange: handleChangeFor("exemptedFromVat")
|
|
10169
|
+
}), data.exemptedFromVat && jsx(Field, {
|
|
10200
10170
|
name: "vatAbsenceReason",
|
|
10201
10171
|
classNameModifiers: ["tax-id-absence-reason"],
|
|
10202
|
-
label:
|
|
10203
|
-
errorMessage:
|
|
10172
|
+
label: labels2 == null ? void 0 : labels2.vatAbsenceReason,
|
|
10173
|
+
errorMessage: errors.vatAbsenceReason,
|
|
10204
10174
|
isValid: valid.vatAbsenceReason,
|
|
10205
10175
|
children: (childProps) => jsx(RadioGroup, {
|
|
10206
10176
|
...childProps,
|
|
@@ -10212,7 +10182,7 @@ function VatNumber(props) {
|
|
|
10212
10182
|
name: reason
|
|
10213
10183
|
}))
|
|
10214
10184
|
})
|
|
10215
|
-
})
|
|
10185
|
+
})]
|
|
10216
10186
|
});
|
|
10217
10187
|
}
|
|
10218
10188
|
const companyRegistrationDetailsValidationRules = {
|
|
@@ -10250,27 +10220,33 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
|
|
|
10250
10220
|
companyType: [CompanyTypesValue.SOLE_PROPRIETORSHIP],
|
|
10251
10221
|
country: CountryCodes.PuertoRico
|
|
10252
10222
|
}];
|
|
10253
|
-
const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...
|
|
10223
|
+
const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...VAT_NUMBER_FIELD, ...taxIdFields, "dateOfIncorporation"];
|
|
10254
10224
|
function CompanyRegistrationDetailsComponent(props) {
|
|
10255
|
-
var _a, _b;
|
|
10225
|
+
var _a, _b, _c;
|
|
10256
10226
|
const {
|
|
10257
10227
|
i18n
|
|
10258
10228
|
} = useI18nContext();
|
|
10229
|
+
const {
|
|
10230
|
+
companyNameAndCountry
|
|
10231
|
+
} = useGlobalData();
|
|
10259
10232
|
let mergedProps = props;
|
|
10233
|
+
const defaultVatNumberType = ((_a = mergedProps.data) == null ? void 0 : _a.vatNumber) ? inferTaxIdNumberType((_b = mergedProps.data) == null ? void 0 : _b.vatNumber, mergedProps.country) : (_c = taxIdNumberOptions[mergedProps.country]) == null ? void 0 : _c[0].id;
|
|
10234
|
+
const [vatNumberType, setVatNumberType] = useState(defaultVatNumberType);
|
|
10260
10235
|
mergedProps = mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, mergedProps);
|
|
10261
10236
|
mergedProps = mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, mergedProps);
|
|
10262
10237
|
mergedProps = mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, mergedProps);
|
|
10238
|
+
mergedProps = mergeFieldMetadataIntoProps("vatNumber", resolveFieldMetadata(defaultFieldConfig$7[mergedProps.country], {
|
|
10239
|
+
vatNumberType
|
|
10240
|
+
}, defaultFieldMetadata$7), mergedProps);
|
|
10241
|
+
mergedProps = mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, mergedProps);
|
|
10263
10242
|
const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === mergedProps.country && f.companyType.includes(mergedProps.companyType));
|
|
10264
10243
|
const stateRef = useRef({
|
|
10265
10244
|
setState: null
|
|
10266
10245
|
});
|
|
10267
|
-
const COMPANY_REGISTRATION_DETAILS = mergedProps.id;
|
|
10246
|
+
const COMPANY_REGISTRATION_DETAILS = mergedProps.id ?? "companyRegistrationDetails";
|
|
10268
10247
|
const requiredFields = mergedProps.requiredFields || companyRegistrationDetailsFields;
|
|
10269
|
-
const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
|
|
10270
|
-
const
|
|
10271
|
-
getData
|
|
10272
|
-
} = useStateContext();
|
|
10273
|
-
const legalCompanyName2 = (_b = (_a = getData()) == null ? void 0 : _a.companyNameAndCountry) == null ? void 0 : _b.legalCompanyName;
|
|
10248
|
+
const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation", "vatNumber"].includes(field));
|
|
10249
|
+
const legalCompanyName2 = companyNameAndCountry == null ? void 0 : companyNameAndCountry.legalCompanyName;
|
|
10274
10250
|
const isSameNameAsLegalName = !mergedProps.data.tradingName ? true : mergedProps.data.tradingName === legalCompanyName2;
|
|
10275
10251
|
const {
|
|
10276
10252
|
handleChangeFor,
|
|
@@ -10283,7 +10259,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10283
10259
|
setData
|
|
10284
10260
|
} = useForm({
|
|
10285
10261
|
...mergedProps,
|
|
10286
|
-
schema: directChildFields,
|
|
10262
|
+
schema: (currentData) => !currentData.exemptedFromVat ? (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatAbsenceReason")) ?? directChildFields : (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatNumber")) ?? directChildFields,
|
|
10287
10263
|
defaultData: {
|
|
10288
10264
|
...mergedProps.data,
|
|
10289
10265
|
sameNameAsLegalName: isSameNameAsLegalName,
|
|
@@ -10326,7 +10302,6 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10326
10302
|
setData("tradingName", tradingNameIsSameAsLegalName ? legalCompanyName2 : "");
|
|
10327
10303
|
};
|
|
10328
10304
|
const registrationNumberProps = getFieldProps(mergedProps, businessRegistrationNumberFields);
|
|
10329
|
-
const vatNumberProps = getFieldProps(mergedProps, vatNumberFields);
|
|
10330
10305
|
const taxIdProps = getFieldProps(mergedProps, taxIdFields);
|
|
10331
10306
|
const handleChange = ({
|
|
10332
10307
|
currentState,
|
|
@@ -10337,7 +10312,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10337
10312
|
let schema = requiredFields;
|
|
10338
10313
|
let hasSchemaChanged = false;
|
|
10339
10314
|
if (formUtils.isRequiredField("vatNumber")) {
|
|
10340
|
-
schema = currentData.exemptedFromVat ? schema.filter((child) => child !== "vatNumber") : schema.filter((child) => child !== "vatAbsenceReason");
|
|
10315
|
+
schema = currentData.exemptedFromVat ? schema.filter((child) => child !== "vatNumber") : schema.filter((child) => child !== "vatAbsenceReason" && child !== "exemptedFromVat");
|
|
10341
10316
|
hasSchemaChanged = true;
|
|
10342
10317
|
}
|
|
10343
10318
|
if (formUtils.isRequiredField("taxId") && currentData.exemptedFromTax) {
|
|
@@ -10451,10 +10426,22 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10451
10426
|
companyType: mergedProps.companyType,
|
|
10452
10427
|
country: mergedProps.country,
|
|
10453
10428
|
dataStoreId: COMPANY_REGISTRATION_DETAILS
|
|
10454
|
-
}), formUtils.isRequiredField("vatNumber") && jsx(
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
|
|
10429
|
+
}), formUtils.isRequiredField("vatNumber") && jsx(VatNumberField, {
|
|
10430
|
+
data: formUtils.getFieldData(data, VAT_NUMBER_FIELD),
|
|
10431
|
+
valid: formUtils.getFieldValid(valid, VAT_NUMBER_FIELD),
|
|
10432
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, VAT_NUMBER_FIELD),
|
|
10433
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
10434
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
10435
|
+
}),
|
|
10436
|
+
mask: formUtils.getMask("vatNumber"),
|
|
10437
|
+
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
10438
|
+
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
10439
|
+
readonly: formUtils.isReadOnly("vatNumber"),
|
|
10440
|
+
handleChangeFor,
|
|
10441
|
+
country: mergedProps.country,
|
|
10442
|
+
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
10443
|
+
vatNumberType,
|
|
10444
|
+
setVatNumberType
|
|
10458
10445
|
}), formUtils.isRequiredField("taxId") && jsx(TaxId, {
|
|
10459
10446
|
...taxIdProps,
|
|
10460
10447
|
dataStoreId: COMPANY_REGISTRATION_DETAILS,
|
|
@@ -14368,7 +14355,6 @@ const individualBaseMapping = {
|
|
|
14368
14355
|
"personalDetails.licenseCardNumber": "individual.identificationData.cardNumber",
|
|
14369
14356
|
"personalDetails.expiryDate": "individual.identificationData.expiryDate",
|
|
14370
14357
|
"personalDetails.nationality": "individual.nationality",
|
|
14371
|
-
"personalDetails.jobTitle": "individual.jobTitle",
|
|
14372
14358
|
"address.city": "individual.residentialAddress.city",
|
|
14373
14359
|
"address.country": "individual.residentialAddress.country",
|
|
14374
14360
|
"address.postalCode": "individual.residentialAddress.postalCode",
|
|
@@ -24232,107 +24218,6 @@ const defaultFieldConfig$1 = entriesOf(defaultFieldConfig$8).reduce((fieldConfig
|
|
|
24232
24218
|
};
|
|
24233
24219
|
}
|
|
24234
24220
|
}), {});
|
|
24235
|
-
const VAT_NUMBER_FIELD = ["vatNumber", "exemptedFromVat", "vatAbsenceReason"];
|
|
24236
|
-
function VatNumberField({
|
|
24237
|
-
data,
|
|
24238
|
-
valid,
|
|
24239
|
-
errors,
|
|
24240
|
-
labels: labels2,
|
|
24241
|
-
mask,
|
|
24242
|
-
guidanceText,
|
|
24243
|
-
placeholders,
|
|
24244
|
-
readonly,
|
|
24245
|
-
shouldValidate,
|
|
24246
|
-
handleChangeFor,
|
|
24247
|
-
canExempt,
|
|
24248
|
-
country: country2,
|
|
24249
|
-
vatNumberType,
|
|
24250
|
-
setVatNumberType
|
|
24251
|
-
}) {
|
|
24252
|
-
var _a;
|
|
24253
|
-
const {
|
|
24254
|
-
isExperimentEnabled
|
|
24255
|
-
} = useExperimentsContext();
|
|
24256
|
-
const showExtraTaxExemptionReasons = isExperimentEnabled(ExperimentNames.ShowExtraTaxExemptionReasons);
|
|
24257
|
-
const extraVatAbsenceReasons = vatAbsenceReasons.map((reason) => ({
|
|
24258
|
-
id: reason,
|
|
24259
|
-
name: reason
|
|
24260
|
-
})).concat([{
|
|
24261
|
-
id: VatAbsenceReason.CountryWithoutVatOrGstSystem,
|
|
24262
|
-
name: VatAbsenceReason.CountryWithoutVatOrGstSystem
|
|
24263
|
-
}]);
|
|
24264
|
-
const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
|
|
24265
|
-
const handleVatNumberTypeChange = (vatType) => {
|
|
24266
|
-
if (vatType === "exempted") {
|
|
24267
|
-
if (!canExempt) {
|
|
24268
|
-
throw Error(`${country2} does not allow VAT exemptions`);
|
|
24269
|
-
}
|
|
24270
|
-
handleChangeFor("exemptedFromVat")(true);
|
|
24271
|
-
setVatNumberType(void 0);
|
|
24272
|
-
return;
|
|
24273
|
-
}
|
|
24274
|
-
if (canExempt && data.exemptedFromVat === true) {
|
|
24275
|
-
handleChangeFor("exemptedFromVat")(false);
|
|
24276
|
-
}
|
|
24277
|
-
setVatNumberType(vatType);
|
|
24278
|
-
};
|
|
24279
|
-
return jsxs("div", {
|
|
24280
|
-
className: "adyen-kyc-field__vat-number",
|
|
24281
|
-
children: [jsx(TaxIdNumberTypeSelector, {
|
|
24282
|
-
country: country2,
|
|
24283
|
-
setSelected: handleVatNumberTypeChange,
|
|
24284
|
-
selected: data.exemptedFromVat ? "exempted" : vatNumberType,
|
|
24285
|
-
exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
|
|
24286
|
-
}), jsx(MaskedInputText, {
|
|
24287
|
-
"aria-required": true,
|
|
24288
|
-
"aria-label": labels2.vatNumber,
|
|
24289
|
-
"aria-invalid": !valid.vatNumber,
|
|
24290
|
-
classNameModifiers: {
|
|
24291
|
-
field: ["tax-id"],
|
|
24292
|
-
input: ["vatNumber"]
|
|
24293
|
-
},
|
|
24294
|
-
name: "vatNumber",
|
|
24295
|
-
value: (data == null ? void 0 : data.vatNumber) ?? "",
|
|
24296
|
-
label: labels2.vatNumber ?? "",
|
|
24297
|
-
formatGuidance: (guidanceText == null ? void 0 : guidanceText.vatNumber) ?? "",
|
|
24298
|
-
placeholder: placeholders == null ? void 0 : placeholders.vatNumber,
|
|
24299
|
-
errorMessage: errors.vatNumber,
|
|
24300
|
-
isValid: Boolean(valid.vatNumber),
|
|
24301
|
-
onInput: handleChangeFor("vatNumber", "input"),
|
|
24302
|
-
onBlur: handleChangeFor("vatNumber", "blur"),
|
|
24303
|
-
disabled: data.exemptedFromVat,
|
|
24304
|
-
readonly,
|
|
24305
|
-
shouldValidate,
|
|
24306
|
-
...mask
|
|
24307
|
-
}), canExempt && !showVatExemptedOption && jsx(Checkbox, {
|
|
24308
|
-
"aria-required": false,
|
|
24309
|
-
"aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
24310
|
-
"aria-invalid": false,
|
|
24311
|
-
name: "exemptedFromVat",
|
|
24312
|
-
label: labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
24313
|
-
value: "exemptedFromVat",
|
|
24314
|
-
classNameModifiers: ["exempted-from-tax"],
|
|
24315
|
-
checked: data.exemptedFromVat ?? false,
|
|
24316
|
-
onChange: handleChangeFor("exemptedFromVat")
|
|
24317
|
-
}), data.exemptedFromVat && jsx(Field, {
|
|
24318
|
-
name: "vatAbsenceReason",
|
|
24319
|
-
classNameModifiers: ["tax-id-absence-reason"],
|
|
24320
|
-
label: labels2 == null ? void 0 : labels2.vatAbsenceReason,
|
|
24321
|
-
errorMessage: errors.vatAbsenceReason,
|
|
24322
|
-
isValid: valid.vatAbsenceReason,
|
|
24323
|
-
children: (childProps) => jsx(RadioGroup, {
|
|
24324
|
-
...childProps,
|
|
24325
|
-
name: "vatAbsenceReason",
|
|
24326
|
-
onChange: handleChangeFor("vatAbsenceReason", "input"),
|
|
24327
|
-
value: data.vatAbsenceReason,
|
|
24328
|
-
items: showExtraTaxExemptionReasons ? extraVatAbsenceReasons : vatAbsenceReasons.map((reason) => ({
|
|
24329
|
-
id: reason,
|
|
24330
|
-
name: reason
|
|
24331
|
-
}))
|
|
24332
|
-
})
|
|
24333
|
-
})]
|
|
24334
|
-
});
|
|
24335
|
-
}
|
|
24336
24221
|
const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
|
|
24337
24222
|
const additionalInformationFields = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD];
|
|
24338
24223
|
function AdditionalInformationComponent({
|
|
@@ -24405,6 +24290,8 @@ function AdditionalInformationComponent({
|
|
|
24405
24290
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$7[country2], {
|
|
24406
24291
|
vatNumberType
|
|
24407
24292
|
}, defaultFieldMetadata$7), acc);
|
|
24293
|
+
case "vatAbsenceReason":
|
|
24294
|
+
return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
|
|
24408
24295
|
case "dateOfIncorporation":
|
|
24409
24296
|
return {
|
|
24410
24297
|
...acc,
|
|
@@ -25519,7 +25406,6 @@ const Modal = ({
|
|
|
25519
25406
|
size = "medium",
|
|
25520
25407
|
title,
|
|
25521
25408
|
isDismissible = true,
|
|
25522
|
-
isOpen = true,
|
|
25523
25409
|
onClose = noop,
|
|
25524
25410
|
role: role2 = "dialog"
|
|
25525
25411
|
}) => {
|
|
@@ -25527,10 +25413,10 @@ const Modal = ({
|
|
|
25527
25413
|
i18n
|
|
25528
25414
|
} = useI18nContext();
|
|
25529
25415
|
const closeModal = useCallback(() => {
|
|
25530
|
-
if (
|
|
25416
|
+
if (isDismissible) {
|
|
25531
25417
|
onClose();
|
|
25532
25418
|
}
|
|
25533
|
-
}, [isDismissible,
|
|
25419
|
+
}, [isDismissible, onClose]);
|
|
25534
25420
|
useEffect(() => {
|
|
25535
25421
|
const handleEscapeKey = ({
|
|
25536
25422
|
code: code2
|
|
@@ -25539,21 +25425,17 @@ const Modal = ({
|
|
|
25539
25425
|
closeModal();
|
|
25540
25426
|
}
|
|
25541
25427
|
};
|
|
25542
|
-
|
|
25543
|
-
|
|
25544
|
-
|
|
25545
|
-
} else {
|
|
25428
|
+
document.documentElement.classList.add("u-overflow-hidden");
|
|
25429
|
+
document.addEventListener("keydown", handleEscapeKey);
|
|
25430
|
+
return () => {
|
|
25546
25431
|
document.documentElement.classList.remove("u-overflow-hidden");
|
|
25547
25432
|
document.removeEventListener("keydown", handleEscapeKey);
|
|
25548
|
-
}
|
|
25549
|
-
|
|
25550
|
-
}, [closeModal, isDismissible, isOpen]);
|
|
25433
|
+
};
|
|
25434
|
+
}, [closeModal, isDismissible]);
|
|
25551
25435
|
return jsx("div", {
|
|
25552
|
-
className: cx("adyen-kyc-overlay",
|
|
25553
|
-
"adyen-kyc-overlay--visible": isOpen
|
|
25554
|
-
}),
|
|
25436
|
+
className: cx("adyen-kyc-overlay", "adyen-kyc-overlay--visible"),
|
|
25555
25437
|
role: "none",
|
|
25556
|
-
children:
|
|
25438
|
+
children: jsxs("div", {
|
|
25557
25439
|
className: cx(classNames == null ? void 0 : classNames.modal, "adyen-kyc-modal", {
|
|
25558
25440
|
"adyen-kyc-modal--small": size === "small",
|
|
25559
25441
|
"adyen-kyc-modal--large": size === "large"
|
|
@@ -27955,6 +27837,8 @@ function CompanyOtherDetails({
|
|
|
27955
27837
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$7[country2], {
|
|
27956
27838
|
vatNumberType
|
|
27957
27839
|
}, defaultFieldMetadata$7), acc);
|
|
27840
|
+
case "vatAbsenceReason":
|
|
27841
|
+
return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
|
|
27958
27842
|
default:
|
|
27959
27843
|
return acc;
|
|
27960
27844
|
}
|
|
@@ -38160,7 +38044,7 @@ const ConfigurationApiProvider = ({
|
|
|
38160
38044
|
isEmbeddedDropin,
|
|
38161
38045
|
loadingContext
|
|
38162
38046
|
} = authContext;
|
|
38163
|
-
const sdkVersion = "2.47.
|
|
38047
|
+
const sdkVersion = "2.47.2";
|
|
38164
38048
|
useAnalytics({
|
|
38165
38049
|
onUserEvent,
|
|
38166
38050
|
legalEntityId: rootLegalEntityId,
|
|
@@ -3,8 +3,8 @@ import type { CompanyTypesValue } from '../../core/models/api/company-types-valu
|
|
|
3
3
|
import type { CountryCode } from '../../core/models/country-code';
|
|
4
4
|
import type { BusinessRegistrationNumberSchema } from '../internal/BusinessRegistrationNumber/types';
|
|
5
5
|
import type { TaxIdSchema } from '../internal/TaxId/types';
|
|
6
|
-
import type {
|
|
7
|
-
export interface CompanyRegistrationDetailsSchema extends BusinessRegistrationNumberSchema, TaxIdSchema,
|
|
6
|
+
import type { VatNumberFieldSchema } from '../internal/VatNumberField/types';
|
|
7
|
+
export interface CompanyRegistrationDetailsSchema extends BusinessRegistrationNumberSchema, TaxIdSchema, VatNumberFieldSchema {
|
|
8
8
|
tradingName?: string;
|
|
9
9
|
sameNameAsLegalName?: boolean;
|
|
10
10
|
stockExchangeMIC?: string;
|
|
@@ -131,12 +131,21 @@ export declare const taxIdNumberOptions: {
|
|
|
131
131
|
readonly name: "socialSecurityNumber";
|
|
132
132
|
readonly applicableOnlyFor: readonly [CompanyTypesValue.SOLE_PROPRIETORSHIP];
|
|
133
133
|
}];
|
|
134
|
+
readonly PR: readonly [{
|
|
135
|
+
readonly id: "EIN";
|
|
136
|
+
readonly name: "ein";
|
|
137
|
+
}, {
|
|
138
|
+
readonly id: "SSN";
|
|
139
|
+
readonly name: "ssn";
|
|
140
|
+
readonly applicableOnlyFor: readonly [CompanyTypesValue.SOLE_PROPRIETORSHIP];
|
|
141
|
+
}];
|
|
134
142
|
readonly US: readonly [{
|
|
135
143
|
readonly id: "EIN";
|
|
136
144
|
readonly name: "ein";
|
|
137
145
|
}, {
|
|
138
146
|
readonly id: "SSN";
|
|
139
147
|
readonly name: "ssn";
|
|
148
|
+
readonly applicableOnlyFor: readonly [CompanyTypesValue.SOLE_PROPRIETORSHIP];
|
|
140
149
|
}];
|
|
141
150
|
};
|
|
142
151
|
export declare const getTaxIdNumberOptions: (country: CountryCode, companyType: CompanyTypesValue | LegalEntityType.TRUST | undefined) => readonly TaxIdNumberOption[] | undefined;
|
|
@@ -13,9 +13,8 @@ export interface ModalProps {
|
|
|
13
13
|
footer?: string;
|
|
14
14
|
};
|
|
15
15
|
isDismissible?: boolean;
|
|
16
|
-
isOpen?: boolean;
|
|
17
16
|
title?: string;
|
|
18
17
|
onClose?: () => void;
|
|
19
18
|
role?: JSX.AriaRole;
|
|
20
19
|
}
|
|
21
|
-
export declare const Modal: ({ content, footer, header, classNames, size, title, isDismissible,
|
|
20
|
+
export declare const Modal: ({ content, footer, header, classNames, size, title, isDismissible, onClose, role, }: ModalProps) => JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { FieldMetadata } from '../../../core/models/country-config';
|
|
2
2
|
import type { PerCountryFieldConfig } from '../../../core/models/field-configurations';
|
|
3
3
|
import type { TaxIdNumberType } from '../IdFieldTypeSelector/countryIdNumberTypes';
|
|
4
|
-
import type {
|
|
4
|
+
import type { VatNumberFieldSchema } from './types';
|
|
5
|
+
export declare const vatAbsenceReasonMetadata: FieldMetadata<VatNumberFieldSchema, 'vatAbsenceReason'>;
|
|
5
6
|
interface FieldConfigParams {
|
|
6
7
|
vatNumberType: TaxIdNumberType | undefined;
|
|
7
8
|
}
|
|
8
|
-
export declare const defaultFieldMetadata: FieldMetadata<
|
|
9
|
-
export declare const defaultFieldConfig: PerCountryFieldConfig<
|
|
9
|
+
export declare const defaultFieldMetadata: FieldMetadata<VatNumberFieldSchema, 'vatNumber'>;
|
|
10
|
+
export declare const defaultFieldConfig: PerCountryFieldConfig<VatNumberFieldSchema, 'vatNumber', FieldConfigParams>;
|
|
10
11
|
export {};
|
|
@@ -31,7 +31,6 @@ export declare const individualComponentsKeyMapping: {
|
|
|
31
31
|
'personalDetails.licenseCardNumber': string;
|
|
32
32
|
'personalDetails.expiryDate': string;
|
|
33
33
|
'personalDetails.nationality': string;
|
|
34
|
-
'personalDetails.jobTitle': string;
|
|
35
34
|
'address.city': string;
|
|
36
35
|
'address.country': string;
|
|
37
36
|
'address.postalCode': string;
|
|
@@ -40,7 +39,7 @@ export declare const individualComponentsKeyMapping: {
|
|
|
40
39
|
'address.otherAddressInformation': string;
|
|
41
40
|
};
|
|
42
41
|
export declare const individualApiKeyMapping: {
|
|
43
|
-
[x: string]: "personalDetails.firstName" | "personalDetails.lastName" | "personalDetails.issuerState" | "personalDetails.expiryDate" | "personalDetails.phoneNumber" | "personalDetails.email" | "personalDetails.birthDate" | "personalDetails.idNumber" | "personalDetails.licenseCardNumber" | "personalDetails.nationality" | "personalDetails.
|
|
42
|
+
[x: string]: "personalDetails.firstName" | "personalDetails.lastName" | "personalDetails.issuerState" | "personalDetails.expiryDate" | "personalDetails.phoneNumber" | "personalDetails.email" | "personalDetails.birthDate" | "personalDetails.idNumber" | "personalDetails.licenseCardNumber" | "personalDetails.nationality" | "personalDetails.typeOfIdentity" | "personalDetails.idNumberExempt" | "address.postalCode" | "address.city" | "address.country" | "address.stateOrProvince" | "address.otherAddressInformation" | "address.address";
|
|
44
43
|
};
|
|
45
44
|
export declare const businessDetailsComponentsKeyMapping: {
|
|
46
45
|
'basicInformation.country': string;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, vatNumberFields } from './VatNumber';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BaseInnerFormProps } from '../../../core/hooks/useForm';
|
|
2
|
-
import type { CountryCode } from '../../../core/models/country-code';
|
|
3
|
-
import type { defaultFieldConfig } from './fieldConfig';
|
|
4
|
-
export interface VatNumberSchema {
|
|
5
|
-
vatNumber?: string;
|
|
6
|
-
exemptedFromVat?: boolean;
|
|
7
|
-
vatAbsenceReason?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface VatNumberProps extends BaseInnerFormProps<VatNumberSchema> {
|
|
10
|
-
country: CountryCode;
|
|
11
|
-
fieldConfig?: typeof defaultFieldConfig;
|
|
12
|
-
}
|