@adyen/kyc-components 2.13.0 → 2.13.1

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.
@@ -16940,6 +16940,11 @@ function BankAccountFormat(props) {
16940
16940
  })
16941
16941
  });
16942
16942
  }
16943
+ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
16944
+ ExperimentNames2["EnableTrustFlow"] = "EnableTrustFlow";
16945
+ ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
16946
+ return ExperimentNames2;
16947
+ })(ExperimentNames || {});
16943
16948
  const stripNonAlphanumeric = (value) => value.replaceAll(/[^0-9a-zA-Z]/g, "");
16944
16949
  const isValueMasked = (value) => {
16945
16950
  var _a;
@@ -16950,6 +16955,9 @@ function BankAccountNumber(props) {
16950
16955
  const {
16951
16956
  i18n
16952
16957
  } = useI18nContext();
16958
+ const {
16959
+ isExperimentEnabled
16960
+ } = useExperimentsContext();
16953
16961
  const {
16954
16962
  dataStoreId,
16955
16963
  validators
@@ -16971,9 +16979,9 @@ function BankAccountNumber(props) {
16971
16979
  defaultData: props.data,
16972
16980
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors,
16973
16981
  formatters: {
16974
- bankAccountNumber: {
16982
+ bankAccountNumber: isExperimentEnabled(ExperimentNames.OnlyAllowAlphanumericBankAccountNumbers) ? {
16975
16983
  formatter: (v) => v && !isValueMasked(v) ? stripNonAlphanumeric(v) : v
16976
- }
16984
+ } : void 0
16977
16985
  },
16978
16986
  maskedFields: props.maskedFields
16979
16987
  });
@@ -1,7 +1,13 @@
1
1
  import { ComponentChildren } from 'preact';
2
- export interface ExperimentsContextValue {
3
- isExperimentEnabled(key: ExperimentName): boolean;
2
+ /**
3
+ * Experiments are features that can only be switched on or off internally.
4
+ * This list is defined in the BE.
5
+ */
6
+ export declare enum ExperimentNames {
7
+ EnableTrustFlow = "EnableTrustFlow",
8
+ OnlyAllowAlphanumericBankAccountNumbers = "OnlyAllowAlphanumericBankAccountNumbers"
4
9
  }
10
+ export type ExperimentName = `${ExperimentNames}`;
5
11
  export type Experiments = {
6
12
  [key in ExperimentName]?: boolean;
7
13
  };
@@ -9,4 +15,6 @@ export interface ExperimentsProps {
9
15
  children?: ComponentChildren;
10
16
  experiments: Experiments;
11
17
  }
12
- export type ExperimentName = 'EnableTrustFlow';
18
+ export interface ExperimentsContextValue {
19
+ isExperimentEnabled(key: ExperimentName): boolean;
20
+ }
@@ -1,14 +1,8 @@
1
1
  import { ComponentChildren } from 'preact';
2
- export type Settings = {
3
- [key in SettingName]?: boolean;
4
- };
5
- export interface SettingsProps {
6
- children?: ComponentChildren;
7
- settings: Settings;
8
- }
9
- export interface SettingsContextValue {
10
- isSettingEnabled(key: SettingName): boolean;
11
- }
2
+ /**
3
+ * Settings are features that can be switched on or off by external users.
4
+ * This list is defined in the BE.
5
+ */
12
6
  export declare enum SettingNames {
13
7
  AllowBankAccountFormatSelection = "allowBankAccountFormatSelection",
14
8
  AllowIntraRegionCrossBorderPayout = "allowIntraRegionCrossBorderPayout",
@@ -21,3 +15,13 @@ export declare enum SettingNames {
21
15
  RequirePciSignPosMoto = "requirePciSignPosMoto"
22
16
  }
23
17
  export type SettingName = `${SettingNames}`;
18
+ export type Settings = {
19
+ [key in SettingName]?: boolean;
20
+ };
21
+ export interface SettingsProps {
22
+ children?: ComponentChildren;
23
+ settings: Settings;
24
+ }
25
+ export interface SettingsContextValue {
26
+ isSettingEnabled(key: SettingName): boolean;
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.13.0",
3
+ "version": "2.13.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [