forked from MapComplete/MapComplete
refactoring: fix basic flow to add a new point
This commit is contained in:
parent
52a0810ea9
commit
0241f89d3d
109 changed files with 1931 additions and 1446 deletions
22
test.ts
22
test.ts
|
@ -2,14 +2,11 @@ import SvelteUIElement from "./UI/Base/SvelteUIElement"
|
|||
import ThemeViewGUI from "./UI/ThemeViewGUI.svelte"
|
||||
import { FixedUiElement } from "./UI/Base/FixedUiElement"
|
||||
import LayoutConfig from "./Models/ThemeConfig/LayoutConfig"
|
||||
import * as theme from "./assets/generated/themes/shops.json"
|
||||
import { UIEventSource } from "./Logic/UIEventSource"
|
||||
import * as theme from "./assets/generated/themes/aed.json"
|
||||
import ThemeViewState from "./Models/ThemeViewState"
|
||||
import Combine from "./UI/Base/Combine"
|
||||
import SpecialVisualizations from "./UI/SpecialVisualizations"
|
||||
import ValidatedInput from "./UI/InputElement/ValidatedInput.svelte"
|
||||
import { VariableUiElement } from "./UI/Base/VariableUIElement"
|
||||
import { Translation } from "./UI/i18n/Translation"
|
||||
import AddNewPoint from "./UI/Popup/AddNewPoint/AddNewPoint.svelte"
|
||||
|
||||
async function main() {
|
||||
new FixedUiElement("").AttachTo("extradiv")
|
||||
|
@ -21,18 +18,23 @@ async function main() {
|
|||
async function testspecial() {
|
||||
const layout = new LayoutConfig(<any>theme, true) // qp.data === "" ? : new AllKnownLayoutsLazy().get(qp.data)
|
||||
const state = new ThemeViewState(layout)
|
||||
|
||||
const all = SpecialVisualizations.specialVisualizations.map((s) =>
|
||||
SpecialVisualizations.renderExampleOfSpecial(state, s)
|
||||
)
|
||||
new Combine(all).AttachTo("maindiv")
|
||||
}
|
||||
|
||||
async function test() {
|
||||
const value = new UIEventSource("Hello world!")
|
||||
const feedback = new UIEventSource<Translation>(undefined)
|
||||
new SvelteUIElement(ValidatedInput, { type: "direction", value, feedback }).AttachTo("maindiv")
|
||||
new VariableUiElement(feedback).AttachTo("extradiv")
|
||||
const layout = new LayoutConfig(<any>theme, true) // qp.data === "" ? : new AllKnownLayoutsLazy().get(qp.data)
|
||||
const state = new ThemeViewState(layout)
|
||||
state.featureSwitches.featureSwitchIsTesting.setData(true)
|
||||
new SvelteUIElement(AddNewPoint, {
|
||||
state,
|
||||
coordinate: { lon: 3.22001, lat: 51.21576 },
|
||||
}).AttachTo("maindiv")
|
||||
//*/
|
||||
}
|
||||
|
||||
/*
|
||||
test().then((_) => {}) /*/
|
||||
main().then((_) => {}) //*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue