@adyen/kyc-components 2.23.0 → 2.24.0
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 +10486 -6906
- package/dist/style.css +8581 -1008
- package/dist/types/components/BusinessTypeSelection/BusinessTypeSelection.d.ts +1 -1
- package/dist/types/components/BusinessTypeSelection/types.d.ts +4 -0
- package/dist/types/components/BusinessTypeSelection/utils.d.ts +1 -1
- package/dist/types/components/Company/rules.d.ts +24 -1
- package/dist/types/components/CompanyBasics/component/CompanyBasicsComponent.d.ts +8 -0
- package/dist/types/components/CompanyBasics/index.d.ts +1 -0
- package/dist/types/components/CompanyBasics/types.d.ts +9 -0
- package/dist/types/components/CompanyBasics/validate.d.ts +4 -0
- package/dist/types/components/CompanyLookup/CompanyLookupResultsHeader.d.ts +2 -0
- package/dist/types/components/CompanyLookup/CompanyLookupResultsList.d.ts +2 -0
- package/dist/types/components/CompanyLookup/LookupResult.d.ts +2 -0
- package/dist/types/components/CompanyLookup/component/CompanyLookupComponent.d.ts +5 -0
- package/dist/types/components/CompanyLookup/index.d.ts +1 -0
- package/dist/types/components/CompanyLookup/types.d.ts +60 -0
- package/dist/types/components/CompanyOtherDetails/component/CompanyOtherDetailsComponent.d.ts +8 -0
- package/dist/types/components/CompanyOtherDetails/index.d.ts +1 -0
- package/dist/types/components/CompanyOtherDetails/types.d.ts +17 -0
- package/dist/types/components/CompanyOtherDetails/validate.d.ts +7 -0
- package/dist/types/components/CompanyRegistrationDetails/component/labels.d.ts +6 -0
- package/dist/types/components/CompanySearch/component/CompanySearchComponent.d.ts +2 -0
- package/dist/types/components/CompanySearch/forms.d.ts +38 -0
- package/dist/types/components/CompanySearch/index.d.ts +1 -0
- package/dist/types/components/CompanySearch/types.d.ts +22 -0
- package/dist/types/components/CompanyStructure/component/CompanyStructureComponent.d.ts +8 -0
- package/dist/types/components/CompanyStructure/index.d.ts +1 -0
- package/dist/types/components/CompanyStructure/types.d.ts +7 -0
- package/dist/types/components/CompanyStructure/validate.d.ts +3 -0
- package/dist/types/components/Dropins/CompanySearchDropin/components/CompanySearchDropinComponent.d.ts +2 -0
- package/dist/types/components/Dropins/CompanySearchDropin/index.d.ts +1 -0
- package/dist/types/components/Dropins/CompanySearchDropin/types.d.ts +10 -0
- package/dist/types/components/Dropins/CompanySearchDropin/utils.d.ts +8 -0
- package/dist/types/components/Dropins/FormWrapper/FormWrapper.d.ts +1 -1
- package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/types.d.ts +2 -1
- package/dist/types/components/EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent.d.ts +2 -1
- package/dist/types/components/IdentityNumber/formats.d.ts +3 -0
- package/dist/types/components/IdentityNumber/type.d.ts +2 -0
- package/dist/types/components/IdentityNumber/validate.d.ts +2 -1
- package/dist/types/components/IdentityNumber/validate.helper.d.ts +2 -0
- package/dist/types/components/Individual/rules.d.ts +1 -0
- package/dist/types/components/PayoutDetails/types.d.ts +1 -2
- package/dist/types/components/PersonalDetails/component/labels.d.ts +4 -0
- package/dist/types/components/PersonalDetails/types.d.ts +4 -0
- package/dist/types/components/TaskList/types.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/internal/Address/components/SearchAddress.d.ts +1 -1
- package/dist/types/components/internal/Address/types.d.ts +3 -1
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumber/types.d.ts +2 -0
- package/dist/types/components/internal/BusinessRegistrationNumber/validate.d.ts +4 -4
- package/dist/types/components/internal/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +3 -0
- package/dist/types/components/internal/BusinessRegistrationNumberField/index.d.ts +1 -0
- package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +8 -0
- package/dist/types/components/internal/BusinessRegistrationNumberField/validate.d.ts +21 -0
- package/dist/types/components/internal/CountryField/types.d.ts +1 -1
- package/dist/types/components/internal/CountryField/validate.d.ts +3 -0
- package/dist/types/components/internal/DateOfIncorporationField/DateOfIncorporationField.d.ts +3 -0
- package/dist/types/components/internal/DateOfIncorporationField/index.d.ts +1 -0
- package/dist/types/components/internal/DateOfIncorporationField/types.d.ts +5 -0
- package/dist/types/components/internal/DateOfIncorporationField/validate.d.ts +3 -0
- package/dist/types/components/internal/FormFields/Field/Field.d.ts +2 -3
- package/dist/types/components/internal/FormFields/Field/types.d.ts +5 -2
- package/dist/types/components/internal/FormFields/InputBase.d.ts +1 -1
- package/dist/types/components/internal/FormFields/RadioGroupCard/RadioCard.d.ts +1 -1
- package/dist/types/components/internal/FormFields/RadioGroupCard/types.d.ts +4 -3
- package/dist/types/components/internal/Iban/ibanValidator.d.ts +3 -2
- package/dist/types/components/internal/IdFieldTypeSelector/IdFieldTypeSelector.d.ts +2 -0
- package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +5 -0
- package/dist/types/components/internal/IdFieldTypeSelector/types.d.ts +20 -0
- package/dist/types/components/internal/LegalCompanyNameField/types.d.ts +1 -1
- package/dist/types/components/internal/LegalCompanyNameField/validate.d.ts +3 -0
- package/dist/types/components/internal/StateField/types.d.ts +3 -1
- package/dist/types/components/internal/StateField/validate.d.ts +3 -0
- package/dist/types/components/internal/StockExchangeMICField/StockExchangeMICField.d.ts +3 -0
- package/dist/types/components/internal/StockExchangeMICField/index.d.ts +1 -0
- package/dist/types/components/internal/StockExchangeMICField/types.d.ts +5 -0
- package/dist/types/components/internal/StockExchangeMICField/validate.d.ts +3 -0
- package/dist/types/components/internal/StockISINField/StockISINField.d.ts +3 -0
- package/dist/types/components/internal/StockISINField/index.d.ts +1 -0
- package/dist/types/components/internal/StockISINField/types.d.ts +5 -0
- package/dist/types/components/internal/StockISINField/validate.d.ts +3 -0
- package/dist/types/components/internal/TaxId/rules.d.ts +2 -1
- package/dist/types/components/internal/TaxInformationField/TaxInformationField.d.ts +4 -0
- package/dist/types/components/internal/TaxInformationField/index.d.ts +1 -0
- package/dist/types/components/internal/TaxInformationField/types.d.ts +13 -0
- package/dist/types/components/internal/TaxInformationField/validate.d.ts +4 -0
- package/dist/types/components/internal/TradingNameField/TradingNameField.d.ts +3 -0
- package/dist/types/components/internal/TradingNameField/index.d.ts +1 -0
- package/dist/types/components/internal/TradingNameField/types.d.ts +8 -0
- package/dist/types/components/internal/TradingNameField/validate.d.ts +3 -0
- package/dist/types/components/internal/VatNumber/types.d.ts +2 -0
- package/dist/types/components/internal/VatNumber/validate.d.ts +2 -1
- package/dist/types/components/internal/VatNumber/vatNumberValidation.d.ts +5 -0
- package/dist/types/components/internal/VatNumberField/VatNumberField.d.ts +3 -0
- package/dist/types/components/internal/VatNumberField/index.d.ts +1 -0
- package/dist/types/components/internal/VatNumberField/types.d.ts +11 -0
- package/dist/types/components/internal/VatNumberField/validate.d.ts +4 -0
- package/dist/types/core/Context/ExperimentContext/types.d.ts +3 -1
- package/dist/types/core/Context/StateContext/types.d.ts +3 -2
- package/dist/types/core/Context/StateContext/useGlobalData.d.ts +7 -5
- package/dist/types/core/SDKValidation/index.d.ts +1 -1
- package/dist/types/core/Services/componentApi/get-bankVerification-vendor.d.ts +1 -1
- package/dist/types/core/constants.d.ts +1 -0
- package/dist/types/core/core.d.ts +1 -1
- package/dist/types/core/hooks/types.d.ts +1 -0
- package/dist/types/core/hooks/useBankConfigurationHandlers.d.ts +1 -1
- package/dist/types/core/hooks/useCompanySearch/index.d.ts +1 -0
- package/dist/types/core/hooks/useCompanySearch/types.d.ts +41 -0
- package/dist/types/core/hooks/useCompanySearch/useCompanySearch.d.ts +5 -0
- package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +32 -0
- package/dist/types/core/hooks/useForm/types.d.ts +10 -2
- package/dist/types/core/hooks/useIsElementVisible.d.ts +1 -0
- package/dist/types/core/hooks/useScenarioConfiguration.d.ts +3 -1
- package/dist/types/core/models/api/organization.d.ts +1 -1
- package/dist/types/core/models/company.d.ts +7 -0
- package/dist/types/core/models/country-config.d.ts +4 -2
- package/dist/types/core/models/form.d.ts +1 -0
- package/dist/types/core/models/province-code.d.ts +47 -0
- package/dist/types/core/process-field-configurations.d.ts +4 -2
- package/dist/types/language/Language.d.ts +3 -5
- package/dist/types/language/config.d.ts +56 -4
- package/dist/types/language/types.d.ts +5 -0
- package/dist/types/utils/accountHolderUtils.d.ts +2 -0
- package/dist/types/utils/api/documentUtils.d.ts +3 -2
- package/dist/types/utils/api/processCapabilitites.d.ts +3 -2
- package/dist/types/utils/dropin-utils.d.ts +6 -6
- package/dist/types/utils/entity-status-util.d.ts +1 -1
- package/dist/types/utils/formUtils.d.ts +2 -1
- package/dist/types/utils/getFieldsWithExistingData.d.ts +2 -1
- package/dist/types/utils/mapping/companySearch/index.d.ts +3 -0
- package/dist/types/utils/mapping/companySearch/mapCompanyDataResponseToFormSchema.d.ts +3 -0
- package/dist/types/utils/mapping/companySearch/mapCompanySearchSchemaToLegalEntity.d.ts +5 -0
- package/dist/types/utils/mapping/companySearch/mapLegalEntityToCompanySearchSchema.d.ts +4 -0
- package/dist/types/utils/mapping/componentApiMapping.d.ts +39 -2
- package/dist/types/utils/masking/maskTypes.d.ts +15 -0
- package/dist/types/utils/regex/countryIdNumberPatterns.d.ts +2 -0
- package/dist/types/utils/regex/customRegistrationNumberPatterns.d.ts +2 -0
- package/dist/types/utils/regex/index.d.ts +1 -0
- package/dist/types/utils/regex/types.d.ts +11 -2
- package/dist/types/utils/regex/vatNumberPatterns.d.ts +2 -1
- package/dist/types/utils/useForwardRef.d.ts +2 -1
- package/dist/types/utils/validation/types.d.ts +8 -12
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CompanyTypesValue } from '../../core/models/api/company-types-value';
|
|
2
2
|
import type { TrustTypes } from '../../core/models/api/trust-types-value';
|
|
3
3
|
import type { CountryCode } from '../../core/models/country-code';
|
|
4
|
+
import { TranslationKey } from '../../language/types';
|
|
4
5
|
/**
|
|
5
6
|
* @property (regex)- The expression that will trigger the feedback message
|
|
6
7
|
* @property (format) - The translation key associated to the regex, defaults to using the string entered in this field if no translation exists
|
|
@@ -13,18 +14,26 @@ import type { CountryCode } from '../../core/models/country-code';
|
|
|
13
14
|
* { regex: /^[a-zA-Z0-9]{1,9}$/, format: 'XtoYcharacters', values: { x: 1, y: 9 } }
|
|
14
15
|
*/
|
|
15
16
|
export interface RegexValidationOptions {
|
|
16
|
-
regex: RegExp;
|
|
17
17
|
format?: string;
|
|
18
18
|
message?: string;
|
|
19
|
+
regex: RegExp;
|
|
19
20
|
replaceChars?: string;
|
|
20
21
|
values?: Record<string, string | number>;
|
|
21
22
|
}
|
|
23
|
+
export type DefaultValidation = {
|
|
24
|
+
default: RegexValidationOptions;
|
|
25
|
+
};
|
|
26
|
+
export type CustomValidation = Partial<Record<TranslationKey | 'default', RegexValidationOptions>>;
|
|
22
27
|
export type CountryRegexValidation = Partial<Record<CountryCode, RegexValidationOptions | RegexValidationOptions[]>>;
|
|
28
|
+
export type CountryRegexValidationPerType = Partial<Record<CountryCode, Partial<Record<TranslationKey, RegexValidationOptions | RegexValidationOptions[]>>>>;
|
|
23
29
|
export type CompanyTypeValidation = Partial<Record<CompanyTypesValue, RegexValidationOptions | RegexValidationOptions[]>> & {
|
|
24
30
|
default: RegexValidationOptions;
|
|
25
31
|
};
|
|
32
|
+
export type CustomCompanyTypeValidation = Partial<Record<CompanyTypesValue, CustomValidation>>;
|
|
26
33
|
export type TrustTypeValidation = Partial<Record<TrustTypes, RegexValidationOptions | RegexValidationOptions[]>> & {
|
|
27
34
|
default: RegexValidationOptions;
|
|
28
35
|
};
|
|
29
36
|
export type CountryAndCompanyRegexValidation = Partial<Record<CountryCode, CompanyTypeValidation>>;
|
|
30
37
|
export type CountryAndTrustTypesRegexValidation = Partial<Record<CountryCode, TrustTypeValidation>>;
|
|
38
|
+
export type CountryAndCustomRegexValidation = Partial<Record<CountryCode, CustomValidation & CustomCompanyTypeValidation>>;
|
|
39
|
+
export type CountryCustomIdNumberValidation = Partial<Record<CountryCode, Partial<Record<TranslationKey, RegExp>>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CountryRegexValidation } from './types';
|
|
1
|
+
import type { CountryRegexValidation, CountryRegexValidationPerType } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Countries which follow the [countryCode][something] format
|
|
4
4
|
*
|
|
@@ -15,3 +15,4 @@ export declare const vatSpecsPerCountry: CountryRegexValidation;
|
|
|
15
15
|
* Greece (GR or EL) - EL123456789
|
|
16
16
|
*/
|
|
17
17
|
export declare const nonVatSpecsPerCountry: CountryRegexValidation;
|
|
18
|
+
export declare const customSpecsPerVatNumberType: CountryRegexValidationPerType;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { ForwardedRef } from 'preact/compat';
|
|
2
|
-
|
|
2
|
+
import { MutableRef } from 'preact/hooks';
|
|
3
|
+
export declare const useForwardedRef: <T>(forwardedRef: ForwardedRef<T>) => MutableRef<T>;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { FormState } from '../../core/hooks/useForm
|
|
1
|
+
import { FormState } from '../../core/hooks/useForm';
|
|
2
2
|
import { CountryCode } from '../../core/models/country-code';
|
|
3
|
-
import { TranslationKey } from '../../language/types';
|
|
3
|
+
import { Translatable, TranslationKey } from '../../language/types';
|
|
4
4
|
export type Ruleset = {
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
};
|
|
7
7
|
export type CountryRuleset = {
|
|
8
8
|
[country: string]: Ruleset;
|
|
9
9
|
};
|
|
10
|
-
export type ErrorMessageObject = {
|
|
11
|
-
translationKey: TranslationKey;
|
|
12
|
-
translationObject: {
|
|
13
|
-
values: Record<string, string>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export type ErrorMessage = TranslationKey | ErrorMessageObject;
|
|
17
10
|
export type ValidatorMode = 'blur' | 'input';
|
|
18
11
|
export interface FieldData<FormSchema> {
|
|
19
12
|
key: keyof FormSchema;
|
|
@@ -34,18 +27,18 @@ export type FormatRules<FormSchema> = Partial<{
|
|
|
34
27
|
export type CountryFormatRules<FormSchema> = Partial<Record<CountryCode, FormatRules<FormSchema>>>;
|
|
35
28
|
export interface ValidationRuleResult {
|
|
36
29
|
isValid: boolean;
|
|
37
|
-
errorMessage?:
|
|
30
|
+
errorMessage?: Translatable;
|
|
38
31
|
hasError: boolean;
|
|
39
32
|
}
|
|
40
33
|
export type ValidationRuleResults<Schema> = Partial<Record<keyof Schema, ValidationRuleResult | null>>;
|
|
41
34
|
export interface ValidatorRule<ValueType, FormSchema> {
|
|
42
35
|
validate: (value: ValueType | null, context?: FieldContext<FormSchema>) => boolean;
|
|
43
|
-
errorMessage?:
|
|
36
|
+
errorMessage?: Translatable | ((value: ValueType | null, context?: FieldContext<FormSchema>) => Translatable | undefined);
|
|
44
37
|
modes: readonly ValidatorMode[];
|
|
45
38
|
}
|
|
46
39
|
export interface AsyncValidatorRule<ValueType, FormSchema> {
|
|
47
40
|
asyncValidate: (value: ValueType | null, context?: FieldContext<FormSchema>) => Promise<boolean>;
|
|
48
|
-
errorMessage?:
|
|
41
|
+
errorMessage?: Translatable | ((value: ValueType | null, context: FieldContext<FormSchema>) => Translatable);
|
|
49
42
|
modes: readonly ValidatorMode[];
|
|
50
43
|
}
|
|
51
44
|
export type FieldValidatorRule<ValueType, FormSchema> = ValidatorRule<ValueType, FormSchema> | AsyncValidatorRule<ValueType, FormSchema>;
|
|
@@ -59,3 +52,6 @@ export type FieldValidatorRules<FormSchema> = ValidatorRules<FormSchema> | Async
|
|
|
59
52
|
export type CountryBasedValidatorRules<FormSchema> = {
|
|
60
53
|
[country: string]: ValidatorRules<FormSchema>;
|
|
61
54
|
};
|
|
55
|
+
export type CountryBasedCustomValidatorRules<FormSchema> = {
|
|
56
|
+
[country: string]: Partial<Record<TranslationKey, ValidatorRules<FormSchema>>>;
|
|
57
|
+
};
|