@adyen/adyen-web 5.12.0 → 5.14.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 (102) hide show
  1. package/README.md +1 -1
  2. package/dist/adyen.css +7 -8
  3. package/dist/adyen.css.map +1 -1
  4. package/dist/adyen.js +1 -1
  5. package/dist/adyen.js.map +1 -1
  6. package/dist/cjs/adyen.css +7 -8
  7. package/dist/cjs/adyen.css.map +1 -1
  8. package/dist/cjs/index.js +1 -1
  9. package/dist/es/adyen.css +7 -8
  10. package/dist/es/adyen.css.map +1 -1
  11. package/dist/es/ar.js +1 -1
  12. package/dist/es/cs-CZ.js +1 -1
  13. package/dist/es/da-DK.js +1 -1
  14. package/dist/es/de-DE.js +1 -1
  15. package/dist/es/el-GR.js +1 -1
  16. package/dist/es/es-ES.js +1 -1
  17. package/dist/es/fi-FI.js +1 -1
  18. package/dist/es/fr-FR.js +1 -1
  19. package/dist/es/hr-HR.js +1 -1
  20. package/dist/es/hu-HU.js +1 -1
  21. package/dist/es/index.js +1 -1
  22. package/dist/es/it-IT.js +1 -1
  23. package/dist/es/ja-JP.js +1 -1
  24. package/dist/es/ko-KR.js +1 -1
  25. package/dist/es/nl-NL.js +1 -1
  26. package/dist/es/no-NO.js +1 -1
  27. package/dist/es/pl-PL.js +1 -1
  28. package/dist/es/pt-BR.js +1 -1
  29. package/dist/es/ro-RO.js +1 -1
  30. package/dist/es/ru-RU.js +1 -1
  31. package/dist/es/sk-SK.js +1 -1
  32. package/dist/es/sl-SI.js +1 -1
  33. package/dist/es/sv-SE.js +1 -1
  34. package/dist/es/zh-CN.js +1 -1
  35. package/dist/es/zh-TW.js +1 -1
  36. package/dist/es.modern/adyen.css +7 -8
  37. package/dist/es.modern/adyen.css.map +1 -1
  38. package/dist/es.modern/ar.js +1 -1
  39. package/dist/es.modern/cs-CZ.js +1 -1
  40. package/dist/es.modern/da-DK.js +1 -1
  41. package/dist/es.modern/de-DE.js +1 -1
  42. package/dist/es.modern/el-GR.js +1 -1
  43. package/dist/es.modern/es-ES.js +1 -1
  44. package/dist/es.modern/fi-FI.js +1 -1
  45. package/dist/es.modern/fr-FR.js +1 -1
  46. package/dist/es.modern/hr-HR.js +1 -1
  47. package/dist/es.modern/hu-HU.js +1 -1
  48. package/dist/es.modern/index.js +1 -1
  49. package/dist/es.modern/it-IT.js +1 -1
  50. package/dist/es.modern/ja-JP.js +1 -1
  51. package/dist/es.modern/ko-KR.js +1 -1
  52. package/dist/es.modern/nl-NL.js +1 -1
  53. package/dist/es.modern/no-NO.js +1 -1
  54. package/dist/es.modern/pl-PL.js +1 -1
  55. package/dist/es.modern/pt-BR.js +1 -1
  56. package/dist/es.modern/ro-RO.js +1 -1
  57. package/dist/es.modern/ru-RU.js +1 -1
  58. package/dist/es.modern/sk-SK.js +1 -1
  59. package/dist/es.modern/sl-SI.js +1 -1
  60. package/dist/es.modern/sv-SE.js +1 -1
  61. package/dist/es.modern/zh-CN.js +1 -1
  62. package/dist/es.modern/zh-TW.js +1 -1
  63. package/dist/types/components/AfterPay/AfterPayB2B.d.ts +2 -15
  64. package/dist/types/components/Atome/Atome.d.ts +5 -0
  65. package/dist/types/components/Atome/config.d.ts +22 -0
  66. package/dist/types/components/Atome/index.d.ts +1 -0
  67. package/dist/types/components/BankTransfer/types.d.ts +3 -0
  68. package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +2 -1
  69. package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +2 -0
  70. package/dist/types/components/Card/components/CardInput/types.d.ts +7 -1
  71. package/dist/types/components/Card/components/CardInput/utils.d.ts +9 -1
  72. package/dist/types/components/RatePay/RatePayDirectDebit.d.ts +5 -0
  73. package/dist/types/components/UIElement.d.ts +1 -1
  74. package/dist/types/components/helpers/OpenInvoiceContainer/OpenInvoiceContainer.d.ts +9 -16
  75. package/dist/types/components/index.d.ts +4 -0
  76. package/dist/types/components/internal/Address/Specifications.d.ts +9 -0
  77. package/dist/types/components/internal/Address/constants.d.ts +10 -0
  78. package/dist/types/components/internal/Address/types.d.ts +2 -1
  79. package/dist/types/components/internal/Button/Button.d.ts +3 -3
  80. package/dist/types/components/internal/Button/types.d.ts +1 -1
  81. package/dist/types/components/internal/FormFields/Field/Field.d.ts +3 -31
  82. package/dist/types/components/internal/FormFields/Field/types.d.ts +1 -1
  83. package/dist/types/components/internal/IFrame/Iframe.d.ts +1 -3
  84. package/dist/types/components/{Sepa/components → internal}/IbanInput/IbanInput.d.ts +9 -2
  85. package/dist/types/components/{Sepa/components → internal}/IbanInput/index.d.ts +0 -0
  86. package/dist/types/components/{Sepa/components → internal}/IbanInput/specifications.d.ts +0 -0
  87. package/dist/types/components/{Sepa/components → internal}/IbanInput/utils.d.ts +6 -0
  88. package/dist/types/components/{Sepa/components → internal}/IbanInput/validate.d.ts +0 -0
  89. package/dist/types/components/internal/OpenInvoice/types.d.ts +19 -2
  90. package/dist/types/components/internal/PhoneInput/types.d.ts +4 -0
  91. package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +6 -6
  92. package/dist/types/core/core.d.ts +2 -1
  93. package/dist/types/core/types.d.ts +1 -1
  94. package/dist/types/language/config.d.ts +3 -2
  95. package/dist/types/language/locales/index.d.ts +102 -100
  96. package/dist/types/utils/Validator/ValidationRuleResult.d.ts +17 -0
  97. package/dist/types/utils/Validator/Validator.d.ts +5 -18
  98. package/dist/types/utils/Validator/types.d.ts +4 -0
  99. package/dist/types/utils/useForm/reducer.d.ts +4 -2
  100. package/dist/types/utils/useForm/types.d.ts +18 -8
  101. package/dist/types/utils/useForm/useForm.d.ts +2 -18
  102. package/package.json +12 -13
