@adyen/adyen-web 5.5.0 → 5.6.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.
Files changed (37) hide show
  1. package/dist/adyen.css +2 -1
  2. package/dist/adyen.css.map +1 -1
  3. package/dist/adyen.js +1 -1
  4. package/dist/adyen.js.map +1 -1
  5. package/dist/cjs/adyen.css +2 -1
  6. package/dist/cjs/adyen.css.map +1 -1
  7. package/dist/cjs/index.js +1 -1
  8. package/dist/es/adyen.css +2 -1
  9. package/dist/es/adyen.css.map +1 -1
  10. package/dist/es/index.js +1 -1
  11. package/dist/es.modern/adyen.css +2 -1
  12. package/dist/es.modern/adyen.css.map +1 -1
  13. package/dist/es.modern/index.js +1 -1
  14. package/dist/types/components/Card/Bancontact.d.ts +6 -0
  15. package/dist/types/components/Card/Card.d.ts +6 -0
  16. package/dist/types/components/Card/components/CardInput/CardInput.d.ts +1 -0
  17. package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +1 -0
  18. package/dist/types/components/Card/components/CardInput/layouts.d.ts +9 -0
  19. package/dist/types/components/Card/components/CardInput/types.d.ts +39 -0
  20. package/dist/types/components/Card/components/CardInput/utils.d.ts +4 -0
  21. package/dist/types/components/Card/types.d.ts +1 -1
  22. package/dist/types/components/internal/Address/Specifications.d.ts +7 -1
  23. package/dist/types/components/internal/Address/types.d.ts +5 -6
  24. package/dist/types/components/internal/FormFields/Field/Field.d.ts +2 -1
  25. package/dist/types/components/internal/FormFields/Field/types.d.ts +1 -0
  26. package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
  27. package/dist/types/components/internal/FormFields/Select/types.d.ts +1 -0
  28. package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +3 -2
  29. package/dist/types/components/internal/SecuredFields/lib/core/AbstractSecuredField.d.ts +1 -0
  30. package/dist/types/components/internal/SecuredFields/lib/types.d.ts +1 -0
  31. package/dist/types/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +2 -1
  32. package/dist/types/core/Context/CoreContext.d.ts +2 -0
  33. package/dist/types/core/Context/CoreProvider.d.ts +4 -0
  34. package/dist/types/core/Context/useCoreContext.d.ts +1 -0
  35. package/dist/types/core/Errors/ErrorPanel.d.ts +14 -0
  36. package/dist/types/utils/Validator/Validator.d.ts +1 -1
  37. package/package.json +1 -1
@@ -5,6 +5,7 @@ declare class BancontactElement extends CardElement {
5
5
  protected static defaultProps: {
6
6
  brands: string[];
7
7
  onBinLookup: () => void;
8
+ SRConfig: {};
8
9
  };
9
10
  /**
10
11
  * Now that the Bancontact (BCMC) Card component can accept a number dual branded with Visa (which requires a CVC) it has to be handled differently
@@ -24,6 +25,11 @@ declare class BancontactElement extends CardElement {
24
25
  };
25
26
  brandsConfiguration: import("./types").CardBrandsConfiguration;
26
27
  icon: string;
28
+ SRConfig: {
29
+ collateErrors: any;
30
+ moveFocus: any;
31
+ showPanel: any;
32
+ };
27
33
  groupTypes: string[];
28
34
  holderNameRequired: boolean;
29
35
  hasCVC: boolean;
@@ -6,6 +6,7 @@ export declare class CardElement extends UIElement<CardElementProps> {
6
6
  static type: string;
7
7
  protected static defaultProps: {
8
8
  onBinLookup: () => void;
9
+ SRConfig: {};
9
10
  };
10
11
  formatProps(props: CardElementProps): {
11
12
  type: string;
@@ -18,6 +19,11 @@ export declare class CardElement extends UIElement<CardElementProps> {
18
19
  };
19
20
  brandsConfiguration: import("./types").CardBrandsConfiguration;
20
21
  icon: string;
22
+ SRConfig: {
23
+ collateErrors: any;
24
+ moveFocus: any;
25
+ showPanel: any;
26
+ };
21
27
  groupTypes: string[];
22
28
  holderNameRequired: boolean;
23
29
  hasCVC: boolean;
@@ -37,6 +37,7 @@ declare namespace CardInput {
37
37
  };
38
38
  styles: {};
39
39
  placeholders: {};
40
+ SRConfig: {};
40
41
  };
41
42
  }
42
43
  export default CardInput;
@@ -33,5 +33,6 @@ declare const _default: {
33
33
  };
34
34
  styles: {};
35
35
  placeholders: {};
36
+ SRConfig: {};
36
37
  };
37
38
  export default _default;
@@ -0,0 +1,9 @@
1
+ export declare const CREDIT_CARD: string[];
2
+ export declare const CREDIT_CARD_NAME_TOP: string[];
3
+ export declare const CREDIT_CARD_NAME_BOTTOM: string[];
4
+ export declare const KCP_CARD: string[];
5
+ export declare const KCP_CARD_NAME_TOP: string[];
6
+ export declare const KCP_CARD_NAME_BOTTOM: string[];
7
+ export declare const SSN_CARD: string[];
8
+ export declare const SSN_CARD_NAME_TOP: string[];
9
+ export declare const SSN_CARD_NAME_BOTTOM: string[];
@@ -4,6 +4,9 @@ import { PaymentAmount } from '../../../../types';
4
4
  import { InstallmentOptions } from './components/types';
5
5
  import { ValidationResult } from '../../../internal/PersonalDetails/types';
6
6
  import { CVCPolicyType, DatePolicyType } from '../../../internal/SecuredFields/lib/core/AbstractSecuredField';
7
+ import { ValidationRuleResult } from '../../../../utils/Validator/Validator';
8
+ import Specifications from '../../../internal/Address/Specifications';
9
+ import { AddressSchema, StringObject } from '../../../internal/Address/types';
7
10
  export interface CardInputValidState {
8
11
  holderName?: boolean;
9
12
  billingAddress?: boolean;
@@ -71,6 +74,8 @@ export interface CardInputProps {
71
74
  onBinValue?: () => {};
72
75
  details?: object;
73
76
  storedDetails?: object;
77
+ SRConfig?: ScreenreaderConfig;
78
+ specifications?: Specifications;
74
79
  }
75
80
  export interface CardInputState {
76
81
  dualBrandSelectElements: DualBrandSelectElement[];
@@ -88,4 +93,38 @@ export interface CardInputState {
88
93
  issuingCountryCode: string;
89
94
  showSocialSecurityNumber?: boolean;
90
95
  }
96
+ interface ScreenreaderConfig {
97
+ collateErrors?: boolean;
98
+ moveFocus?: boolean;
99
+ showPanel?: boolean;
100
+ }
101
+ interface FieldError {
102
+ errorMessage?: string;
103
+ errorI18n?: string;
104
+ }
105
+ export interface ErrorObj {
106
+ holderName?: ValidationRuleResult;
107
+ socialSecurityNumber?: ValidationRuleResult;
108
+ taxNumber?: ValidationRuleResult;
109
+ billingAddress?: ValidationRuleResult;
110
+ encryptedCardNumber?: FieldError;
111
+ encryptedExpiryDate?: FieldError;
112
+ encryptedSecurityCode?: FieldError;
113
+ encryptedBankAccountNumber?: FieldError;
114
+ encryptedBankLocationId?: FieldError;
115
+ encryptedPassword?: FieldError;
116
+ encryptedPin?: FieldError;
117
+ }
118
+ export interface LayoutObj {
119
+ props: CardInputProps;
120
+ showKCP: boolean;
121
+ showBrazilianSSN: boolean;
122
+ countrySpecificSchemas: AddressSchema;
123
+ }
124
+ export interface SortErrorsObj {
125
+ errors: ErrorObj;
126
+ layout: string[];
127
+ i18n: Language;
128
+ countrySpecificLabels: StringObject;
129
+ }
91
130
  export {};
@@ -1 +1,5 @@
1
+ import { ErrorPanelObj } from '../../../../core/Errors/ErrorPanel';
2
+ import { LayoutObj, SortErrorsObj } from './types';
1
3
  export declare const getCardImageUrl: (brand: string, loadingContext: string) => string;
4
+ export declare const getLayout: ({ props, showKCP, showBrazilianSSN, countrySpecificSchemas }: LayoutObj) => string[];
5
+ export declare const sortErrorsForPanel: ({ errors, layout, i18n, countrySpecificLabels }: SortErrorsObj) => ErrorPanelObj;
@@ -108,7 +108,7 @@ export interface BrandObject {
108
108
  brand: string;
109
109
  cvcPolicy: CVCPolicyType;
110
110
  enableLuhnCheck: boolean;
111
- showExpiryDate: boolean;
111
+ showExpiryDate?: boolean;
112
112
  expiryDatePolicy?: DatePolicyType;
113
113
  showSocialSecurityNumber?: boolean;
114
114
  supported: boolean;
@@ -1,4 +1,4 @@
1
- import { AddressSchema } from './types';
1
+ import { AddressSchema, StringObject } from './types';
2
2
  declare class Specifications {
3
3
  private specifications;
4
4
  constructor(specifications?: any);
@@ -21,6 +21,12 @@ declare class Specifications {
21
21
  * @returns AddressSchema
22
22
  */
23
23
  getAddressSchemaForCountry(country: string): AddressSchema;
24
+ /**
25
+ * Returns the address labels of the selected country or the default address labels.
26
+ * @param country - The selected country
27
+ * @returns StringObject
28
+ */
29
+ getAddressLabelsForCountry(country: string): StringObject;
24
30
  /**
25
31
  * Returns the optional fields of the selected country or the default optional fields.
26
32
  * @param country - The selected country
@@ -1,6 +1,9 @@
1
1
  import { AddressField, AddressData } from '../../../types';
2
2
  import Specifications from './Specifications';
3
3
  import { ValidatorRules } from '../../../utils/Validator/Validator';
4
+ export declare type StringObject = {
5
+ [key: string]: string;
6
+ };
4
7
  export interface AddressProps {
5
8
  allowedCountries?: string[];
6
9
  countryCode?: string;
@@ -71,13 +74,9 @@ export declare type AddressSchema = (AddressField | AddressFieldsGroup)[];
71
74
  export interface AddressSpecifications {
72
75
  [key: string]: {
73
76
  hasDataset?: boolean;
74
- labels?: {
75
- [key: string]: string;
76
- };
77
+ labels?: StringObject;
77
78
  optionalFields?: AddressField[];
78
- placeholders?: {
79
- [key: string]: string;
80
- };
79
+ placeholders?: StringObject;
81
80
  schema?: AddressSchema;
82
81
  };
83
82
  }
@@ -13,7 +13,7 @@ declare class Field extends Component<FieldProps, FieldState> {
13
13
  filled: any;
14
14
  focused?: undefined;
15
15
  };
16
- render({ className, classNameModifiers, children, errorMessage, helper, inputWrapperModifiers, isLoading, isValid, label, dualBrandingElements, dir, name, showValidIcon }: {
16
+ render({ className, classNameModifiers, children, errorMessage, helper, inputWrapperModifiers, isLoading, isValid, label, dualBrandingElements, dir, name, showValidIcon, isCollatingErrors }: {
17
17
  className?: string;
18
18
  classNameModifiers?: any[];
19
19
  children: any;
@@ -27,6 +27,7 @@ declare class Field extends Component<FieldProps, FieldState> {
27
27
  dir: any;
28
28
  name: any;
29
29
  showValidIcon: any;
30
+ isCollatingErrors: any;
30
31
  }): h.JSX.Element;
31
32
  }
32
33
  export default Field;
@@ -20,6 +20,7 @@ export interface FieldProps {
20
20
  dir?: any;
21
21
  name?: string;
22
22
  showValidIcon?: boolean;
23
+ isCollatingErrors?: boolean;
23
24
  }
24
25
  export interface FieldState {
25
26
  disabled?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { h } from 'preact';
2
2
  import { SelectProps } from './types';
3
3
  import './Select.scss';
4
- declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, selected, name, isInvalid, isValid, placeholder, uniqueId }: SelectProps): h.JSX.Element;
4
+ declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, selected, name, isInvalid, isValid, placeholder, uniqueId, isCollatingErrors }: SelectProps): h.JSX.Element;
5
5
  declare namespace Select {
6
6
  var defaultProps: {
7
7
  className: string;
@@ -18,6 +18,7 @@ export interface SelectProps {
18
18
  readonly: boolean;
19
19
  selected: string;
20
20
  uniqueId?: string;
21
+ isCollatingErrors: boolean;
21
22
  }
22
23
  export interface SelectButtonProps {
23
24
  active: SelectItem;
@@ -11,10 +11,11 @@ export declare const ENCRYPTED_PIN_FIELD = "encryptedPin";
11
11
  export declare const GIFT_CARD = "giftcard";
12
12
  export declare const ENCRYPTED_BANK_ACCNT_NUMBER_FIELD = "encryptedBankAccountNumber";
13
13
  export declare const ENCRYPTED_BANK_LOCATION_FIELD = "encryptedBankLocationId";
14
- export declare const SF_VERSION = "3.7.3";
14
+ export declare const SF_VERSION = "3.7.4";
15
15
  export declare const DEFAULT_CARD_GROUP_TYPES: string[];
16
16
  export declare const NON_CREDIT_CARD_TYPE_SECURED_FIELDS: string[];
17
- export declare const CSF_FIELDS_ARRAY: string[];
17
+ export declare const SF_FIELDS_ARRAY: string[];
18
+ export declare const ALL_SECURED_FIELDS: string[];
18
19
  export declare const REQUIRED = "required";
19
20
  export declare const OPTIONAL = "optional";
20
21
  export declare const HIDDEN = "hidden";
@@ -24,6 +24,7 @@ export interface SFInternalConfig {
24
24
  minimumExpiryDate: string;
25
25
  uid: string;
26
26
  implementationType: string;
27
+ isCollatingErrors: boolean;
27
28
  }
28
29
  /**
29
30
  * The object passed from createSecuredFields to a new instance of SecuredField.ts
@@ -44,6 +44,7 @@ interface CSFCommonProps {
44
44
  legacyInputMode?: boolean;
45
45
  minimumExpiryDate?: string;
46
46
  implementationType?: string;
47
+ isCollatingErrors?: boolean;
47
48
  }
48
49
  /**
49
50
  * Object sent when SecuredFieldsProvider initialises CSF
@@ -1,8 +1,9 @@
1
1
  import { h } from 'preact';
2
- export default function ({ onChange, onInput, valid, error, data }: {
2
+ export default function ({ onChange, onInput, valid, error, data, required }: {
3
3
  onChange: any;
4
4
  onInput: any;
5
5
  valid?: boolean;
6
6
  error?: any;
7
7
  data?: string;
8
+ required?: boolean;
8
9
  }): h.JSX.Element;
@@ -1,5 +1,7 @@
1
+ import { CommonPropsTypes } from './CoreProvider';
1
2
  import Language from '../../language/Language';
2
3
  export declare const CoreContext: import("preact").Context<{
3
4
  i18n: Language;
4
5
  loadingContext: string;
6
+ commonProps: CommonPropsTypes;
5
7
  }>;
@@ -3,6 +3,10 @@ interface CoreProviderProps {
3
3
  loadingContext: string;
4
4
  i18n: any;
5
5
  children?: any;
6
+ commonProps?: CommonPropsTypes;
7
+ }
8
+ export interface CommonPropsTypes {
9
+ isCollatingErrors?: boolean;
6
10
  }
7
11
  /**
8
12
  * CoreProvider Component
@@ -1,5 +1,6 @@
1
1
  declare function useCoreContext(): {
2
2
  i18n: import("../../language").default;
3
3
  loadingContext: string;
4
+ commonProps: import("./CoreProvider").CommonPropsTypes;
4
5
  };
5
6
  export default useCoreContext;
@@ -0,0 +1,14 @@
1
+ import { h } from 'preact';
2
+ import './ErrorPanel.scss';
3
+ export interface ErrorPanelObj {
4
+ errorMessages: string[];
5
+ fieldList: string[];
6
+ }
7
+ export interface ErrorPanelProps {
8
+ id?: string;
9
+ heading?: string;
10
+ errors: ErrorPanelObj;
11
+ callbackFn?: (who: any) => void;
12
+ showPanel?: boolean;
13
+ }
14
+ export declare function ErrorPanel({ id, heading, errors, callbackFn, showPanel }: ErrorPanelProps): h.JSX.Element;
@@ -20,7 +20,7 @@ export declare type ValidatorRules = {
20
20
  /**
21
21
  * Holds the result of a validation
22
22
  */
23
- declare class ValidationRuleResult {
23
+ export declare class ValidationRuleResult {
24
24
  private readonly shouldValidate;
25
25
  isValid: boolean;
26
26
  errorMessage: string;
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "./dist/adyen.css": "./dist/adyen.css",
24
24
  "./package.json": "./package.json"
25
25
  },
26
- "version": "5.5.0",
26
+ "version": "5.6.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",