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 indicates if the field should be hidden to the user.
|
||||||
Hide bool `json:"hide,omitempty"`
|
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 stores an helpfull sentence describing the field.
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -101,6 +104,8 @@ func GenField(field reflect.StructField) (f *Field) {
|
||||||
f.Required = true
|
f.Required = true
|
||||||
case "secret":
|
case "secret":
|
||||||
f.Secret = true
|
f.Secret = true
|
||||||
|
case "textarea":
|
||||||
|
f.Textarea = true
|
||||||
default:
|
default:
|
||||||
f.Label = kv[0]
|
f.Label = kv[0]
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
let inputtype: InputType = "text";
|
let inputtype: InputType = "text";
|
||||||
$: if (specs.type && (specs.type.startsWith("uint") || specs.type.startsWith("int"))) inputtype = "number";
|
$: 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.type && specs.type === "bool") inputtype = "checkbox";
|
||||||
|
else if (specs.textarea) inputtype = "textarea";
|
||||||
|
|
||||||
let inputmin: number | undefined = undefined;
|
let inputmin: number | undefined = undefined;
|
||||||
let inputmax: number | undefined = undefined;
|
let inputmax: number | undefined = undefined;
|
||||||
|
|
Loading…
Reference in New Issue