@@ -1,33 +1,20 @@
1
- import { ErrorMessageObject, FieldContext, FieldData, ValidatorRules } from './types';
2
- /**
3
- * Holds the result of a validation
4
- */
5
- export declare class ValidationRuleResult {
6
- private readonly shouldValidate;
7
- isValid: boolean;
8
- errorMessage: string | ErrorMessageObject;
9
- constructor(rule: any, value: any, mode: any, context: any);
10
- /**
11
- * Whether the validation is considered an error.
12
- * A field is only considered to be an error if the validation rule applies to the current mode.
13
- */
14
- hasError(): boolean;
15
- }
1
+ import { ValidatorRules, FieldContext, FieldData } from './types';
2
+ import { ValidationRuleResult } from './ValidationRuleResult';
16
3
  declare class ValidationResult {
17
4
  private validationResults;
18
5
  constructor(results: ValidationRuleResult[]);
19
6
  /** Checks if all validation rules have passed */
20
7
  get isValid(): boolean;
21
8
  /** Checks if any validation rule returned an error */
22
- hasError(): boolean;
9
+ hasError(isValidatingForm?: boolean): boolean;
23
10
  /** Returns the first validation result that returned an error */
24
- getError(): ValidationRuleResult;
11
+ getError(isValidatingForm?: boolean): ValidationRuleResult;
25
12
  /** Returns all validation results that returned an error */
26
13
  getAllErrors(): ValidationRuleResult[];
27
14
  }
