forked from MapComplete/MapComplete
Auto-formatting
This commit is contained in:
parent
9e000d521f
commit
fed4cff878
26 changed files with 360 additions and 304 deletions
|
|
@ -10,9 +10,9 @@ import { FilterState } from "../FilteredLayer"
|
|||
import { QueryParameters } from "../../Logic/Web/QueryParameters"
|
||||
import { Utils } from "../../Utils"
|
||||
import { RegexTag } from "../../Logic/Tags/RegexTag"
|
||||
import BaseUIElement from "../../UI/BaseUIElement";
|
||||
import Table from "../../UI/Base/Table";
|
||||
import Combine from "../../UI/Base/Combine";
|
||||
import BaseUIElement from "../../UI/BaseUIElement"
|
||||
import Table from "../../UI/Base/Table"
|
||||
import Combine from "../../UI/Base/Combine"
|
||||
|
||||
export default class FilterConfig {
|
||||
public readonly id: string
|
||||
|
|
@ -247,19 +247,22 @@ export default class FilterConfig {
|
|||
}
|
||||
|
||||
public GenerateDocs(): BaseUIElement {
|
||||
const hasField = this.options.some(opt => opt.fields?.length > 0)
|
||||
const hasField = this.options.some((opt) => opt.fields?.length > 0)
|
||||
return new Table(
|
||||
Utils.NoNull(["id","question","osmTags",hasField ? "fields" : undefined]),
|
||||
Utils.NoNull(["id", "question", "osmTags", hasField ? "fields" : undefined]),
|
||||
this.options.map((opt, i) => {
|
||||
const isDefault = this.options.length > 1 && ((this.defaultSelection ?? 0) == i)
|
||||
const isDefault = this.options.length > 1 && (this.defaultSelection ?? 0) == i
|
||||
return Utils.NoNull([
|
||||
this.id + "." + i,
|
||||
isDefault ? new Combine([opt.question.SetClass("font-bold"), "(default)"]) : opt.question ,
|
||||
isDefault
|
||||
? new Combine([opt.question.SetClass("font-bold"), "(default)"])
|
||||
: opt.question,
|
||||
opt.osmTags?.asHumanString(false, false, {}) ?? "",
|
||||
opt.fields?.length > 0 ? new Combine(opt.fields.map(f => f.name+" ("+f.type+")")) : undefined
|
||||
|
||||
]);
|
||||
opt.fields?.length > 0
|
||||
? new Combine(opt.fields.map((f) => f.name + " (" + f.type + ")"))
|
||||
: undefined,
|
||||
])
|
||||
})
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue