taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 906d5bcfaf17f03872ed1ed20996952e29497687
parent 71b91a51ab0a75b87c6986c06dd6afcc1388c1f1
Author: Florian Dold <florian@dold.me>
Date:   Fri, 21 Mar 2025 11:46:14 +0100

comment

Diffstat:
Mpackages/web-util/src/forms/forms-types.ts | 26+++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/packages/web-util/src/forms/forms-types.ts b/packages/web-util/src/forms/forms-types.ts @@ -42,9 +42,16 @@ export type DoubleColumnFormSection = { title: string; description?: string; fields: UIFormElementConfig[]; - /* - return if the field should be hidden. - receives the value after conversion and the root of the form. + + /** + * Function to decide whether the form element + * should be hidden. + * + * Hidden form elements and their children are not validated. + * + * @param root the root of the form (values after conversion) + * + * @returns true if the field should be hidden. */ hide?: (root: Record<string, any>) => boolean | undefined; }; @@ -100,11 +107,16 @@ type UIFormFieldAmount = { type UIFormFieldArray = { type: "array"; - // id of the field shown when the array is collapsed + /** + * id of the field shown when the array is collapsed. + */ labelFieldId: UIHandlerId; - /* - return an error message if the value is not valid. - should returns un undefined if there is no error. + + /** + * Validator for the field. + * + * @returns an error message if the value is not valid, + * undefined if there is no error. */ validator?: (array: Array<object>) => TranslatedString | undefined;