@adyen/kyc-components 3.40.1 → 3.40.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.
@@ -19573,10 +19573,13 @@ function ContactDetails(props) {
19573
19573
  ...mergedProps,
19574
19574
  schema,
19575
19575
  defaultData: mergedProps.data,
19576
- rules: mergedProps.validators || contactDetailsValidationRules,
19576
+ rules: {
19577
+ ...mergedProps.validators,
19578
+ email: contactDetailsValidationRules.email
19579
+ },
19577
19580
  /*
19578
19581
  These async rules are specific to the new PhoneField (phone) and aren't applied when the feature is disabled.
19579
- The MemoizedPhoneInput component has it's own useForm instance and asyncRules using a different field key (phoneNumber)
19582
+ The MemoizedPhoneInput component has its own useForm instance and asyncRules using a different field key (phoneNumber)
19580
19583
  */
19581
19584
  asyncRules,
19582
19585
  fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
@@ -34233,6 +34236,7 @@ function CustomerSupport(props) {
34233
34236
  const { i18n } = useI18nContext();
34234
34237
  const { showToast } = useToastContext();
34235
34238
  const { isExperimentEnabled } = useExperimentsContext();
34239
+ const [shouldValidate, setShouldValidate] = useState(false);
34236
34240
  const {
34237
34241
  state: { currentState }
34238
34242
  } = useStateContext();
@@ -34246,20 +34250,22 @@ function CustomerSupport(props) {
34246
34250
  email: (_f = (_e = legalEntityResponse[legalEntityType]) == null ? void 0 : _e.support) == null ? void 0 : _f.email
34247
34251
  };
34248
34252
  const submitForm = async () => {
34249
- if (currentState.isValid) {
34250
- const customerSupport = currentState.data;
34251
- const support = mapCustomerSupportSchemaToCustomerSupportType(customerSupport);
34252
- const payload = {
34253
- [legalEntityType]: { support }
34254
- };
34255
- try {
34256
- await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity(payload, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
34257
- onSubmit();
34258
- } catch {
34259
- const label = i18n.get("failedToUpdateDetails");
34260
- logger$q.error(label, payload);
34261
- showToast({ label, type: "error" });
34262
- }
34253
+ if (!currentState.isValid) {
34254
+ setShouldValidate(true);
34255
+ return;
34256
+ }
34257
+ const customerSupport = currentState.data;
34258
+ const support = mapCustomerSupportSchemaToCustomerSupportType(customerSupport);
34259
+ const payload = {
34260
+ [legalEntityType]: { support }
34261
+ };
34262
+ try {
34263
+ await (handleUpdateLegalEntity == null ? void 0 : handleUpdateLegalEntity(payload, legalEntityResponse == null ? void 0 : legalEntityResponse.id));
34264
+ onSubmit();
34265
+ } catch {
34266
+ const label = i18n.get("failedToUpdateDetails");
34267
+ logger$q.error(label, payload);
34268
+ showToast({ label, type: "error" });
34263
34269
  }
34264
34270
  };
34265
34271
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__customer-support", "aria-describedby": "ariaErrorField", children: [
@@ -34277,7 +34283,7 @@ function CustomerSupport(props) {
34277
34283
  data: contactDetailsData,
34278
34284
  country,
34279
34285
  requiredFields: isExperimentEnabled("EnableNewPhoneField") ? ["email", "phone"] : ["email", "phoneNumber"],
34280
- shouldValidate: true
34286
+ shouldValidate
34281
34287
  }
34282
34288
  ),
34283
34289
  /* @__PURE__ */ jsx(
@@ -45579,7 +45585,7 @@ const ConfigurationApiProvider = ({
45579
45585
  }) => {
45580
45586
  const authContext = useAuthContext();
45581
45587
  const { isEmbeddedDropin, loadingContext } = authContext;
45582
- const sdkVersion = "3.40.1";
45588
+ const sdkVersion = "3.40.2";
45583
45589
  useAnalytics({
45584
45590
  onUserEvent,
45585
45591
  legalEntityId: rootLegalEntityId,
@@ -46258,7 +46264,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
46258
46264
  (settingName) => [settingName, getSetting(settingName)]
46259
46265
  );
46260
46266
  const debugModalMetaData = [
46261
- { key: "SDK version", value: "3.40.1", variant: "green" },
46267
+ { key: "SDK version", value: "3.40.2", variant: "green" },
46262
46268
  { key: "rootLegalEntityId", value: rootLegalEntityId, variant: "blue" },
46263
46269
  { key: "Locale", value: i18n.locale, variant: "blue" },
46264
46270
  { key: "Language", value: i18n.languageCode, variant: "blue" },
@@ -46290,7 +46296,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
46290
46296
  };
46291
46297
  const copyToClipboard = async () => {
46292
46298
  const toCopy = {
46293
- sdkVersion: "3.40.1",
46299
+ sdkVersion: "3.40.2",
46294
46300
  experiments: Object.fromEntries(allExperimentsWithValues),
46295
46301
  settings: Object.fromEntries(allSettingsWithValues)
46296
46302
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.40.1",
3
+ "version": "3.40.2",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",