@adyen/adyen-web 5.31.0 → 5.31.2

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.
@@ -1,6 +1,6 @@
1
1
  import { ValidatorRules } from '../../../utils/Validator/types';
2
2
  export declare const bacsValidationRules: ValidatorRules;
3
3
  export declare const bacsFormatters: {
4
- bankAccountNumber: (value: any) => any;
5
- bankLocationId: (value: any) => any;
4
+ bankAccountNumber: import("../../../utils/Formatters/types").FormatterFn;
5
+ bankLocationId: import("../../../utils/Formatters/types").FormatterFn;
6
6
  };
@@ -44,7 +44,7 @@ declare class DropinElement extends UIElement<DropinElementProps> {
44
44
  openFirstPaymentMethod?: boolean;
45
45
  onSubmit?: (data: any, component: any) => void;
46
46
  onReady?: () => void;
47
- onSelect?: (paymentMethod: any) => void;
47
+ onSelect?: (paymentMethod: UIElement<any>) => void;
48
48
  showRemovePaymentMethodButton?: boolean;
49
49
  onDisableStoredPaymentMethod?: (storedPaymentMethod: any, resolve: any, reject: any) => void;
50
50
  session?: import("../../core/CheckoutSession/CheckoutSession").default;
@@ -6,10 +6,10 @@ interface PaymentMethodItemProps {
6
6
  isSelected: boolean;
7
7
  isLoaded: boolean;
8
8
  isLoading: boolean;
9
- isDisabling: boolean;
9
+ isDisablingPaymentMethod: boolean;
10
10
  showRemovePaymentMethodButton: boolean;
11
11
  onDisableStoredPaymentMethod: (paymentMethod: any) => void;
12
- onSelect: () => void;
12
+ onSelect: (paymentMethod: UIElement) => void;
13
13
  standalone: boolean;
14
14
  className?: string;
15
15
  }
@@ -20,24 +20,22 @@ declare class PaymentMethodItem extends Component<PaymentMethodItemProps> {
20
20
  isLoaded: boolean;
21
21
  isLoading: boolean;
22
22
  showDisableStoredPaymentMethodConfirmation: boolean;
23
- onSelect: () => void;
24
23
  };
25
24
  state: {
26
25
  showDisableStoredPaymentMethodConfirmation: boolean;
27
26
  activeBrand: any;
28
27
  };
29
- onClick: () => void;
30
28
  componentDidMount(): void;
31
29
  componentWillUnmount(): void;
32
30
  toggleDisableConfirmation: () => void;
33
31
  onDisableStoredPaymentMethod: () => void;
34
- render({ paymentMethod, isSelected, isDisabling, isLoaded, isLoading, onSelect, standalone }: {
32
+ private handleOnListItemClick;
33
+ render({ paymentMethod, isSelected, isDisablingPaymentMethod, isLoaded, isLoading, standalone }: {
35
34
  paymentMethod: any;
36
35
  isSelected: any;
37
- isDisabling: any;
36
+ isDisablingPaymentMethod: any;
38
37
  isLoaded: any;
39
38
  isLoading: any;
40
- onSelect: any;
41
39
  standalone: any;
42
40
  }, { activeBrand }: {
43
41
  activeBrand: any;
@@ -3,30 +3,33 @@ import UIElement from '../../../UIElement';
3
3
  import { Order, OrderStatus } from '../../../../types';
4
4
  interface PaymentMethodListProps {
5
5
  paymentMethods: UIElement[];
6
- instantPaymentMethods: UIElement[];
7
- activePaymentMethod: UIElement;
8
- cachedPaymentMethods: object;
6
+ activePaymentMethod?: UIElement;
7
+ instantPaymentMethods?: UIElement[];
8
+ /**
9
+ * Map that keeps track of which Payment methods (UIElements) already got rendered in the UI
10
+ */
11
+ cachedPaymentMethods: Record<string, boolean>;
9
12
  order?: Order;
10
- orderStatus: OrderStatus;
13
+ orderStatus?: OrderStatus;
11
14
  openFirstStoredPaymentMethod?: boolean;
12
15
  openFirstPaymentMethod?: boolean;
13
16
  showRemovePaymentMethodButton?: boolean;
14
- onSelect: (paymentMethod: any) => void;
15
- onDisableStoredPaymentMethod: (storedPaymentMethod: any) => void;
17
+ onSelect?: (paymentMethod: UIElement) => void;
18
+ onDisableStoredPaymentMethod?: (storedPaymentMethod: any) => void;
16
19
  onOrderCancel?: (order: any) => void;
17
- isDisabling: boolean;
20
+ isDisablingPaymentMethod?: boolean;
18
21
  isLoading: boolean;
19
22
  }
20
23
  declare class PaymentMethodList extends Component<PaymentMethodListProps> {
21
24
  static defaultProps: PaymentMethodListProps;
22
25
  componentDidMount(): void;
23
- onSelect: (paymentMethod: any) => () => void;
24
- render({ paymentMethods, instantPaymentMethods, activePaymentMethod, cachedPaymentMethods, isLoading }: {
26
+ render({ paymentMethods, instantPaymentMethods, activePaymentMethod, cachedPaymentMethods, isLoading, isDisablingPaymentMethod }: {
25
27
  paymentMethods: any;
26
28
  instantPaymentMethods: any;
27
29
  activePaymentMethod: any;
28
30
  cachedPaymentMethods: any;
29
31
  isLoading: any;
32
+ isDisablingPaymentMethod: any;
30
33
  }): h.JSX.Element;
31
34
  }
32
35
  export default PaymentMethodList;
@@ -32,7 +32,7 @@ export interface DropinElementProps extends UIElementProps {
32
32
  openFirstPaymentMethod?: boolean;
33
33
  onSubmit?: (data: any, component: any) => void;
34
34
  onReady?: () => void;
35
- onSelect?: (paymentMethod: any) => void;
35
+ onSelect?: (paymentMethod: UIElement) => void;
36
36
  /**
37
37
  * Show/Hide the remove payment method button on stored payment methods
38
38
  * Requires {@link DropinElementProps.onDisableStoredPaymentMethod}
@@ -1,7 +1,8 @@
1
1
  import { h } from 'preact';
2
- export default function ConsentCheckbox({ errorMessage, label, onChange, ...props }: {
2
+ export default function ConsentCheckbox({ errorMessage, label, onChange, i18n, ...props }: {
3
3
  [x: string]: any;
4
4
  errorMessage: any;
5
5
  label: any;
6
6
  onChange: any;
7
+ i18n: any;
7
8
  }): h.JSX.Element;
@@ -11,7 +11,7 @@ export declare const ENCRYPTED_BANK_LOCATION_FIELD = "encryptedBankLocationId";
11
11
  export declare const ENCRYPTED_SECURITY_CODE_3_DIGITS = "encryptedSecurityCode3digits";
12
12
  export declare const ENCRYPTED_SECURITY_CODE_4_DIGITS = "encryptedSecurityCode4digits";
13
13
  export declare const GIFT_CARD = "giftcard";
14
- export declare const SF_VERSION = "4.3.2";
14
+ export declare const SF_VERSION = "4.3.3";
15
15
  export declare const DEFAULT_CARD_GROUP_TYPES: string[];
16
16
  export declare const NON_CREDIT_CARD_TYPE_SECURED_FIELDS: string[];
17
17
  export declare const CREDIT_CARD_SF_FIELDS: string[];
@@ -0,0 +1,2 @@
1
+ import { FormatterFn } from "./types";
2
+ export declare const digitsOnlyFormatter: FormatterFn;
@@ -0,0 +1,7 @@
1
+ export declare type FormatterFn = (value: string, context?: {
2
+ state: {
3
+ data: {
4
+ country?: string;
5
+ };
6
+ };
7
+ }) => string;
@@ -1,4 +1,5 @@
1
1
  import { ValidationRuleResult } from './ValidationRuleResult';
2
+ import { Formatter } from '../useForm/types';
2
3
  declare type ValidatorMode = 'blur' | 'input';
3
4
  export declare type ErrorMessageObject = {
4
5
  translationKey: string;
@@ -10,14 +11,8 @@ export declare type Ruleset = {
10
11
  export declare type CountryRuleset = {
11
12
  [country: string]: Ruleset;
12
13
  };
13
- declare type FormatterFn = (value: any, context?: any) => string;
14
- export interface Format {
15
- formatter?: FormatterFn;
16
- format?: string;
17
- maxlength?: number;
18
- }
19
14
  export declare type FormatRules = {
20
- [field: string]: Format;
15
+ [field: string]: Formatter;
21
16
  };
22
17
  export declare type CountryFormatRules = {
23
18
  [country: string]: FormatRules;
@@ -1,4 +1,5 @@
1
1
  import { ValidatorRules } from '../Validator/types';
2
+ import { FormatterFn } from '../Formatters/types';
2
3
  export declare type FormState<FormSchema> = {
3
4
  schema?: string[];
4
5
  data: FormSchema;
@@ -13,8 +14,16 @@ export declare type FormState<FormSchema> = {
13
14
  };
14
15
  isValid?: boolean;
15
16
  };
17
+ export interface Formatter {
18
+ formatterFn?: FormatterFn;
19
+ format?: string;
20
+ maxlength?: number;
21
+ }
16
22
  export declare type FormProps = {
17
23
  rules?: ValidatorRules;
24
+ formatters?: {
25
+ [key: string]: Formatter | Function;
26
+ };
18
27
  [key: string]: any;
19
28
  };
20
29
  export interface Form<FormSchema> extends FormState<FormSchema> {
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.31.0",
26
+ "version": "5.31.2",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",