aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/forms/forms.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web-util/src/forms/forms.ts')
-rw-r--r--packages/web-util/src/forms/forms.ts78
1 files changed, 39 insertions, 39 deletions
diff --git a/packages/web-util/src/forms/forms.ts b/packages/web-util/src/forms/forms.ts
index 4bd6b4924..f2c00083c 100644
--- a/packages/web-util/src/forms/forms.ts
+++ b/packages/web-util/src/forms/forms.ts
@@ -14,9 +14,9 @@ import { InputText } from "./InputText.js";
import { InputTextArea } from "./InputTextArea.js";
import { InputToggle } from "./InputToggle.js";
import { Addon, StringConverter, UIFieldHandler } from "./FormProvider.js";
-import { InternationalizationAPI, UIFieldBaseDescription } from "../index.browser.js";
+import { InternationalizationAPI, UIFieldElementDescription } from "../index.browser.js";
import { assertUnreachable, TranslatedString } from "@gnu-taler/taler-util";
-import {UIFormFieldBaseConfig, UIFormFieldConfig} from "./ui-form.js";
+import {UIFormFieldBaseConfig, UIFormElementConfig} from "./ui-form.js";
/**
* Constrain the type with the ui props
*/
@@ -156,7 +156,7 @@ export function RenderAllFieldsByUiConfig({
*/
export function convertUiField(
i18n_: InternationalizationAPI,
- fieldConfig: UIFormFieldConfig[],
+ fieldConfig: UIFormElementConfig[],
form: object,
getConverterById: GetConverterById,
): UIFormField[] {
@@ -166,7 +166,7 @@ export function convertUiField(
case "caption": {
const resp: UIFormField = {
type: config.type,
- properties: converBaseFieldsProps(i18n_, config.properties),
+ properties: converBaseFieldsProps(i18n_, config),
};
return resp;
}
@@ -174,8 +174,8 @@ export function convertUiField(
const resp: UIFormField = {
type: config.type,
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- fields: convertUiField(i18n_, config.properties.fields, form, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ fields: convertUiField(i18n_, config.fields, form, getConverterById),
},
};
return resp;
@@ -187,10 +187,10 @@ export function convertUiField(
return {
type: "array",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
- labelField: config.properties.labelFieldId,
- fields: convertUiField(i18n_, config.properties.fields, form, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
+ labelField: config.labelFieldId,
+ fields: convertUiField(i18n_, config.fields, form, getConverterById),
},
} as UIFormField;
}
@@ -198,8 +198,8 @@ export function convertUiField(
return {
type: "absoluteTime",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
},
} as UIFormField;
}
@@ -207,8 +207,8 @@ export function convertUiField(
return {
type: "amount",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
},
} as UIFormField;
}
@@ -216,9 +216,9 @@ export function convertUiField(
return {
type: "choiceHorizontal",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
- choices: config.properties.choices,
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
+ choices: config.choices,
},
} as UIFormField;
}
@@ -226,9 +226,9 @@ export function convertUiField(
return {
type: "choiceStacked",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
- choices: config.properties.choices,
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
+ choices: config.choices,
},
}as UIFormField;
@@ -237,10 +237,10 @@ export function convertUiField(
return {
type: "file",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
- accept: config.properties.accept,
- maxBites: config.properties.maxBytes,
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
+ accept: config.accept,
+ maxBites: config.maxBytes,
},
} as UIFormField;
}
@@ -248,8 +248,8 @@ export function convertUiField(
return {
type: "integer",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
},
} as UIFormField;
}
@@ -257,9 +257,9 @@ export function convertUiField(
return {
type: "selectMultiple",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
- choices: config.properties.choices,
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
+ choices: config.choices,
},
} as UIFormField;
}
@@ -267,9 +267,9 @@ export function convertUiField(
return {
type: "selectOne",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
- choices: config.properties.choices,
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
+ choices: config.choices,
},
} as UIFormField;
}
@@ -277,8 +277,8 @@ export function convertUiField(
return {
type: "text",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
},
} as UIFormField;
}
@@ -286,8 +286,8 @@ export function convertUiField(
return {
type: "text",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
},
} as UIFormField;
}
@@ -295,8 +295,8 @@ export function convertUiField(
return {
type: "toggle",
properties: {
- ...converBaseFieldsProps(i18n_, config.properties),
- ...converInputFieldsProps(form, config.properties, getConverterById),
+ ...converBaseFieldsProps(i18n_, config),
+ ...converInputFieldsProps(form, config, getConverterById),
},
} as UIFormField;
}
@@ -340,7 +340,7 @@ function converInputFieldsProps(
function converBaseFieldsProps(
i18n_: InternationalizationAPI,
- p: UIFieldBaseDescription,
+ p: UIFieldElementDescription,
) {
return {
after: getAddonById(p.addonAfterId),