Add icon size options to mapping icons
This commit is contained in:
parent
29ad3be280
commit
2e6069b95b
10 changed files with 159 additions and 44 deletions
|
@ -355,7 +355,8 @@ export default class TagRenderingQuestion extends Combine {
|
|||
if: TagsFilter,
|
||||
then: Translation,
|
||||
addExtraTags: Tag[],
|
||||
img?: string
|
||||
icon?: string,
|
||||
iconClass?: string
|
||||
}, ifNot?: TagsFilter[]): InputElement<TagsFilter> {
|
||||
|
||||
let tagging: TagsFilter = mapping.if;
|
||||
|
@ -375,13 +376,14 @@ export default class TagRenderingQuestion extends Combine {
|
|||
|
||||
private static GenerateMappingContent(mapping: {
|
||||
then: Translation,
|
||||
icon?: string
|
||||
icon?: string,
|
||||
iconClass?: string
|
||||
}, tagsSource: UIEventSource<any>, state: FeaturePipelineState): BaseUIElement {
|
||||
const text = new SubstitutedTranslation(mapping.then, tagsSource, state)
|
||||
if (mapping.icon === undefined) {
|
||||
return text;
|
||||
}
|
||||
return new Combine([new Img(mapping.icon).SetClass("w-6 max-h-6 pr-2"), text]).SetClass("flex")
|
||||
return new Combine([new Img(mapping.icon).SetClass("mapping-icon-"+(mapping.iconClass ?? "small")), text]).SetClass("flex")
|
||||
}
|
||||
|
||||
private static GenerateFreeform(state, configuration: TagRenderingConfig, applicableUnit: Unit, tags: UIEventSource<any>, feedback: UIEventSource<Translation>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue