forked from MapComplete/MapComplete
Butchering the UI framework
This commit is contained in:
parent
8d404b1ba9
commit
6415e195d1
90 changed files with 1012 additions and 3101 deletions
|
|
@ -39,7 +39,6 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
|
|||
const titleIcons = new Combine(
|
||||
layerConfig.titleIcons.map(icon => new TagRenderingAnswer(tags, icon,
|
||||
"block w-8 h-8 align-baseline box-content sm:p-0.5", "width: 2rem !important;")
|
||||
.HideOnEmpty(true)
|
||||
))
|
||||
.SetClass("flex flex-row flex-wrap pt-0.5 sm:pt-1 items-center mr-2")
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export default class QuestionBox extends UIElement {
|
|||
this.SetClass("block mb-8")
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
InnerRender() {
|
||||
const allQuestions : UIElement[] = []
|
||||
for (let i = 0; i < this._tagRenderingQuestions.length; i++) {
|
||||
let tagRendering = this._tagRenderings[i];
|
||||
|
|
@ -72,7 +72,7 @@ export default class QuestionBox extends UIElement {
|
|||
}
|
||||
|
||||
|
||||
return new Combine(allQuestions).Render();
|
||||
return new Combine(allQuestions);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,15 +21,15 @@ export class SaveButton extends UIElement {
|
|||
.onClick(() => osmConnection?.AttemptLogin())
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
InnerRender() {
|
||||
if(this._userDetails != undefined && !this._userDetails.data.loggedIn){
|
||||
return this._friendlyLogin.Render();
|
||||
return this._friendlyLogin;
|
||||
}
|
||||
let inactive_class = ''
|
||||
if (this._value.data === false || (this._value.data ?? "") === "") {
|
||||
inactive_class = "btn-disabled";
|
||||
}
|
||||
return Translations.t.general.save.Clone().SetClass(`btn ${inactive_class}`).Render();
|
||||
return Translations.t.general.save.Clone().SetClass(`btn ${inactive_class}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ export default class TagRenderingAnswer extends UIElement {
|
|||
this.SetStyle("word-wrap: anywhere;");
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
InnerRender(): string | UIElement{
|
||||
if (this._configuration.condition !== undefined) {
|
||||
if (!this._configuration.condition.matchesProperties(this._tags.data)) {
|
||||
return "";
|
||||
|
|
@ -80,14 +80,14 @@ export default class TagRenderingAnswer extends UIElement {
|
|||
])
|
||||
|
||||
}
|
||||
return this._content.SetClass(this._contentClass).SetStyle(this._contentStyle).Render();
|
||||
return this._content.SetClass(this._contentClass).SetStyle(this._contentStyle);
|
||||
}
|
||||
}
|
||||
|
||||
const tr = this._configuration.GetRenderValue(tags);
|
||||
if (tr !== undefined) {
|
||||
this._content = SubstitutedTranslation.construct(tr, this._tags);
|
||||
return this._content.SetClass(this._contentClass).SetStyle(this._contentStyle).Render();
|
||||
return this._content.SetClass(this._contentClass).SetStyle(this._contentStyle);
|
||||
}
|
||||
|
||||
return "";
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export default class TagRenderingQuestion extends UIElement {
|
|||
).SetClass("block")
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
InnerRender() {
|
||||
return new Combine([
|
||||
this._question,
|
||||
this._inputElement,
|
||||
|
|
@ -103,7 +103,6 @@ export default class TagRenderingQuestion extends UIElement {
|
|||
this._appliedTags]
|
||||
)
|
||||
.SetClass("question")
|
||||
.Render()
|
||||
}
|
||||
|
||||
private GenerateInputElement(): InputElement<TagsFilter> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue