@adyen/kyc-components 3.21.1 → 3.21.3
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 +0 -1
- 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
|
@@ -8799,159 +8799,6 @@ function InputDate(props) {
|
|
|
8799
8799
|
maxLength: 10
|
|
8800
8800
|
});
|
|
8801
8801
|
}
|
|
8802
|
-
const STOCK_EXCHANGE_MIC_FIELD = ["stockExchangeMIC"];
|
|
8803
|
-
function StockExchangeMICField({
|
|
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: "stockExchangeMIC",
|
|
8817
|
-
label: labels2.stockExchangeMIC ?? "",
|
|
8818
|
-
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockExchangeMIC,
|
|
8819
|
-
placeholder: placeholders == null ? void 0 : placeholders.stockExchangeMIC,
|
|
8820
|
-
...mask,
|
|
8821
|
-
classNameModifiers: {
|
|
8822
|
-
field: ["stockExchangeMIC"],
|
|
8823
|
-
input: ["stockExchangeMIC"]
|
|
8824
|
-
},
|
|
8825
|
-
errorMessage: errors.stockExchangeMIC,
|
|
8826
|
-
isValid: valid.stockExchangeMIC ?? false,
|
|
8827
|
-
value: data.stockExchangeMIC ?? "",
|
|
8828
|
-
readonly,
|
|
8829
|
-
shouldValidate,
|
|
8830
|
-
onInput: handleChangeFor("stockExchangeMIC", "input"),
|
|
8831
|
-
onBlur: handleChangeFor("stockExchangeMIC", "blur"),
|
|
8832
|
-
"aria-required": true,
|
|
8833
|
-
"aria-label": labels2.stockExchangeMIC,
|
|
8834
|
-
"aria-invalid": !valid.stockExchangeMIC
|
|
8835
|
-
});
|
|
8836
|
-
}
|
|
8837
|
-
const stockExchangeMICFieldMetadata = {
|
|
8838
|
-
label: "stockExchangeMIC",
|
|
8839
|
-
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
|
|
8840
|
-
mask: {
|
|
8841
|
-
mask: makeMask(...alphanumericInputs(4)),
|
|
8842
|
-
transformOnType: uppercase
|
|
8843
|
-
},
|
|
8844
|
-
guidanceText: {
|
|
8845
|
-
key: "enterNCharactersForExample",
|
|
8846
|
-
values: {
|
|
8847
|
-
numChars: "4",
|
|
8848
|
-
example: "XNAS"
|
|
8849
|
-
}
|
|
8850
|
-
}
|
|
8851
|
-
};
|
|
8852
|
-
const STOCK_ISIN_FIELD = ["stockISIN"];
|
|
8853
|
-
function StockISINField({
|
|
8854
|
-
data,
|
|
8855
|
-
valid,
|
|
8856
|
-
errors,
|
|
8857
|
-
labels: labels2,
|
|
8858
|
-
placeholders,
|
|
8859
|
-
readonly,
|
|
8860
|
-
mask,
|
|
8861
|
-
guidanceText,
|
|
8862
|
-
shouldValidate,
|
|
8863
|
-
handleChangeFor
|
|
8864
|
-
}) {
|
|
8865
|
-
return jsx(MaskedInputText, {
|
|
8866
|
-
name: "stockISIN",
|
|
8867
|
-
label: labels2.stockISIN ?? "",
|
|
8868
|
-
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockISIN,
|
|
8869
|
-
placeholder: placeholders == null ? void 0 : placeholders.stockISIN,
|
|
8870
|
-
...mask,
|
|
8871
|
-
classNameModifiers: {
|
|
8872
|
-
field: ["stockISIN"],
|
|
8873
|
-
input: ["stockISIN"]
|
|
8874
|
-
},
|
|
8875
|
-
errorMessage: errors.stockISIN,
|
|
8876
|
-
isValid: valid.stockISIN ?? false,
|
|
8877
|
-
value: data.stockISIN ?? "",
|
|
8878
|
-
readonly,
|
|
8879
|
-
shouldValidate,
|
|
8880
|
-
onInput: handleChangeFor("stockISIN", "input"),
|
|
8881
|
-
onBlur: handleChangeFor("stockISIN", "blur"),
|
|
8882
|
-
"aria-required": true,
|
|
8883
|
-
"aria-label": labels2.stockISIN,
|
|
8884
|
-
"aria-invalid": !valid.stockISIN
|
|
8885
|
-
});
|
|
8886
|
-
}
|
|
8887
|
-
const stockISINFieldMetadata = {
|
|
8888
|
-
label: "stockISIN",
|
|
8889
|
-
validators: [validateNotEmptyOnBlur, {
|
|
8890
|
-
modes: ["blur"],
|
|
8891
|
-
validate: (value) => !!value && isISIN(value)
|
|
8892
|
-
}],
|
|
8893
|
-
mask: {
|
|
8894
|
-
mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
|
|
8895
|
-
transformOnType: uppercase
|
|
8896
|
-
},
|
|
8897
|
-
helperText: "stockISINHelper",
|
|
8898
|
-
guidanceText: {
|
|
8899
|
-
key: "validationPleaseEnterAValidStockISIN",
|
|
8900
|
-
values: {
|
|
8901
|
-
example: "NL0012969182"
|
|
8902
|
-
}
|
|
8903
|
-
}
|
|
8904
|
-
};
|
|
8905
|
-
const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
|
|
8906
|
-
function StockTickerSymbolField({
|
|
8907
|
-
data,
|
|
8908
|
-
valid,
|
|
8909
|
-
errors,
|
|
8910
|
-
labels: labels2,
|
|
8911
|
-
placeholders,
|
|
8912
|
-
readonly,
|
|
8913
|
-
mask,
|
|
8914
|
-
guidanceText,
|
|
8915
|
-
shouldValidate,
|
|
8916
|
-
handleChangeFor
|
|
8917
|
-
}) {
|
|
8918
|
-
return jsx(MaskedInputText, {
|
|
8919
|
-
name: "stockTickerSymbol",
|
|
8920
|
-
label: labels2.stockTickerSymbol ?? "",
|
|
8921
|
-
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
|
|
8922
|
-
placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
|
|
8923
|
-
...mask,
|
|
8924
|
-
classNameModifiers: {
|
|
8925
|
-
field: ["stockTickerSymbol"],
|
|
8926
|
-
input: ["stockTickerSymbol"]
|
|
8927
|
-
},
|
|
8928
|
-
errorMessage: errors.stockTickerSymbol,
|
|
8929
|
-
isValid: valid.stockTickerSymbol ?? false,
|
|
8930
|
-
value: data.stockTickerSymbol ?? "",
|
|
8931
|
-
readonly,
|
|
8932
|
-
shouldValidate,
|
|
8933
|
-
onInput: handleChangeFor("stockTickerSymbol", "input"),
|
|
8934
|
-
onBlur: handleChangeFor("stockTickerSymbol", "blur"),
|
|
8935
|
-
"aria-required": true,
|
|
8936
|
-
"aria-label": labels2.stockTickerSymbol,
|
|
8937
|
-
"aria-invalid": !valid.stockTickerSymbol
|
|
8938
|
-
});
|
|
8939
|
-
}
|
|
8940
|
-
const stockTickerSymbolFieldMetadata = {
|
|
8941
|
-
label: "stockTickerSymbol",
|
|
8942
|
-
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
|
|
8943
|
-
mask: {
|
|
8944
|
-
mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
|
|
8945
|
-
transformOnType: uppercase
|
|
8946
|
-
},
|
|
8947
|
-
guidanceText: {
|
|
8948
|
-
key: "enterAMaximumOfNCharactersForExample",
|
|
8949
|
-
values: {
|
|
8950
|
-
maxChars: "5",
|
|
8951
|
-
example: "ADYEN"
|
|
8952
|
-
}
|
|
8953
|
-
}
|
|
8954
|
-
};
|
|
8955
8802
|
const defaultFieldMetadata$8 = {
|
|
8956
8803
|
label: "taxId"
|
|
8957
8804
|
};
|
|
@@ -9251,6 +9098,9 @@ const defaultFieldConfig$8 = {
|
|
|
9251
9098
|
validators: validatePatternOnBlur(/^\d{12}$/)
|
|
9252
9099
|
}
|
|
9253
9100
|
};
|
|
9101
|
+
const vatAbsenceReasonMetadata = {
|
|
9102
|
+
validators: [validateNotEmptyOnBlur]
|
|
9103
|
+
};
|
|
9254
9104
|
const defaultFieldMetadata$7 = {
|
|
9255
9105
|
label: "vatNumber"
|
|
9256
9106
|
};
|
|
@@ -9898,6 +9748,159 @@ const inferTaxIdNumberType = (taxId2, country2, companyType2) => {
|
|
|
9898
9748
|
}
|
|
9899
9749
|
}
|
|
9900
9750
|
};
|
|
9751
|
+
const STOCK_EXCHANGE_MIC_FIELD = ["stockExchangeMIC"];
|
|
9752
|
+
function StockExchangeMICField({
|
|
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: "stockExchangeMIC",
|
|
9766
|
+
label: labels2.stockExchangeMIC ?? "",
|
|
9767
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockExchangeMIC,
|
|
9768
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockExchangeMIC,
|
|
9769
|
+
...mask,
|
|
9770
|
+
classNameModifiers: {
|
|
9771
|
+
field: ["stockExchangeMIC"],
|
|
9772
|
+
input: ["stockExchangeMIC"]
|
|
9773
|
+
},
|
|
9774
|
+
errorMessage: errors.stockExchangeMIC,
|
|
9775
|
+
isValid: valid.stockExchangeMIC ?? false,
|
|
9776
|
+
value: data.stockExchangeMIC ?? "",
|
|
9777
|
+
readonly,
|
|
9778
|
+
shouldValidate,
|
|
9779
|
+
onInput: handleChangeFor("stockExchangeMIC", "input"),
|
|
9780
|
+
onBlur: handleChangeFor("stockExchangeMIC", "blur"),
|
|
9781
|
+
"aria-required": true,
|
|
9782
|
+
"aria-label": labels2.stockExchangeMIC,
|
|
9783
|
+
"aria-invalid": !valid.stockExchangeMIC
|
|
9784
|
+
});
|
|
9785
|
+
}
|
|
9786
|
+
const stockExchangeMICFieldMetadata = {
|
|
9787
|
+
label: "stockExchangeMIC",
|
|
9788
|
+
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[a-zA-Z0-9]{4}$/)],
|
|
9789
|
+
mask: {
|
|
9790
|
+
mask: makeMask(...alphanumericInputs(4)),
|
|
9791
|
+
transformOnType: uppercase
|
|
9792
|
+
},
|
|
9793
|
+
guidanceText: {
|
|
9794
|
+
key: "enterNCharactersForExample",
|
|
9795
|
+
values: {
|
|
9796
|
+
numChars: "4",
|
|
9797
|
+
example: "XNAS"
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
};
|
|
9801
|
+
const STOCK_ISIN_FIELD = ["stockISIN"];
|
|
9802
|
+
function StockISINField({
|
|
9803
|
+
data,
|
|
9804
|
+
valid,
|
|
9805
|
+
errors,
|
|
9806
|
+
labels: labels2,
|
|
9807
|
+
placeholders,
|
|
9808
|
+
readonly,
|
|
9809
|
+
mask,
|
|
9810
|
+
guidanceText,
|
|
9811
|
+
shouldValidate,
|
|
9812
|
+
handleChangeFor
|
|
9813
|
+
}) {
|
|
9814
|
+
return jsx(MaskedInputText, {
|
|
9815
|
+
name: "stockISIN",
|
|
9816
|
+
label: labels2.stockISIN ?? "",
|
|
9817
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockISIN,
|
|
9818
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockISIN,
|
|
9819
|
+
...mask,
|
|
9820
|
+
classNameModifiers: {
|
|
9821
|
+
field: ["stockISIN"],
|
|
9822
|
+
input: ["stockISIN"]
|
|
9823
|
+
},
|
|
9824
|
+
errorMessage: errors.stockISIN,
|
|
9825
|
+
isValid: valid.stockISIN ?? false,
|
|
9826
|
+
value: data.stockISIN ?? "",
|
|
9827
|
+
readonly,
|
|
9828
|
+
shouldValidate,
|
|
9829
|
+
onInput: handleChangeFor("stockISIN", "input"),
|
|
9830
|
+
onBlur: handleChangeFor("stockISIN", "blur"),
|
|
9831
|
+
"aria-required": true,
|
|
9832
|
+
"aria-label": labels2.stockISIN,
|
|
9833
|
+
"aria-invalid": !valid.stockISIN
|
|
9834
|
+
});
|
|
9835
|
+
}
|
|
9836
|
+
const stockISINFieldMetadata = {
|
|
9837
|
+
label: "stockISIN",
|
|
9838
|
+
validators: [validateNotEmptyOnBlur, {
|
|
9839
|
+
modes: ["blur"],
|
|
9840
|
+
validate: (value) => !!value && isISIN(value)
|
|
9841
|
+
}],
|
|
9842
|
+
mask: {
|
|
9843
|
+
mask: makeMask(...alphaInputs(2), ...alphanumericInputs(9), ...numericInputs(1)),
|
|
9844
|
+
transformOnType: uppercase
|
|
9845
|
+
},
|
|
9846
|
+
helperText: "stockISINHelper",
|
|
9847
|
+
guidanceText: {
|
|
9848
|
+
key: "validationPleaseEnterAValidStockISIN",
|
|
9849
|
+
values: {
|
|
9850
|
+
example: "NL0012969182"
|
|
9851
|
+
}
|
|
9852
|
+
}
|
|
9853
|
+
};
|
|
9854
|
+
const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
|
|
9855
|
+
function StockTickerSymbolField({
|
|
9856
|
+
data,
|
|
9857
|
+
valid,
|
|
9858
|
+
errors,
|
|
9859
|
+
labels: labels2,
|
|
9860
|
+
placeholders,
|
|
9861
|
+
readonly,
|
|
9862
|
+
mask,
|
|
9863
|
+
guidanceText,
|
|
9864
|
+
shouldValidate,
|
|
9865
|
+
handleChangeFor
|
|
9866
|
+
}) {
|
|
9867
|
+
return jsx(MaskedInputText, {
|
|
9868
|
+
name: "stockTickerSymbol",
|
|
9869
|
+
label: labels2.stockTickerSymbol ?? "",
|
|
9870
|
+
formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
|
|
9871
|
+
placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
|
|
9872
|
+
...mask,
|
|
9873
|
+
classNameModifiers: {
|
|
9874
|
+
field: ["stockTickerSymbol"],
|
|
9875
|
+
input: ["stockTickerSymbol"]
|
|
9876
|
+
},
|
|
9877
|
+
errorMessage: errors.stockTickerSymbol,
|
|
9878
|
+
isValid: valid.stockTickerSymbol ?? false,
|
|
9879
|
+
value: data.stockTickerSymbol ?? "",
|
|
9880
|
+
readonly,
|
|
9881
|
+
shouldValidate,
|
|
9882
|
+
onInput: handleChangeFor("stockTickerSymbol", "input"),
|
|
9883
|
+
onBlur: handleChangeFor("stockTickerSymbol", "blur"),
|
|
9884
|
+
"aria-required": true,
|
|
9885
|
+
"aria-label": labels2.stockTickerSymbol,
|
|
9886
|
+
"aria-invalid": !valid.stockTickerSymbol
|
|
9887
|
+
});
|
|
9888
|
+
}
|
|
9889
|
+
const stockTickerSymbolFieldMetadata = {
|
|
9890
|
+
label: "stockTickerSymbol",
|
|
9891
|
+
validators: [validateNotEmptyOnBlur, validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
|
|
9892
|
+
mask: {
|
|
9893
|
+
mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
|
|
9894
|
+
transformOnType: uppercase
|
|
9895
|
+
},
|
|
9896
|
+
guidanceText: {
|
|
9897
|
+
key: "enterAMaximumOfNCharactersForExample",
|
|
9898
|
+
values: {
|
|
9899
|
+
maxChars: "5",
|
|
9900
|
+
example: "ADYEN"
|
|
9901
|
+
}
|
|
9902
|
+
}
|
|
9903
|
+
};
|
|
9901
9904
|
function TaxIdNumberTypeSelector({
|
|
9902
9905
|
country: country2,
|
|
9903
9906
|
companyType: companyType2,
|
|
@@ -10121,16 +10124,24 @@ const vatAbsenceReasons = [
|
|
|
10121
10124
|
"belowTaxThreshold"
|
|
10122
10125
|
/* BelowTaxThreshold */
|
|
10123
10126
|
];
|
|
10124
|
-
const
|
|
10125
|
-
function
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10127
|
+
const VAT_NUMBER_FIELD = ["vatNumber", "exemptedFromVat", "vatAbsenceReason"];
|
|
10128
|
+
function VatNumberField({
|
|
10129
|
+
data,
|
|
10130
|
+
valid,
|
|
10131
|
+
errors,
|
|
10132
|
+
labels: labels2,
|
|
10133
|
+
mask,
|
|
10134
|
+
guidanceText,
|
|
10135
|
+
placeholders,
|
|
10136
|
+
readonly,
|
|
10137
|
+
shouldValidate,
|
|
10138
|
+
handleChangeFor,
|
|
10139
|
+
canExempt,
|
|
10140
|
+
country: country2,
|
|
10141
|
+
vatNumberType,
|
|
10142
|
+
setVatNumberType
|
|
10143
|
+
}) {
|
|
10144
|
+
var _a;
|
|
10134
10145
|
const {
|
|
10135
10146
|
isExperimentEnabled
|
|
10136
10147
|
} = useExperimentsContext();
|
|
@@ -10142,115 +10153,64 @@ function VatNumber(props) {
|
|
|
10142
10153
|
id: VatAbsenceReason.CountryWithoutVatOrGstSystem,
|
|
10143
10154
|
name: VatAbsenceReason.CountryWithoutVatOrGstSystem
|
|
10144
10155
|
}]);
|
|
10145
|
-
const
|
|
10146
|
-
const
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
vatNumberType: taxIdNumberType
|
|
10150
|
-
}, defaultFieldMetadata$7);
|
|
10151
|
-
const mergedProps = mergeFieldMetadataIntoProps("vatNumber", metadata, props);
|
|
10152
|
-
const {
|
|
10153
|
-
i18n
|
|
10154
|
-
} = useI18nContext();
|
|
10155
|
-
const formUtils = formUtilities(mergedProps, i18n);
|
|
10156
|
-
const stateRef = useRef({
|
|
10157
|
-
setState: null
|
|
10158
|
-
});
|
|
10159
|
-
const {
|
|
10160
|
-
handleChangeFor,
|
|
10161
|
-
data,
|
|
10162
|
-
valid,
|
|
10163
|
-
errors,
|
|
10164
|
-
isValid,
|
|
10165
|
-
fieldProblems
|
|
10166
|
-
} = useForm({
|
|
10167
|
-
...mergedProps,
|
|
10168
|
-
schema: (data2) => data2.exemptedFromVat ? ["vatAbsenceReason", "exemptedFromVat"] : ["vatNumber", "exemptedFromVat"],
|
|
10169
|
-
rules: mergedProps.validators,
|
|
10170
|
-
defaultData: {
|
|
10171
|
-
...propData,
|
|
10172
|
-
exemptedFromVat: !!(propData == null ? void 0 : propData.exemptedFromVat)
|
|
10173
|
-
},
|
|
10174
|
-
// exemptedFromVat should be a boolean
|
|
10175
|
-
fieldProblems: fieldValidationErrors
|
|
10176
|
-
});
|
|
10177
|
-
useEffect(() => {
|
|
10178
|
-
if (data.vatNumber || taxIdNumberType) {
|
|
10179
|
-
handleChangeFor("vatNumber", "blur")(data.vatNumber);
|
|
10180
|
-
}
|
|
10181
|
-
}, [taxIdNumberType, country2]);
|
|
10182
|
-
useEffect(() => {
|
|
10183
|
-
var _a2, _b2;
|
|
10184
|
-
(_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b2.call(_a2, {
|
|
10185
|
-
type: "addToState",
|
|
10186
|
-
value: {
|
|
10187
|
-
data,
|
|
10188
|
-
valid,
|
|
10189
|
-
errors,
|
|
10190
|
-
caller: "vatNumber",
|
|
10191
|
-
dataStoreId
|
|
10192
|
-
}
|
|
10193
|
-
});
|
|
10194
|
-
}, [data, valid, errors, isValid]);
|
|
10195
|
-
if (!formUtils.isRequiredField("vatNumber")) return null;
|
|
10196
|
-
const exemptionIsPossible = ((_b = mergedProps.requiredFields) == null ? void 0 : _b.includes("exemptedFromVat")) ?? false;
|
|
10197
|
-
const showTaxIdExemptedOption = exemptionIsPossible && ((_c = taxIdNumberOptions[country2]) == null ? void 0 : _c.length) > 1;
|
|
10198
|
-
const handleTaxIdNumberTypeChange = (taxIdType) => {
|
|
10199
|
-
if (taxIdType === "exempted") {
|
|
10200
|
-
if (!exemptionIsPossible) {
|
|
10156
|
+
const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
|
|
10157
|
+
const handleVatNumberTypeChange = (vatType) => {
|
|
10158
|
+
if (vatType === "exempted") {
|
|
10159
|
+
if (!canExempt) {
|
|
10201
10160
|
throw Error(`${country2} does not allow VAT exemptions`);
|
|
10202
10161
|
}
|
|
10203
10162
|
handleChangeFor("exemptedFromVat")(true);
|
|
10204
|
-
|
|
10163
|
+
setVatNumberType(void 0);
|
|
10205
10164
|
return;
|
|
10206
10165
|
}
|
|
10207
|
-
if (
|
|
10166
|
+
if (canExempt && data.exemptedFromVat === true) {
|
|
10208
10167
|
handleChangeFor("exemptedFromVat")(false);
|
|
10209
10168
|
}
|
|
10210
|
-
|
|
10169
|
+
setVatNumberType(vatType);
|
|
10211
10170
|
};
|
|
10212
10171
|
return jsxs("div", {
|
|
10213
|
-
className: "adyen-kyc-
|
|
10214
|
-
children: [jsx(
|
|
10215
|
-
stateRef
|
|
10216
|
-
}), jsx(TaxIdNumberTypeSelector, {
|
|
10172
|
+
className: "adyen-kyc-field__vat-number",
|
|
10173
|
+
children: [jsx(TaxIdNumberTypeSelector, {
|
|
10217
10174
|
country: country2,
|
|
10218
|
-
setSelected:
|
|
10219
|
-
selected: data.exemptedFromVat ? "exempted" :
|
|
10220
|
-
exemptedOption:
|
|
10175
|
+
setSelected: handleVatNumberTypeChange,
|
|
10176
|
+
selected: data.exemptedFromVat ? "exempted" : vatNumberType,
|
|
10177
|
+
exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
|
|
10221
10178
|
}), jsx(MaskedInputText, {
|
|
10222
|
-
|
|
10223
|
-
label:
|
|
10224
|
-
|
|
10225
|
-
...formUtils.getMask("vatNumber"),
|
|
10179
|
+
"aria-required": true,
|
|
10180
|
+
"aria-label": labels2.vatNumber,
|
|
10181
|
+
"aria-invalid": !valid.vatNumber,
|
|
10226
10182
|
classNameModifiers: {
|
|
10227
10183
|
field: ["tax-id"],
|
|
10228
10184
|
input: ["vatNumber"]
|
|
10229
10185
|
},
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10186
|
+
name: "vatNumber",
|
|
10187
|
+
value: (data == null ? void 0 : data.vatNumber) ?? "",
|
|
10188
|
+
label: labels2.vatNumber ?? "",
|
|
10189
|
+
formatGuidance: (guidanceText == null ? void 0 : guidanceText.vatNumber) ?? "",
|
|
10190
|
+
placeholder: placeholders == null ? void 0 : placeholders.vatNumber,
|
|
10191
|
+
errorMessage: errors.vatNumber,
|
|
10192
|
+
isValid: Boolean(valid.vatNumber),
|
|
10235
10193
|
onInput: handleChangeFor("vatNumber", "input"),
|
|
10236
10194
|
onBlur: handleChangeFor("vatNumber", "blur"),
|
|
10237
|
-
disabled: data.exemptedFromVat
|
|
10238
|
-
|
|
10195
|
+
disabled: data.exemptedFromVat,
|
|
10196
|
+
readonly,
|
|
10197
|
+
shouldValidate,
|
|
10198
|
+
...mask
|
|
10199
|
+
}), canExempt && !showVatExemptedOption && jsx(Checkbox, {
|
|
10200
|
+
"aria-required": false,
|
|
10201
|
+
"aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
10202
|
+
"aria-invalid": false,
|
|
10239
10203
|
name: "exemptedFromVat",
|
|
10240
|
-
label:
|
|
10204
|
+
label: labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
10241
10205
|
value: "exemptedFromVat",
|
|
10242
|
-
readonly: formUtils.isReadOnly("exemptedFromVat"),
|
|
10243
10206
|
classNameModifiers: ["exempted-from-tax"],
|
|
10244
10207
|
checked: data.exemptedFromVat ?? false,
|
|
10245
|
-
onChange: handleChangeFor("exemptedFromVat")
|
|
10246
|
-
|
|
10247
|
-
"aria-label": formUtils.getLabel("exemptedFromVat"),
|
|
10248
|
-
"aria-invalid": false
|
|
10249
|
-
}), data.exemptedFromVat ? jsx(Field, {
|
|
10208
|
+
onChange: handleChangeFor("exemptedFromVat")
|
|
10209
|
+
}), data.exemptedFromVat && jsx(Field, {
|
|
10250
10210
|
name: "vatAbsenceReason",
|
|
10251
10211
|
classNameModifiers: ["tax-id-absence-reason"],
|
|
10252
|
-
label:
|
|
10253
|
-
errorMessage:
|
|
10212
|
+
label: labels2 == null ? void 0 : labels2.vatAbsenceReason,
|
|
10213
|
+
errorMessage: errors.vatAbsenceReason,
|
|
10254
10214
|
isValid: valid.vatAbsenceReason,
|
|
10255
10215
|
children: (childProps) => jsx(RadioGroup, {
|
|
10256
10216
|
...childProps,
|
|
@@ -10262,7 +10222,7 @@ function VatNumber(props) {
|
|
|
10262
10222
|
name: reason
|
|
10263
10223
|
}))
|
|
10264
10224
|
})
|
|
10265
|
-
})
|
|
10225
|
+
})]
|
|
10266
10226
|
});
|
|
10267
10227
|
}
|
|
10268
10228
|
const companyRegistrationDetailsValidationRules = {
|
|
@@ -10300,27 +10260,33 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
|
|
|
10300
10260
|
companyType: [CompanyTypesValue.SOLE_PROPRIETORSHIP],
|
|
10301
10261
|
country: CountryCodes.PuertoRico
|
|
10302
10262
|
}];
|
|
10303
|
-
const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...
|
|
10263
|
+
const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...VAT_NUMBER_FIELD, ...taxIdFields, "dateOfIncorporation"];
|
|
10304
10264
|
function CompanyRegistrationDetailsComponent(props) {
|
|
10305
|
-
var _a, _b;
|
|
10265
|
+
var _a, _b, _c;
|
|
10306
10266
|
const {
|
|
10307
10267
|
i18n
|
|
10308
10268
|
} = useI18nContext();
|
|
10269
|
+
const {
|
|
10270
|
+
companyNameAndCountry
|
|
10271
|
+
} = useGlobalData();
|
|
10309
10272
|
let mergedProps = props;
|
|
10273
|
+
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;
|
|
10274
|
+
const [vatNumberType, setVatNumberType] = useState(defaultVatNumberType);
|
|
10310
10275
|
mergedProps = mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, mergedProps);
|
|
10311
10276
|
mergedProps = mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, mergedProps);
|
|
10312
10277
|
mergedProps = mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, mergedProps);
|
|
10278
|
+
mergedProps = mergeFieldMetadataIntoProps("vatNumber", resolveFieldMetadata(defaultFieldConfig$7[mergedProps.country], {
|
|
10279
|
+
vatNumberType
|
|
10280
|
+
}, defaultFieldMetadata$7), mergedProps);
|
|
10281
|
+
mergedProps = mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, mergedProps);
|
|
10313
10282
|
const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === mergedProps.country && f.companyType.includes(mergedProps.companyType));
|
|
10314
10283
|
const stateRef = useRef({
|
|
10315
10284
|
setState: null
|
|
10316
10285
|
});
|
|
10317
|
-
const COMPANY_REGISTRATION_DETAILS = mergedProps.id;
|
|
10286
|
+
const COMPANY_REGISTRATION_DETAILS = mergedProps.id ?? "companyRegistrationDetails";
|
|
10318
10287
|
const requiredFields = mergedProps.requiredFields || companyRegistrationDetailsFields;
|
|
10319
|
-
const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
|
|
10320
|
-
const
|
|
10321
|
-
getData
|
|
10322
|
-
} = useStateContext();
|
|
10323
|
-
const legalCompanyName2 = (_b = (_a = getData()) == null ? void 0 : _a.companyNameAndCountry) == null ? void 0 : _b.legalCompanyName;
|
|
10288
|
+
const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation", "vatNumber"].includes(field));
|
|
10289
|
+
const legalCompanyName2 = companyNameAndCountry == null ? void 0 : companyNameAndCountry.legalCompanyName;
|
|
10324
10290
|
const isSameNameAsLegalName = !mergedProps.data.tradingName ? true : mergedProps.data.tradingName === legalCompanyName2;
|
|
10325
10291
|
const {
|
|
10326
10292
|
handleChangeFor,
|
|
@@ -10333,7 +10299,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10333
10299
|
setData
|
|
10334
10300
|
} = useForm({
|
|
10335
10301
|
...mergedProps,
|
|
10336
|
-
schema: directChildFields,
|
|
10302
|
+
schema: (currentData) => !currentData.exemptedFromVat ? (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatAbsenceReason")) ?? directChildFields : (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatNumber")) ?? directChildFields,
|
|
10337
10303
|
defaultData: {
|
|
10338
10304
|
...mergedProps.data,
|
|
10339
10305
|
sameNameAsLegalName: isSameNameAsLegalName,
|
|
@@ -10376,7 +10342,6 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10376
10342
|
setData("tradingName", tradingNameIsSameAsLegalName ? legalCompanyName2 : "");
|
|
10377
10343
|
};
|
|
10378
10344
|
const registrationNumberProps = getFieldProps(mergedProps, businessRegistrationNumberFields);
|
|
10379
|
-
const vatNumberProps = getFieldProps(mergedProps, vatNumberFields);
|
|
10380
10345
|
const taxIdProps = getFieldProps(mergedProps, taxIdFields);
|
|
10381
10346
|
const handleChange = ({
|
|
10382
10347
|
currentState,
|
|
@@ -10387,7 +10352,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10387
10352
|
let schema = requiredFields;
|
|
10388
10353
|
let hasSchemaChanged = false;
|
|
10389
10354
|
if (formUtils.isRequiredField("vatNumber")) {
|
|
10390
|
-
schema = currentData.exemptedFromVat ? schema.filter((child) => child !== "vatNumber") : schema.filter((child) => child !== "vatAbsenceReason");
|
|
10355
|
+
schema = currentData.exemptedFromVat ? schema.filter((child) => child !== "vatNumber") : schema.filter((child) => child !== "vatAbsenceReason" && child !== "exemptedFromVat");
|
|
10391
10356
|
hasSchemaChanged = true;
|
|
10392
10357
|
}
|
|
10393
10358
|
if (formUtils.isRequiredField("taxId") && currentData.exemptedFromTax) {
|
|
@@ -10501,10 +10466,22 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
10501
10466
|
companyType: mergedProps.companyType,
|
|
10502
10467
|
country: mergedProps.country,
|
|
10503
10468
|
dataStoreId: COMPANY_REGISTRATION_DETAILS
|
|
10504
|
-
}), formUtils.isRequiredField("vatNumber") && jsx(
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10469
|
+
}), formUtils.isRequiredField("vatNumber") && jsx(VatNumberField, {
|
|
10470
|
+
data: formUtils.getFieldData(data, VAT_NUMBER_FIELD),
|
|
10471
|
+
valid: formUtils.getFieldValid(valid, VAT_NUMBER_FIELD),
|
|
10472
|
+
errors: formUtils.getFieldErrors(errors, fieldProblems, VAT_NUMBER_FIELD),
|
|
10473
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
10474
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
10475
|
+
}),
|
|
10476
|
+
mask: formUtils.getMask("vatNumber"),
|
|
10477
|
+
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
10478
|
+
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
10479
|
+
readonly: formUtils.isReadOnly("vatNumber"),
|
|
10480
|
+
handleChangeFor,
|
|
10481
|
+
country: mergedProps.country,
|
|
10482
|
+
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
10483
|
+
vatNumberType,
|
|
10484
|
+
setVatNumberType
|
|
10508
10485
|
}), formUtils.isRequiredField("taxId") && jsx(TaxId, {
|
|
10509
10486
|
...taxIdProps,
|
|
10510
10487
|
dataStoreId: COMPANY_REGISTRATION_DETAILS,
|
|
@@ -14491,7 +14468,6 @@ const individualBaseMapping = {
|
|
|
14491
14468
|
"personalDetails.licenseCardNumber": "individual.identificationData.cardNumber",
|
|
14492
14469
|
"personalDetails.expiryDate": "individual.identificationData.expiryDate",
|
|
14493
14470
|
"personalDetails.nationality": "individual.nationality",
|
|
14494
|
-
"personalDetails.jobTitle": "individual.jobTitle",
|
|
14495
14471
|
"address.city": "individual.residentialAddress.city",
|
|
14496
14472
|
"address.country": "individual.residentialAddress.country",
|
|
14497
14473
|
"address.postalCode": "individual.residentialAddress.postalCode",
|
|
@@ -24474,107 +24450,6 @@ const defaultFieldConfig$1 = entriesOf(defaultFieldConfig$8).reduce((fieldConfig
|
|
|
24474
24450
|
};
|
|
24475
24451
|
}
|
|
24476
24452
|
}), {});
|
|
24477
|
-
const VAT_NUMBER_FIELD = ["vatNumber", "exemptedFromVat", "vatAbsenceReason"];
|
|
24478
|
-
function VatNumberField({
|
|
24479
|
-
data,
|
|
24480
|
-
valid,
|
|
24481
|
-
errors,
|
|
24482
|
-
labels: labels2,
|
|
24483
|
-
mask,
|
|
24484
|
-
guidanceText,
|
|
24485
|
-
placeholders,
|
|
24486
|
-
readonly,
|
|
24487
|
-
shouldValidate,
|
|
24488
|
-
handleChangeFor,
|
|
24489
|
-
canExempt,
|
|
24490
|
-
country: country2,
|
|
24491
|
-
vatNumberType,
|
|
24492
|
-
setVatNumberType
|
|
24493
|
-
}) {
|
|
24494
|
-
var _a;
|
|
24495
|
-
const {
|
|
24496
|
-
isExperimentEnabled
|
|
24497
|
-
} = useExperimentsContext();
|
|
24498
|
-
const showExtraTaxExemptionReasons = isExperimentEnabled(ExperimentNames.ShowExtraTaxExemptionReasons);
|
|
24499
|
-
const extraVatAbsenceReasons = vatAbsenceReasons.map((reason) => ({
|
|
24500
|
-
id: reason,
|
|
24501
|
-
name: reason
|
|
24502
|
-
})).concat([{
|
|
24503
|
-
id: VatAbsenceReason.CountryWithoutVatOrGstSystem,
|
|
24504
|
-
name: VatAbsenceReason.CountryWithoutVatOrGstSystem
|
|
24505
|
-
}]);
|
|
24506
|
-
const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
|
|
24507
|
-
const handleVatNumberTypeChange = (vatType) => {
|
|
24508
|
-
if (vatType === "exempted") {
|
|
24509
|
-
if (!canExempt) {
|
|
24510
|
-
throw Error(`${country2} does not allow VAT exemptions`);
|
|
24511
|
-
}
|
|
24512
|
-
handleChangeFor("exemptedFromVat")(true);
|
|
24513
|
-
setVatNumberType(void 0);
|
|
24514
|
-
return;
|
|
24515
|
-
}
|
|
24516
|
-
if (canExempt && data.exemptedFromVat === true) {
|
|
24517
|
-
handleChangeFor("exemptedFromVat")(false);
|
|
24518
|
-
}
|
|
24519
|
-
setVatNumberType(vatType);
|
|
24520
|
-
};
|
|
24521
|
-
return jsxs("div", {
|
|
24522
|
-
className: "adyen-kyc-field__vat-number",
|
|
24523
|
-
children: [jsx(TaxIdNumberTypeSelector, {
|
|
24524
|
-
country: country2,
|
|
24525
|
-
setSelected: handleVatNumberTypeChange,
|
|
24526
|
-
selected: data.exemptedFromVat ? "exempted" : vatNumberType,
|
|
24527
|
-
exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
|
|
24528
|
-
}), jsx(MaskedInputText, {
|
|
24529
|
-
"aria-required": true,
|
|
24530
|
-
"aria-label": labels2.vatNumber,
|
|
24531
|
-
"aria-invalid": !valid.vatNumber,
|
|
24532
|
-
classNameModifiers: {
|
|
24533
|
-
field: ["tax-id"],
|
|
24534
|
-
input: ["vatNumber"]
|
|
24535
|
-
},
|
|
24536
|
-
name: "vatNumber",
|
|
24537
|
-
value: (data == null ? void 0 : data.vatNumber) ?? "",
|
|
24538
|
-
label: labels2.vatNumber ?? "",
|
|
24539
|
-
formatGuidance: (guidanceText == null ? void 0 : guidanceText.vatNumber) ?? "",
|
|
24540
|
-
placeholder: placeholders == null ? void 0 : placeholders.vatNumber,
|
|
24541
|
-
errorMessage: errors.vatNumber,
|
|
24542
|
-
isValid: Boolean(valid.vatNumber),
|
|
24543
|
-
onInput: handleChangeFor("vatNumber", "input"),
|
|
24544
|
-
onBlur: handleChangeFor("vatNumber", "blur"),
|
|
24545
|
-
disabled: data.exemptedFromVat,
|
|
24546
|
-
readonly,
|
|
24547
|
-
shouldValidate,
|
|
24548
|
-
...mask
|
|
24549
|
-
}), canExempt && !showVatExemptedOption && jsx(Checkbox, {
|
|
24550
|
-
"aria-required": false,
|
|
24551
|
-
"aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
24552
|
-
"aria-invalid": false,
|
|
24553
|
-
name: "exemptedFromVat",
|
|
24554
|
-
label: labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
24555
|
-
value: "exemptedFromVat",
|
|
24556
|
-
classNameModifiers: ["exempted-from-tax"],
|
|
24557
|
-
checked: data.exemptedFromVat ?? false,
|
|
24558
|
-
onChange: handleChangeFor("exemptedFromVat")
|
|
24559
|
-
}), data.exemptedFromVat && jsx(Field, {
|
|
24560
|
-
name: "vatAbsenceReason",
|
|
24561
|
-
classNameModifiers: ["tax-id-absence-reason"],
|
|
24562
|
-
label: labels2 == null ? void 0 : labels2.vatAbsenceReason,
|
|
24563
|
-
errorMessage: errors.vatAbsenceReason,
|
|
24564
|
-
isValid: valid.vatAbsenceReason,
|
|
24565
|
-
children: (childProps) => jsx(RadioGroup, {
|
|
24566
|
-
...childProps,
|
|
24567
|
-
name: "vatAbsenceReason",
|
|
24568
|
-
onChange: handleChangeFor("vatAbsenceReason", "input"),
|
|
24569
|
-
value: data.vatAbsenceReason,
|
|
24570
|
-
items: showExtraTaxExemptionReasons ? extraVatAbsenceReasons : vatAbsenceReasons.map((reason) => ({
|
|
24571
|
-
id: reason,
|
|
24572
|
-
name: reason
|
|
24573
|
-
}))
|
|
24574
|
-
})
|
|
24575
|
-
})]
|
|
24576
|
-
});
|
|
24577
|
-
}
|
|
24578
24453
|
const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
|
|
24579
24454
|
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];
|
|
24580
24455
|
function AdditionalInformationComponent({
|
|
@@ -24647,6 +24522,8 @@ function AdditionalInformationComponent({
|
|
|
24647
24522
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$7[country2], {
|
|
24648
24523
|
vatNumberType
|
|
24649
24524
|
}, defaultFieldMetadata$7), acc);
|
|
24525
|
+
case "vatAbsenceReason":
|
|
24526
|
+
return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
|
|
24650
24527
|
case "dateOfIncorporation":
|
|
24651
24528
|
return {
|
|
24652
24529
|
...acc,
|
|
@@ -25761,7 +25638,6 @@ const Modal = ({
|
|
|
25761
25638
|
size = "medium",
|
|
25762
25639
|
title,
|
|
25763
25640
|
isDismissible = true,
|
|
25764
|
-
isOpen = true,
|
|
25765
25641
|
onClose = noop,
|
|
25766
25642
|
role: role2 = "dialog"
|
|
25767
25643
|
}) => {
|
|
@@ -25769,10 +25645,10 @@ const Modal = ({
|
|
|
25769
25645
|
i18n
|
|
25770
25646
|
} = useI18nContext();
|
|
25771
25647
|
const closeModal = useCallback(() => {
|
|
25772
|
-
if (
|
|
25648
|
+
if (isDismissible) {
|
|
25773
25649
|
onClose();
|
|
25774
25650
|
}
|
|
25775
|
-
}, [isDismissible,
|
|
25651
|
+
}, [isDismissible, onClose]);
|
|
25776
25652
|
useEffect(() => {
|
|
25777
25653
|
const handleEscapeKey = ({
|
|
25778
25654
|
code: code2
|
|
@@ -25781,21 +25657,17 @@ const Modal = ({
|
|
|
25781
25657
|
closeModal();
|
|
25782
25658
|
}
|
|
25783
25659
|
};
|
|
25784
|
-
|
|
25785
|
-
|
|
25786
|
-
|
|
25787
|
-
} else {
|
|
25660
|
+
document.documentElement.classList.add("u-overflow-hidden");
|
|
25661
|
+
document.addEventListener("keydown", handleEscapeKey);
|
|
25662
|
+
return () => {
|
|
25788
25663
|
document.documentElement.classList.remove("u-overflow-hidden");
|
|
25789
25664
|
document.removeEventListener("keydown", handleEscapeKey);
|
|
25790
|
-
}
|
|
25791
|
-
|
|
25792
|
-
}, [closeModal, isDismissible, isOpen]);
|
|
25665
|
+
};
|
|
25666
|
+
}, [closeModal, isDismissible]);
|
|
25793
25667
|
return jsx("div", {
|
|
25794
|
-
className: cx("adyen-kyc-overlay",
|
|
25795
|
-
"adyen-kyc-overlay--visible": isOpen
|
|
25796
|
-
}),
|
|
25668
|
+
className: cx("adyen-kyc-overlay", "adyen-kyc-overlay--visible"),
|
|
25797
25669
|
role: "none",
|
|
25798
|
-
children:
|
|
25670
|
+
children: jsxs("div", {
|
|
25799
25671
|
className: cx(classNames == null ? void 0 : classNames.modal, "adyen-kyc-modal", {
|
|
25800
25672
|
"adyen-kyc-modal--small": size === "small",
|
|
25801
25673
|
"adyen-kyc-modal--large": size === "large"
|
|
@@ -28197,6 +28069,8 @@ function CompanyOtherDetails({
|
|
|
28197
28069
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$7[country2], {
|
|
28198
28070
|
vatNumberType
|
|
28199
28071
|
}, defaultFieldMetadata$7), acc);
|
|
28072
|
+
case "vatAbsenceReason":
|
|
28073
|
+
return mergeFieldMetadataIntoProps("vatAbsenceReason", vatAbsenceReasonMetadata, acc);
|
|
28200
28074
|
default:
|
|
28201
28075
|
return acc;
|
|
28202
28076
|
}
|
|
@@ -39079,7 +38953,7 @@ const ConfigurationApiProvider = ({
|
|
|
39079
38953
|
isEmbeddedDropin,
|
|
39080
38954
|
loadingContext
|
|
39081
38955
|
} = authContext;
|
|
39082
|
-
const sdkVersion = "3.21.
|
|
38956
|
+
const sdkVersion = "3.21.3";
|
|
39083
38957
|
useAnalytics({
|
|
39084
38958
|
onUserEvent,
|
|
39085
38959
|
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 {};
|
|
@@ -33,7 +33,6 @@ export declare const individualComponentsKeyMapping: {
|
|
|
33
33
|
'personalDetails.licenseCardNumber': string;
|
|
34
34
|
'personalDetails.expiryDate': string;
|
|
35
35
|
'personalDetails.nationality': string;
|
|
36
|
-
'personalDetails.jobTitle': string;
|
|
37
36
|
'address.city': string;
|
|
38
37
|
'address.country': string;
|
|
39
38
|
'address.postalCode': 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
|
-
}
|