forked from MapComplete/MapComplete
Add option to show text field inline with the rendering; add option to fill out a default value
This commit is contained in:
parent
29ea0ac925
commit
6e3c39e475
10 changed files with 123 additions and 23 deletions
|
@ -26,6 +26,8 @@ export default class TagRenderingConfig {
|
|||
readonly key: string,
|
||||
readonly type: string,
|
||||
readonly addExtraTags: TagsFilter[];
|
||||
readonly inline: boolean,
|
||||
readonly default?: string
|
||||
};
|
||||
|
||||
readonly multiAnswer: boolean;
|
||||
|
@ -73,6 +75,8 @@ export default class TagRenderingConfig {
|
|||
type: json.freeform.type ?? "string",
|
||||
addExtraTags: json.freeform.addExtraTags?.map((tg, i) =>
|
||||
FromJSON.Tag(tg, `${context}.extratag[${i}]`)) ?? [],
|
||||
inline: json.freeform.inline ?? false,
|
||||
default: json.freeform.default
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,19 @@ export interface TagRenderingConfigJson {
|
|||
**/
|
||||
addExtraTags?: string[];
|
||||
|
||||
|
||||
/**
|
||||
* When set, influences the way a question is asked.
|
||||
* Instead of showing a full-widht text field, the text field will be shown within the rendering of the question.
|
||||
*
|
||||
* This combines badly with special input elements, as it'll distort the layout.
|
||||
*/
|
||||
inline?: boolean
|
||||
|
||||
/**
|
||||
* default value to enter if no previous tagging is present.
|
||||
* Normally undefined (aka do not enter anything)
|
||||
*/
|
||||
default?: string
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue