@adyen/kyc-components 2.47.0 → 2.47.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/es/adyen-kyc-components.es.js +256 -382
- package/dist/types/components/CompanyRegistrationDetails/types.d.ts +2 -2
- 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
|
@@ -8749,159 +8749,6 @@ function InputDate(props) {
|
|
|
8749
8749
|
maxLength: 10
|
|
8750
8750
|
});
|
|
8751
8751
|
}
|
|
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
8752
|
const defaultFieldMetadata$8 = {
|
|
8906
8753
|
label: "taxId"
|
|
8907
8754
|
};
|
|
@@ -9201,6 +9048,9 @@ const defaultFieldConfig$8 = {
|
|
|
9201
9048
|
validators: validatePatternOnBlur(/^\d{12}$/)
|
|
9202
9049
|
}
|
|
9203
9050
|
};
|
|
9051
|
+
const vatAbsenceReasonMetadata = {
|
|
9052
|
+
validators: [validateNotEmptyOnBlur]
|
|
9053
|
+
};
|
|
9204
9054
|
const defaultFieldMetadata$7 = {
|
|
9205
9055
|
label: "vatNumber"
|
|
9206
9056
|
};
|
|
@@ -9848,6 +9698,159 @@ const inferTaxIdNumberType = (taxId2, country2, companyType2) => {
|
|
|
9848
9698
|
}
|
|
9849
9699
|
}
|
|
9850
9700
|
};
|
|
9701
|
+
const STOCK_EXCHANGE_MIC_FIELD = ["stockExchangeMIC"];
|
|
9702
|
+
function StockExchangeMICField({
|
|
9703
|
+
data,
|
|
9704
|
+
valid,
|
|
9705
|
+
errors,
|
|
9706
|
+
labels: labels2,
|
|
9707
|
+
placeholders,
|
|
9708
|
+
readonly,
|
|
9709
|
+
mask,
|
|
9710
|
+
guidanceText,
|
|
9711
|
+
shouldValidate,
|
|
9712
|
+
handleChangeFor
|
|
9713
|
+
}) {
|
|
9714
|
+
return jsx(MaskedInputText, {
|
|
9715
|
+
name: "stockExchangeMIC",
|
|
9716
|
+
label: labels2.stockExchangeMIC ?? "",
|
|
9717
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockExchangeMIC,
|
|
9718
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockExchangeMIC,
|
|
9719
|
+
...mask,
|
|
9720
|
+
classNameModifiers: {
|
|
9721
|
+
field: ["stockExchangeMIC"],
|
|
9722
|
+
input: ["stockExchangeMIC"]
|
|
9723
|
+
},
|
|
9724
|
+
errorMessage: errors.stockExchangeMIC,
|
|
9725
|
+
isValid: valid.stockExchangeMIC ?? false,
|
|
9726
|
+
value: data.stockExchangeMIC ?? "",
|
|
9727
|
+
readonly,
|
|
9728
|
+
shouldValidate,
|
|
9729
|
+
onInput: handleChangeFor("stockExchangeMIC", "input"),
|
|
9730
|
+
onBlur: handleChangeFor("stockExchangeMIC", "blur"),
|
|
9731
|
+
"aria-required": true,
|
|
9732
|
+
"aria-label": labels2.stockExchangeMIC,
|
|
9733
|
+
"aria-invalid": !valid.stockExchangeMIC
|
|
9734
|
+
});
|
|
9735
|
+
}
|
|
9736
|
+
const stockExchangeMICFieldMetadata = {
|
|
9737
|
+
label: "stockExchangeMIC",
|
|
9738
|
+
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
|
|
9739
|
+
mask: {
|
|
9740
|
+
mask: makeMask(...alphanumericInputs(4)),
|
|
9741
|
+
transformOnType: uppercase
|
|
9742
|
+
},
|
|
9743
|
+
guidanceText: {
|
|
9744
|
+
key: "enterNCharactersForExample",
|
|
9745
|
+
values: {
|
|
9746
|
+
numChars: "4",
|
|
9747
|
+
example: "XNAS"
|
|
9748
|
+
}
|
|
9749
|
+
}
|
|
9750
|
+
};
|
|
9751
|
+
const STOCK_ISIN_FIELD = ["stockISIN"];
|
|
9752
|
+
function StockISINField({
|
|
9753
|
+
data,
|
|
9754
|
+
valid,
|
|
9755
|
+
errors,
|
|
9756
|
+
labels: labels2,
|
|
9757
|
+
placeholders,
|
|
9758
|
+
readonly,
|
|
9759
|
+
mask,
|
|
9760
|
+
guidanceText,
|
|
9761
|
+
shouldValidate,
|
|
9762
|
+
handleChangeFor
|
|
9763
|
+
}) {
|
|
9764
|
+
return jsx(MaskedInputText, {
|
|
9765
|
+
name: "stockISIN",
|
|
9766
|
+
label: labels2.stockISIN ?? "",
|
|
9767
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockISIN,
|
|
9768
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockISIN,
|
|
9769
|
+
...mask,
|
|
9770
|
+
classNameModifiers: {
|
|
9771
|
+
field: ["stockISIN"],
|
|
9772
|
+
input: ["stockISIN"]
|
|
9773
|
+
},
|
|
9774
|
+
errorMessage: errors.stockISIN,
|
|
9775
|
+
isValid: valid.stockISIN ?? false,
|
|
9776
|
+
value: data.stockISIN ?? "",
|
|
9777
|
+
readonly,
|
|
9778
|
+
shouldValidate,
|
|
9779
|
+
onInput: handleChangeFor("stockISIN", "input"),
|
|
9780
|
+
onBlur: handleChangeFor("stockISIN", "blur"),
|
|
9781
|
+
"aria-required": true,
|
|
9782
|
+
"aria-label": labels2.stockISIN,
|
|
9783
|
+
"aria-invalid": !valid.stockISIN
|
|
9784
|
+
});
|
|
9785
|
+
}
|
|
9786
|
+
const stockISINFieldMetadata = {
|
|
9787
|
+
label: "stockISIN",
|
|
9788
|
+
validators: [validateNotEmptyOnBlur, {
|
|
9789
|
+
modes: ["blur"],
|
|
9790
|
+
validate: (value) => !!value && isISIN(value)
|
|
9791
|
+
}],
|
|
9792
|
+
mask: {
|
|
9793
|
+
mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
|
|
9794
|
+
transformOnType: uppercase
|
|
9795
|
+
},
|
|
9796
|
+
helperText: "stockISINHelper",
|
|
9797
|
+
guidanceText: {
|
|
9798
|
+
key: "validationPleaseEnterAValidStockISIN",
|
|
9799
|
+
values: {
|
|
9800
|
+
example: "NL0012969182"
|
|
9801
|
+
}
|
|
9802
|
+
}
|
|
9803
|
+
};
|
|
9804
|
+
const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
|
|
9805
|
+
function StockTickerSymbolField({
|
|
9806
|
+
data,
|
|
9807
|
+
valid,
|
|
9808
|
+
errors,
|
|
9809
|
+
labels: labels2,
|
|
9810
|
+
placeholders,
|
|
9811
|
+
readonly,
|
|
9812
|
+
mask,
|
|
9813
|
+
guidanceText,
|
|
9814
|
+
shouldValidate,
|
|
9815
|
+
handleChangeFor
|
|
9816
|
+
}) {
|
|
9817
|
+
return jsx(MaskedInputText, {
|
|
9818
|
+
name: "stockTickerSymbol",
|
|
9819
|
+
label: labels2.stockTickerSymbol ?? "",
|
|
9820
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
|
|
9821
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
|
|
9822
|
+
...mask,
|
|
9823
|
+
classNameModifiers: {
|
|
9824
|
+
field: ["stockTickerSymbol"],
|
|
9825
|
+
input: ["stockTickerSymbol"]
|
|
9826
|
+
},
|
|
9827
|
+
errorMessage: errors.stockTickerSymbol,
|
|
9828
|
+
isValid: valid.stockTickerSymbol ?? false,
|
|
9829
|
+
value: data.stockTickerSymbol ?? "",
|
|
9830
|
+
readonly,
|
|
9831
|
+
shouldValidate,
|
|
9832
|
+
onInput: handleChangeFor("stockTickerSymbol", "input"),
|
|
9833
|
+
onBlur: handleChangeFor("stockTickerSymbol", "blur"),
|
|
9834
|
+
"aria-required": true,
|
|
9835
|
+
"aria-label": labels2.stockTickerSymbol,
|
|
9836
|
+
"aria-invalid": !valid.stockTickerSymbol
|
|
9837
|
+
});
|
|
9838
|
+
}
|
|
9839
|
+
const stockTickerSymbolFieldMetadata = {
|
|
9840
|
+
label: "stockTickerSymbol",
|
|
9841
|
+
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
|
|
9842
|
+
mask: {
|
|
9843
|
+
mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
|
|
9844
|
+
transformOnType: uppercase
|
|
9845
|
+
},
|
|
9846
|
+
guidanceText: {
|
|
9847
|
+
key: "enterAMaximumOfNCharactersForExample",
|
|
9848
|
+
values: {
|
|
9849
|
+
maxChars: "5",
|
|
9850
|
+
example: "ADYEN"
|
|
9851
|
+
}
|
|
9852
|
+
}
|
|
9853
|
+
};
|
|
9851
9854
|
function TaxIdNumberTypeSelector({
|
|
9852
9855
|
country: country2,
|
|
9853
9856
|
companyType: companyType2,
|
|
@@ -10071,16 +10074,24 @@ const vatAbsenceReasons = [
|
|
|
10071
10074
|
"belowTaxThreshold"
|
|
10072
10075
|
/* BelowTaxThreshold */
|
|
10073
10076
|
];
|
|
10074
|
-
const
|
|
10075
|
-
function
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10077
|
+
const VAT_NUMBER_FIELD = ["vatNumber", "exemptedFromVat", "vatAbsenceReason"];
|
|
10078
|
+
function VatNumberField({
|
|
10079
|
+
data,
|
|
10080
|
+
valid,
|
|
10081
|
+
errors,
|
|
10082
|
+
labels: labels2,
|
|
10083
|
+
mask,
|
|
10084
|
+
guidanceText,
|
|
10085
|
+
placeholders,
|
|
10086
|
+
readonly,
|
|
10087
|
+
shouldValidate,
|
|
10088
|
+
handleChangeFor,
|
|
10089
|
+
canExempt,
|
|
10090
|
+
country: country2,
|
|
10091
|
+
vatNumberType,
|
|
10092
|
+
setVatNumberType
|
|
10093
|
+
}) {
|
|
10094
|
+
var _a;
|
|
10084
10095
|
const {
|
|
10085
10096
|
isExperimentEnabled
|
|
10086
10097
|
} = useExperimentsContext();
|
|
@@ -10092,115 +10103,64 @@ function VatNumber(props) {
|
|
|
10092
10103
|
id: VatAbsenceReason.CountryWithoutVatOrGstSystem,
|
|
10093
10104
|
name: VatAbsenceReason.CountryWithoutVatOrGstSystem
|
|
10094
10105
|
}]);
|
|
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) {
|
|
10106
|
+
const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
|
|
10107
|
+
const handleVatNumberTypeChange = (vatType) => {
|
|
10108
|
+
if (vatType === "exempted") {
|
|
10109
|
+
if (!canExempt) {
|
|
10151
10110
|
throw Error(`${country2} does not allow VAT exemptions`);
|
|
10152
10111
|
}
|
|
10153
10112
|
handleChangeFor("exemptedFromVat")(true);
|
|
10154
|
-
|
|
10113
|
+
setVatNumberType(void 0);
|
|
10155
10114
|
return;
|
|
10156
10115
|
}
|
|
10157
|
-
if (
|
|
10116
|
+
if (canExempt && data.exemptedFromVat === true) {
|
|
10158
10117
|
handleChangeFor("exemptedFromVat")(false);
|
|
10159
10118
|
}
|
|
10160
|
-
|
|
10119
|
+
setVatNumberType(vatType);
|
|
10161
10120
|
};
|
|
10162
10121
|
return jsxs("div", {
|
|
10163
|
-
className: "adyen-kyc-
|
|
10164
|
-
children: [jsx(
|
|
10165
|
-
stateRef
|
|
10166
|
-
}), jsx(TaxIdNumberTypeSelector, {
|
|
10122
|
+
className: "adyen-kyc-field__vat-number",
|
|
10123
|
+
children: [jsx(TaxIdNumberTypeSelector, {
|
|
10167
10124
|
country: country2,
|
|
10168
|
-
setSelected:
|
|
10169
|
-
selected: data.exemptedFromVat ? "exempted" :
|
|
10170
|
-
exemptedOption:
|
|
10125
|
+
setSelected: handleVatNumberTypeChange,
|
|
10126
|
+
selected: data.exemptedFromVat ? "exempted" : vatNumberType,
|
|
10127
|
+
exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
|
|
10171
10128
|
}), jsx(MaskedInputText, {
|
|
10172
|
-
|
|
10173
|
-
label:
|
|
10174
|
-
|
|
10175
|
-
...formUtils.getMask("vatNumber"),
|
|
10129
|
+
"aria-required": true,
|
|
10130
|
+
"aria-label": labels2.vatNumber,
|
|
10131
|
+
"aria-invalid": !valid.vatNumber,
|
|
10176
10132
|
classNameModifiers: {
|
|
10177
10133
|
field: ["tax-id"],
|
|
10178
10134
|
input: ["vatNumber"]
|
|
10179
10135
|
},
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10136
|
+
name: "vatNumber",
|
|
10137
|
+
value: (data == null ? void 0 : data.vatNumber) ?? "",
|
|
10138
|
+
label: labels2.vatNumber ?? "",
|
|
10139
|
+
formatGuidance: (guidanceText == null ? void 0 : guidanceText.vatNumber) ?? "",
|
|
10140
|
+
placeholder: placeholders == null ? void 0 : placeholders.vatNumber,
|
|
10141
|
+
errorMessage: errors.vatNumber,
|
|
10142
|
+
isValid: Boolean(valid.vatNumber),
|
|
10185
10143
|
onInput: handleChangeFor("vatNumber", "input"),
|
|
10186
10144
|
onBlur: handleChangeFor("vatNumber", "blur"),
|
|
10187
|
-
disabled: data.exemptedFromVat
|
|
10188
|
-
|
|
10145
|
+
disabled: data.exemptedFromVat,
|
|
10146
|
+
readonly,
|
|
10147
|
+
shouldValidate,
|
|
10148
|
+
...mask
|
|
10149
|
+
}), canExempt && !showVatExemptedOption && jsx(Checkbox, {
|
|
10150
|
+
"aria-required": false,
|
|
10151
|
+
"aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
10152
|
+
"aria-invalid": false,
|
|
10189
10153
|
name: "exemptedFromVat",
|
|
10190
|
-
label:
|
|
10154
|
+
label: labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
10191
10155
|
value: "exemptedFromVat",
|
|
10192
|
-
readonly: formUtils.isReadOnly("exemptedFromVat"),
|
|
10193
10156
|
classNameModifiers: ["exempted-from-tax"],
|
|
10194
10157
|
checked: data.exemptedFromVat ?? false,
|
|
10195
|
-
onChange: handleChangeFor("exemptedFromVat")
|
|
10196
|
-
|
|
10197
|
-
"aria-label": formUtils.getLabel("exemptedFromVat"),
|
|
10198
|
-
"aria-invalid": false
|
|
10199
|
-
}), data.exemptedFromVat ? jsx(Field, {
|
|
10158
|
+
onChange: handleChangeFor("exemptedFromVat")
|
|
10159
|
+
}), data.exemptedFromVat && jsx(Field, {
|
|
10200
10160
|
name: "vatAbsenceReason",
|
|
10201
10161
|
classNameModifiers: ["tax-id-absence-reason"],
|
|
10202
|
-
label:
|
|
10203
|
-
errorMessage:
|
|
10162
|
+
label: labels2 == null ? void 0 : labels2.vatAbsenceReason,
|
|
10163
|
+
errorMessage: errors.vatAbsenceReason,
|
|
10204
10164
|
isValid: valid.vatAbsenceReason,
|
|
10205
10165
|
children: (childProps) => jsx(RadioGroup, {
|
|
10206
10166
|
...childProps,
|
|
@@ -10212,7 +10172,7 @@ function VatNumber(props) {
|
|
|
10212
10172
|
name: reason
|
|
10213
10173
|
}))
|
|
10214
10174
|
})
|
|
10215
|
-
})
|
|
10175
|
+
})]
|
|
10216
10176
|
});
|
|
10217
10177
|
}
|
|
10218
10178
|
const companyRegistrationDetailsValidationRules = {
|
|
@@ -10250,27 +10210,33 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
|
|
|
10250
10210
|
companyType: [CompanyTypesValue.SOLE_PROPRIETORSHIP],
|
|
10251
10211
|
country: CountryCodes.PuertoRico
|
|
10252
10212
|
}];
|
|
10253
|
-
const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...
|
|
10213
|
+
const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...VAT_NUMBER_FIELD, ...taxIdFields, "dateOfIncorporation"];
|
|
10254
10214
|
function CompanyRegistrationDetailsComponent(props) {
|
|
10255
|
-
var _a, _b;
|
|
10215
|
+
var _a, _b, _c;
|
|
10256
10216
|
const {
|
|
10257
10217
|
i18n
|
|
10258
10218
|
} = useI18nContext();
|
|
10219
|
+
const {
|
|
10220
|
+
companyNameAndCountry
|
|
10221
|
+
} = useGlobalData();
|
|
10259
10222
|
let mergedProps = props;
|
|
10223
|
+
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;
|
|
10224
|
+
const [vatNumberType, setVatNumberType] = useState(defaultVatNumberType);
|
|
10260
10225
|
mergedProps = mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, mergedProps);
|
|
10261
10226
|
mergedProps = mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, mergedProps);
|
|
10262
10227
|
mergedProps = mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, mergedProps);
|
|
10228
|
+
mergedProps = mergeFieldMetadataIntoProps("vatNumber", resolveFieldMetadata(defaultFieldConfig$7[mergedProps.country], {
|
|
10229
|
+
vatNumberType
|
|
10230
|
+
}, defaultFieldMetadata$7), mergedProps);
|
|
10231
|
+
mergedProps = mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, mergedProps);
|
|
10263
10232
|
const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === mergedProps.country && f.companyType.includes(mergedProps.companyType));
|
|
10264
10233
|
const stateRef = useRef({
|
|
10265
10234
|
setState: null
|
|
10266
10235
|
});
|
|
10267
|
-
const COMPANY_REGISTRATION_DETAILS = mergedProps.id;
|
|
10236
|
+
const COMPANY_REGISTRATION_DETAILS = mergedProps.id ?? "companyRegistrationDetails";
|
|
10268
10237
|
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;
|
|
10238
|
+
const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation", "vatNumber"].includes(field));
|
|
10239
|
+
const legalCompanyName2 = companyNameAndCountry == null ? void 0 : companyNameAndCountry.legalCompanyName;
|
|
10274
10240
|
const isSameNameAsLegalName = !mergedProps.data.tradingName ? true : mergedProps.data.tradingName === legalCompanyName2;
|
|
10275
10241
|
const {
|
|
10276
10242
|
handleChangeFor,
|
|
@@ -10283,7 +10249,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10283
10249
|
setData
|
|
10284
10250
|
} = useForm({
|
|
10285
10251
|
...mergedProps,
|
|
10286
|
-
schema: directChildFields,
|
|
10252
|
+
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
10253
|
defaultData: {
|
|
10288
10254
|
...mergedProps.data,
|
|
10289
10255
|
sameNameAsLegalName: isSameNameAsLegalName,
|
|
@@ -10326,7 +10292,6 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10326
10292
|
setData("tradingName", tradingNameIsSameAsLegalName ? legalCompanyName2 : "");
|
|
10327
10293
|
};
|
|
10328
10294
|
const registrationNumberProps = getFieldProps(mergedProps, businessRegistrationNumberFields);
|
|
10329
|
-
const vatNumberProps = getFieldProps(mergedProps, vatNumberFields);
|
|
10330
10295
|
const taxIdProps = getFieldProps(mergedProps, taxIdFields);
|
|
10331
10296
|
const handleChange = ({
|
|
10332
10297
|
currentState,
|
|
@@ -10337,7 +10302,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10337
10302
|
let schema = requiredFields;
|
|
10338
10303
|
let hasSchemaChanged = false;
|
|
10339
10304
|
if (formUtils.isRequiredField("vatNumber")) {
|
|
10340
|
-
schema = currentData.exemptedFromVat ? schema.filter((child) => child !== "vatNumber") : schema.filter((child) => child !== "vatAbsenceReason");
|
|
10305
|
+
schema = currentData.exemptedFromVat ? schema.filter((child) => child !== "vatNumber") : schema.filter((child) => child !== "vatAbsenceReason" && child !== "exemptedFromVat");
|
|
10341
10306
|
hasSchemaChanged = true;
|
|
10342
10307
|
}
|
|
10343
10308
|
if (formUtils.isRequiredField("taxId") && currentData.exemptedFromTax) {
|
|
@@ -10451,10 +10416,22 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10451
10416
|
companyType: mergedProps.companyType,
|
|
10452
10417
|
country: mergedProps.country,
|
|
10453
10418
|
dataStoreId: COMPANY_REGISTRATION_DETAILS
|
|
10454
|
-
}), formUtils.isRequiredField("vatNumber") && jsx(
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
|
|
10419
|
+
}), formUtils.isRequiredField("vatNumber") && jsx(VatNumberField, {
|
|
10420
|
+
data: formUtils.getFieldData(data, VAT_NUMBER_FIELD),
|
|
10421
|
+
valid: formUtils.getFieldValid(valid, VAT_NUMBER_FIELD),
|
|
10422
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, VAT_NUMBER_FIELD),
|
|
10423
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
10424
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
10425
|
+
}),
|
|
10426
|
+
mask: formUtils.getMask("vatNumber"),
|
|
10427
|
+
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
10428
|
+
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
10429
|
+
readonly: formUtils.isReadOnly("vatNumber"),
|
|
10430
|
+
handleChangeFor,
|
|
10431
|
+
country: mergedProps.country,
|
|
10432
|
+
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
10433
|
+
vatNumberType,
|
|
10434
|
+
setVatNumberType
|
|
10458
10435
|
}), formUtils.isRequiredField("taxId") && jsx(TaxId, {
|
|
10459
10436
|
...taxIdProps,
|
|
10460
10437
|
dataStoreId: COMPANY_REGISTRATION_DETAILS,
|
|
@@ -14368,7 +14345,6 @@ const individualBaseMapping = {
|
|
|
14368
14345
|
"personalDetails.licenseCardNumber": "individual.identificationData.cardNumber",
|
|
14369
14346
|
"personalDetails.expiryDate": "individual.identificationData.expiryDate",
|
|
14370
14347
|
"personalDetails.nationality": "individual.nationality",
|
|
14371
|
-
"personalDetails.jobTitle": "individual.jobTitle",
|
|
14372
14348
|
"address.city": "individual.residentialAddress.city",
|
|
14373
14349
|
"address.country": "individual.residentialAddress.country",
|
|
14374
14350
|
"address.postalCode": "individual.residentialAddress.postalCode",
|
|
@@ -24232,107 +24208,6 @@ const defaultFieldConfig$1 = entriesOf(defaultFieldConfig$8).reduce((fieldConfig
|
|
|
24232
24208
|
};
|
|
24233
24209
|
}
|
|
24234
24210
|
}), {});
|
|
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
24211
|
const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
|
|
24337
24212
|
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
24213
|
function AdditionalInformationComponent({
|
|
@@ -24405,6 +24280,8 @@ function AdditionalInformationComponent({
|
|
|
24405
24280
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$7[country2], {
|
|
24406
24281
|
vatNumberType
|
|
24407
24282
|
}, defaultFieldMetadata$7), acc);
|
|
24283
|
+
case "vatAbsenceReason":
|
|
24284
|
+
return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
|
|
24408
24285
|
case "dateOfIncorporation":
|
|
24409
24286
|
return {
|
|
24410
24287
|
...acc,
|
|
@@ -25519,7 +25396,6 @@ const Modal = ({
|
|
|
25519
25396
|
size = "medium",
|
|
25520
25397
|
title,
|
|
25521
25398
|
isDismissible = true,
|
|
25522
|
-
isOpen = true,
|
|
25523
25399
|
onClose = noop,
|
|
25524
25400
|
role: role2 = "dialog"
|
|
25525
25401
|
}) => {
|
|
@@ -25527,10 +25403,10 @@ const Modal = ({
|
|
|
25527
25403
|
i18n
|
|
25528
25404
|
} = useI18nContext();
|
|
25529
25405
|
const closeModal = useCallback(() => {
|
|
25530
|
-
if (
|
|
25406
|
+
if (isDismissible) {
|
|
25531
25407
|
onClose();
|
|
25532
25408
|
}
|
|
25533
|
-
}, [isDismissible,
|
|
25409
|
+
}, [isDismissible, onClose]);
|
|
25534
25410
|
useEffect(() => {
|
|
25535
25411
|
const handleEscapeKey = ({
|
|
25536
25412
|
code: code2
|
|
@@ -25539,21 +25415,17 @@ const Modal = ({
|
|
|
25539
25415
|
closeModal();
|
|
25540
25416
|
}
|
|
25541
25417
|
};
|
|
25542
|
-
|
|
25543
|
-
|
|
25544
|
-
|
|
25545
|
-
} else {
|
|
25418
|
+
document.documentElement.classList.add("u-overflow-hidden");
|
|
25419
|
+
document.addEventListener("keydown", handleEscapeKey);
|
|
25420
|
+
return () => {
|
|
25546
25421
|
document.documentElement.classList.remove("u-overflow-hidden");
|
|
25547
25422
|
document.removeEventListener("keydown", handleEscapeKey);
|
|
25548
|
-
}
|
|
25549
|
-
|
|
25550
|
-
}, [closeModal, isDismissible, isOpen]);
|
|
25423
|
+
};
|
|
25424
|
+
}, [closeModal, isDismissible]);
|
|
25551
25425
|
return jsx("div", {
|
|
25552
|
-
className: cx("adyen-kyc-overlay",
|
|
25553
|
-
"adyen-kyc-overlay--visible": isOpen
|
|
25554
|
-
}),
|
|
25426
|
+
className: cx("adyen-kyc-overlay", "adyen-kyc-overlay--visible"),
|
|
25555
25427
|
role: "none",
|
|
25556
|
-
children:
|
|
25428
|
+
children: jsxs("div", {
|
|
25557
25429
|
className: cx(classNames == null ? void 0 : classNames.modal, "adyen-kyc-modal", {
|
|
25558
25430
|
"adyen-kyc-modal--small": size === "small",
|
|
25559
25431
|
"adyen-kyc-modal--large": size === "large"
|
|
@@ -27955,6 +27827,8 @@ function CompanyOtherDetails({
|
|
|
27955
27827
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$7[country2], {
|
|
27956
27828
|
vatNumberType
|
|
27957
27829
|
}, defaultFieldMetadata$7), acc);
|
|
27830
|
+
case "vatAbsenceReason":
|
|
27831
|
+
return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
|
|
27958
27832
|
default:
|
|
27959
27833
|
return acc;
|
|
27960
27834
|
}
|
|
@@ -38160,7 +38034,7 @@ const ConfigurationApiProvider = ({
|
|
|
38160
38034
|
isEmbeddedDropin,
|
|
38161
38035
|
loadingContext
|
|
38162
38036
|
} = authContext;
|
|
38163
|
-
const sdkVersion = "2.47.
|
|
38037
|
+
const sdkVersion = "2.47.1";
|
|
38164
38038
|
useAnalytics({
|
|
38165
38039
|
onUserEvent,
|
|
38166
38040
|
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;
|
|
@@ -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
|
-
}
|