@adyen/kyc-components 2.0.0 → 2.1.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 +1413 -933
- package/dist/style.css +2 -1
- package/dist/types/components/DocumentUpload/types.d.ts +3 -3
- package/dist/types/components/Dropins/DropinLayout/ActionBar/ActionBar.d.ts +1 -1
- package/dist/types/components/Dropins/DropinLayout/ActionBar/type.d.ts +1 -0
- package/dist/types/components/Dropins/FormComposer/FormComposer.d.ts +1 -1
- package/dist/types/components/Dropins/FormComposer/components/FormNavigation/FormNavigationItem.d.ts +3 -0
- package/dist/types/components/Dropins/FormComposer/components/FormNavigation/types.d.ts +7 -11
- package/dist/types/components/Dropins/FormComposer/types.d.ts +2 -3
- package/dist/types/components/Dropins/FormWrapper/FormWrapper.d.ts +39 -0
- package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/PciDropin/validate.d.ts +1 -1
- package/dist/types/components/IdentityNumber/component/IdentityNumberComponent.d.ts +1 -1
- package/dist/types/components/Individual/component/IndividualComponent.d.ts +2 -2
- package/dist/types/components/Individual/types.d.ts +5 -4
- package/dist/types/components/PayoutVerificationMethod/allowedBankCountriesPerCountry.d.ts +1 -1
- package/dist/types/components/TaskList/component/TaskListItem.d.ts +1 -1
- package/dist/types/components/TaskList/types.d.ts +3 -1
- package/dist/types/components/internal/Address/types.d.ts +4 -5
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/Iban/ibanValidator.d.ts +1 -1
- package/dist/types/components/internal/PhoneInput/PhoneInput.d.ts +1 -1
- package/dist/types/components/internal/VatNumber/vatNumberValidation.d.ts +1 -1
- package/dist/types/core/Context/StateContext/hasDataChanged.d.ts +1 -0
- package/dist/types/core/Services/get-images.d.ts +1 -1
- package/dist/types/core/hooks/useAsyncValidator.d.ts +2 -2
- package/dist/types/core/hooks/useForm/reducer.d.ts +35 -3
- package/dist/types/core/hooks/useForm/types.d.ts +28 -73
- package/dist/types/core/hooks/useForm/useForm.d.ts +7 -7
- package/dist/types/core/hooks/useForm/utils.d.ts +2 -0
- package/dist/types/core/hooks/useFormComposer.d.ts +22 -0
- package/dist/types/core/hooks/useScenarioConfiguration.d.ts +5 -5
- package/dist/types/core/models/errors/entity-problems.d.ts +1 -1
- package/dist/types/core/models/form-rules.d.ts +2 -2
- package/dist/types/core/models/form.d.ts +5 -3
- package/dist/types/core/process-field-configurations.d.ts +11 -26
- package/dist/types/language/config.d.ts +5 -0
- package/dist/types/utils/decision-maker-roles.d.ts +1 -1
- package/dist/types/utils/dropin-utils.d.ts +18 -0
- package/dist/types/utils/entity-status-util.d.ts +2 -2
- package/dist/types/utils/entriesOf.d.ts +2 -0
- package/dist/types/utils/formUtils.d.ts +1 -1
- package/dist/types/utils/get-props.d.ts +2 -3
- package/dist/types/utils/getFieldsWithExistingData.d.ts +8 -0
- package/dist/types/utils/mapping/documentGuidanceMap.d.ts +1 -2
- package/dist/types/utils/mapping/mapping.d.ts +2 -1
- package/dist/types/utils/regex/countryIdNumberPatterns.d.ts +1 -1
- package/dist/types/utils/trackNavigation.d.ts +10 -0
- package/dist/types/utils/trust-util.d.ts +1 -1
- package/dist/types/utils/validation/ValidationResult.d.ts +1 -1
- package/dist/types/utils/validation/Validator.d.ts +4 -4
- package/dist/types/utils/validation/types.d.ts +19 -19
- package/dist/types/utils/validatorUtils.d.ts +2 -2
- package/package.json +1 -1
- package/dist/types/components/Dropins/FormComposer/components/FormNavigation/components/FormNavigationItem/FormNavigationItem.d.ts +0 -4
- package/dist/types/components/Dropins/FormComposer/components/FormNavigation/components/FormNavigationItem/index.d.ts +0 -1
- package/dist/types/core/models/errors/field-errors.d.ts +0 -4
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { FormState } from '../../core/hooks/useForm';
|
|
1
|
+
import { FormState } from '../../core/hooks/useForm/types';
|
|
2
2
|
import { CountryCode } from '../../core/models/country-code';
|
|
3
3
|
import { TranslationKey } from '../../language/types';
|
|
4
|
-
export type ErrorMessageObject = {
|
|
5
|
-
translationKey: TranslationKey;
|
|
6
|
-
translationObject: {
|
|
7
|
-
values: Record<string, string>;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
4
|
export type Ruleset = {
|
|
11
5
|
[key: string]: any;
|
|
12
6
|
};
|
|
13
7
|
export type CountryRuleset = {
|
|
14
8
|
[country: string]: Ruleset;
|
|
15
9
|
};
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export type ErrorMessageObject = {
|
|
11
|
+
translationKey: TranslationKey;
|
|
12
|
+
translationObject: {
|
|
13
|
+
values: Record<string, string>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type ErrorMessage = TranslationKey | ErrorMessageObject;
|
|
17
|
+
export type ValidatorMode = 'blur' | 'input';
|
|
18
|
+
export interface FieldData<FormSchema> {
|
|
19
|
+
key: keyof FormSchema;
|
|
20
|
+
value: FormSchema[keyof FormSchema] | null;
|
|
19
21
|
mode?: ValidatorMode;
|
|
20
22
|
}
|
|
21
23
|
export interface FieldContext<FormSchema> {
|
|
22
24
|
state: FormState<FormSchema>;
|
|
23
25
|
}
|
|
24
|
-
export type ErrorMessage = TranslationKey | ErrorMessageObject;
|
|
25
|
-
export type ValidatorMode = 'blur' | 'input';
|
|
26
26
|
export interface Format<ValueType> {
|
|
27
|
-
formatter?: (value: ValueType, context?: FieldContext<any>) => ValueType;
|
|
27
|
+
formatter?: (value: ValueType | null, context?: FieldContext<any>) => ValueType | null;
|
|
28
28
|
format?: string;
|
|
29
29
|
maxlength?: number;
|
|
30
30
|
}
|
|
@@ -37,20 +37,20 @@ export interface ValidationRuleResult {
|
|
|
37
37
|
errorMessage?: TranslationKey | ErrorMessageObject;
|
|
38
38
|
hasError: boolean;
|
|
39
39
|
}
|
|
40
|
-
export type ValidationRuleResults<Schema> = Partial<Record<keyof Schema, ValidationRuleResult>>;
|
|
40
|
+
export type ValidationRuleResults<Schema> = Partial<Record<keyof Schema, ValidationRuleResult | null>>;
|
|
41
41
|
export interface ValidatorRule<ValueType, FormSchema> {
|
|
42
|
-
validate: (value: ValueType, context?: FieldContext<FormSchema>) => boolean;
|
|
43
|
-
errorMessage?: ErrorMessage | ((value: ValueType, context?: FieldContext<FormSchema>) => ErrorMessage | undefined);
|
|
42
|
+
validate: (value: ValueType | null, context?: FieldContext<FormSchema>) => boolean;
|
|
43
|
+
errorMessage?: ErrorMessage | ((value: ValueType | null, context?: FieldContext<FormSchema>) => ErrorMessage | undefined);
|
|
44
44
|
modes: readonly ValidatorMode[];
|
|
45
45
|
}
|
|
46
46
|
export interface AsyncValidatorRule<ValueType, FormSchema> {
|
|
47
|
-
asyncValidate: (value: ValueType, context?: FieldContext<FormSchema>) => Promise<boolean>;
|
|
48
|
-
errorMessage?: ErrorMessage | ((value: ValueType, context: FieldContext<FormSchema>) => ErrorMessage);
|
|
47
|
+
asyncValidate: (value: ValueType | null, context?: FieldContext<FormSchema>) => Promise<boolean>;
|
|
48
|
+
errorMessage?: ErrorMessage | ((value: ValueType | null, context: FieldContext<FormSchema>) => ErrorMessage);
|
|
49
49
|
modes: readonly ValidatorMode[];
|
|
50
50
|
}
|
|
51
51
|
export type FieldValidatorRule<ValueType, FormSchema> = ValidatorRule<ValueType, FormSchema> | AsyncValidatorRule<ValueType, FormSchema>;
|
|
52
52
|
export type ValidatorRules<FormSchema> = Partial<{
|
|
53
|
-
[field in keyof FormSchema]: ValidatorRule<FormSchema[field], FormSchema> |
|
|
53
|
+
[field in keyof FormSchema]: ValidatorRule<FormSchema[field], FormSchema> | ValidatorRule<FormSchema[field], FormSchema>[];
|
|
54
54
|
}>;
|
|
55
55
|
export type AsyncValidatorRules<FormSchema> = Partial<{
|
|
56
56
|
[field in keyof FormSchema]: AsyncValidatorRule<FormSchema[field], FormSchema>;
|
|
@@ -22,6 +22,6 @@ export declare const getValidatingRegEx: (specChars: string, exclude: boolean) =
|
|
|
22
22
|
export declare const CHARACTER_PATTERNS: {
|
|
23
23
|
[key: string]: RegExp;
|
|
24
24
|
};
|
|
25
|
-
export declare const exactLength: (input: string, length: number) => boolean;
|
|
26
|
-
export declare const lengthIsBetween: (input: string | undefined, minLength: number, maxLength: number) => boolean;
|
|
25
|
+
export declare const exactLength: (input: string | undefined | null, length: number) => boolean;
|
|
26
|
+
export declare const lengthIsBetween: (input: string | undefined | null, minLength: number, maxLength: number) => boolean;
|
|
27
27
|
export declare const trimValWithOneSpace: (val: string) => string;
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import './FormNavigationItem.scss';
|
|
2
|
-
import { FormNavigationItemProps } from '../../types';
|
|
3
|
-
declare const FormNavigationItem: ({ trackNavigation, form, isActive, onClick, hasVerificationErrors, }: FormNavigationItemProps) => import("preact").JSX.Element;
|
|
4
|
-
export default FormNavigationItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './FormNavigationItem';
|