Introducing textarea property

This commit is contained in:
nemunaire 2024-02-06 12:35:47 +01:00
parent fab386534c
commit 991363a800
2 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,9 @@ type Field struct {
// Hide indicates if the field should be hidden to the user.
Hide bool `json:"hide,omitempty"`
// Textarea indicates that a large field is expected.
Textarea bool `json:"textarea,omitempty"`
// Description stores an helpfull sentence describing the field.
Description string `json:"description,omitempty"`
}
@ -101,6 +104,8 @@ func GenField(field reflect.StructField) (f *Field) {
f.Required = true
case "secret":
f.Secret = true
case "textarea":
f.Textarea = true
default:
f.Label = kv[0]
}

View File

@ -48,6 +48,7 @@
let inputtype: InputType = "text";
$: if (specs.type && (specs.type.startsWith("uint") || specs.type.startsWith("int"))) inputtype = "number";
else if (specs.type && specs.type === "bool") inputtype = "checkbox";
else if (specs.textarea) inputtype = "textarea";
let inputmin: number | undefined = undefined;
let inputmax: number | undefined = undefined;