28
15
  declare class Validator {
29
16
  rules: ValidatorRules;
30
- constructor(rules?: {});
17
+ constructor(rules: any);
31
18
  setRules(newRules: any): void;
32
19
  /**
33
20
  * Get all validation rules for a field
@@ -1,3 +1,4 @@
1
+ import { ValidationRuleResult } from './ValidationRuleResult';
1
2
  declare type ValidatorMode = 'blur' | 'input';
2
3
  export declare type ErrorMessageObject = {
3
4
  translationKey: string;
@@ -42,4 +43,7 @@ export interface FieldContext {
42
43
  [key: string]: any;
43
44
  };
44
45
  }
46
+ export declare type ValidationRuleResults = {
47
+ [key: string]: ValidationRuleResult;
48
+ };
45
49
  export {};
@@ -1,14 +1,16 @@
1
1
  /**
2
2
  * Processes default data and sets as default in state
3
3
  */
4
- export declare function init({ schema, defaultData, processField }: {
4
+ export declare function init({ schema, defaultData, processField, fieldProblems }: {
5
5
  schema: any;
6
6
  defaultData: any;
7
7
  processField: any;
8
+ fieldProblems: any;
8
9
  }): {
9
10
  schema: any;
10
11
  data: any;
11
12
  valid: any;
12
13
  errors: any;
14
+ fieldProblems: any;
13
15
  };
14
- export declare function getReducer(processField: any): (state: any, { type, key, value, mode, defaultData, schema }: any) => any;
16
+ export declare function getReducer(processField: any): (state: any, { type, key, value, mode, schema, defaultData, formValue, selectedSchema, fieldProblems }: any) => any;
@@ -1,19 +1,29 @@
1
- import { ValidationResult } from '../../components/internal/PersonalDetails/types';
2
1
  import { ValidatorRules } from '../Validator/types';
3
- export declare type FormState<DataState> = {
4
- schema: string[];
5
- data: DataState;
2
+ export declare type FormState<FormSchema> = {
3
+ schema?: string[];
4
+ data: FormSchema;
6
5
  errors: {
7
- [key: string]: ValidationResult;
6
+ [key: string]: any;
8
7
  };
9
8
  valid: {
10
9
  [key: string]: boolean;
11
10
  };
11
+ fieldProblems?: {
12
+ [key: string]: any;
13
+ };
14
+ isValid?: boolean;
12
15
  };
13
16
  export declare type FormProps = {
14
17
  rules?: ValidatorRules;
15
18
  [key: string]: any;
16
19
  };
17
- export declare type DefaultDataState = {
18
- [key: string]: any;
19
- };
20
+ export interface Form<FormSchema> extends FormState<FormSchema> {
21
+ handleChangeFor: (key: string, mode?: string) => (e: any) => void;
22
+ triggerValidation: (schema?: any) => void;
23
+ setSchema: (schema: any) => void;
24
+ setData: (key: string, value: any) => void;
25
+ setValid: (key: string, value: any) => void;
26
+ setErrors: (key: string, value: any) => void;
27
+ mergeForm: (formValue: any) => void;
28
+ setFieldProblems: (fieldProblems: any) => void;
29
+ }
@@ -1,19 +1,3 @@
1
- import { FormProps, DefaultDataState } from './types';
2
- declare function useForm<DataState = DefaultDataState>(props: FormProps): {
3
- handleChangeFor: (key: any, mode?: string) => (e: any) => void;
4
- triggerValidation: () => void;
5
- setSchema: (schema: any) => void;
6
- setData: (key: any, value: any) => void;
7
- setValid: (key: any, value: any) => void;
8
- setErrors: (key: any, value: any) => void;
9
- isValid: boolean;
10
- schema: string[];
11
- valid: {
12
- [key: string]: boolean;
13
- };
14
- errors: {
15
- [key: string]: import("../../components/internal/PersonalDetails/types").ValidationResult;
16
- };
17
- data: DataState;
18
- };
1
+ import { Form, FormProps } from './types';
2
+ declare function useForm<FormSchema>(props: FormProps): Form<FormSchema>;
19
3
  export default useForm;
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.12.0",
26
+ "version": "5.14.0",
27
27
  "license": "MIT",
28
28
  "homepage": "https://docs.adyen.com/checkout",
29
29
  "repository": "github:Adyen/adyen-web",
@@ -32,7 +32,6 @@
32
32
  },
33
33
  "scripts": {
34
34
  "start": "npm run dev-server",
35
- "start:fast": "EXPERIMENTAL_DEVBUILD=true npm run dev-server",
36
35
  "dev-server": "cross-env NODE_ENV=development rollup --watch --config config/rollup.config.js",
37
36
  "docs:generate": "typedoc --out docs src --exclude \"**/*+(index|.test).ts\"",
38
37
  "build": "rm -rf dist/ && npm run type-check-generate && cross-env NODE_ENV=production rollup --config config/rollup.config.js",
@@ -49,23 +48,23 @@
49
48
  "prepublishOnly": "npm run build"
50
49
  },
51
50
  "devDependencies": {
52
- "@babel/cli": "^7.16.0",
51
+ "@babel/cli": "^7.17.6",
53
52
  "@babel/core": "^7.16.0",
54
53
  "@babel/plugin-transform-runtime": "^7.17.0",
55
- "@babel/preset-env": "^7.16.0",
54
+ "@babel/preset-env": "^7.16.11",
56
55
  "@babel/preset-react": "^7.14.5",
57
56
  "@babel/preset-typescript": "^7.15.0",
58
57
  "@babel/runtime-corejs3": "^7.16.3",
59
58
  "@rollup/plugin-babel": "^5.3.0",
60
- "@rollup/plugin-commonjs": "^21.0.1",
59
+ "@rollup/plugin-commonjs": "^21.0.3",
61
60
  "@rollup/plugin-eslint": "^8.0.1",
62
61
  "@rollup/plugin-json": "^4.1.0",
63
- "@rollup/plugin-node-resolve": "^13.0.0",
64
- "@rollup/plugin-replace": "^3.0.0",
62
+ "@rollup/plugin-node-resolve": "^13.1.3",
63
+ "@rollup/plugin-replace": "^4.0.0",
65
64
  "@testing-library/preact": "^2.0.1",
66
65
  "@testing-library/preact-hooks": "^1.1.0",
67
- "@types/jest": "^26.0.23",
68
- "@typescript-eslint/eslint-plugin": "^4.28.3",
66
+ "@types/jest": "^27.4.1",
67
+ "@typescript-eslint/eslint-plugin": "^4.33.0",
69
68
  "@typescript-eslint/parser": "^4.33.0",
70
69
  "autoprefixer": "^10.4.2",
71
70
  "babel-jest": "^27.3.1",
@@ -74,7 +73,7 @@
74
73
  "dotenv": "^10.0.0",
75
74
  "enzyme": "^3.11.0",
76
75
  "enzyme-adapter-preact-pure": "^3.1.0",
77
- "esbuild": "^0.12.15",
76
+ "esbuild": "^0.14.27",
78
77
  "eslint": "^7.32.0",
79
78
  "eslint-plugin-import": "^2.23.4",
80
79
  "eslint-plugin-jsx-a11y": "^6.4.1",
@@ -85,9 +84,9 @@
85
84
  "jest": "^26.6.3",
86
85
  "node-sass": "^6.0.1",
87
86
  "postcss": "^8.4.7",
88
- "postcss-reporter": "^7.0.2",
87
+ "postcss-reporter": "^7.0.5",
89
88
  "prettier": "^1.19.1",
90
- "rollup": "^2.61.1",
89
+ "rollup": "^2.70.1",
91
90
  "rollup-plugin-esbuild": "^4.5.0",
92
91
  "rollup-plugin-postcss": "^4.0.2",
93
92
  "rollup-plugin-terser": "^7.0.2",
@@ -102,7 +101,7 @@
102
101
  "dependencies": {
103
102
  "@babel/runtime": "^7.15.4",
104
103
  "@babel/runtime-corejs3": "^7.16.3",
105
- "@types/applepayjs": "^3.0.2",
104
+ "@types/applepayjs": "^3.0.4",
106
105
  "@types/googlepay": "^0.6.2",
107
106
  "classnames": "^2.3.1",
108
107
  "core-js-pure": "^3.18.1",