From a3d24ad7d0cec65483bdb9e92cbd03d091c472f7 Mon Sep 17 00:00:00 2001 From: -l Date: Mon, 9 Sep 2024 12:37:16 +0200 Subject: [PATCH] fix rebase problem --- .../feature-fields/NationalIdentityNumber/demos.mdx | 2 +- packages/dnb-eufemia/src/extensions/forms/types.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/feature-fields/NationalIdentityNumber/demos.mdx b/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/feature-fields/NationalIdentityNumber/demos.mdx index 94dc9ae5826..52f41352224 100644 --- a/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/feature-fields/NationalIdentityNumber/demos.mdx +++ b/packages/dnb-design-system-portal/src/docs/uilib/extensions/forms/feature-fields/NationalIdentityNumber/demos.mdx @@ -66,6 +66,6 @@ You can provide your own validation function. ### Extend validation with custom validation function -You can extend the existing validation(dnr and fnr) with your own validation function. +You can extend the existing validations(`dnrValidator` and `fnrValidator`) with your own validation function. diff --git a/packages/dnb-eufemia/src/extensions/forms/types.ts b/packages/dnb-eufemia/src/extensions/forms/types.ts index 9b9c23486d6..763b8d436eb 100644 --- a/packages/dnb-eufemia/src/extensions/forms/types.ts +++ b/packages/dnb-eufemia/src/extensions/forms/types.ts @@ -40,8 +40,15 @@ export type ValidatorAdditionalArgs< Value, ErrorMessages = DefaultErrorMessages, > = { + /** + * Returns the error messages from the { errorMessages } object. + */ errorMessages: ErrorMessages - validators: Record> + + /** + * Connects the validator to another field. + * This allows you to rerun the validator function once the value of the connected field changes. + */ connectWithPath: (path: Path) => { getValue: () => Value } /**