Introducing textarea property
This commit is contained in:
parent
fab386534c
commit
991363a800
|
@ -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]
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue