Merge develop

This commit is contained in:
Pieter Vander Vennet 2021-07-27 19:59:41 +02:00
commit 0162d52b68
127 changed files with 6609 additions and 15167 deletions

View file

@ -3,51 +3,55 @@ import BackgroundSelector from "./BackgroundSelector";
import Combine from "../Base/Combine";
import ScrollableFullScreen from "../Base/ScrollableFullScreen";
import Translations from "../i18n/Translations";
import { UIEventSource } from "../../Logic/UIEventSource";
import {UIEventSource} from "../../Logic/UIEventSource";
import BaseUIElement from "../BaseUIElement";
import Toggle from "../Input/Toggle";
import { ExportDataButton } from "./ExportDataButton";
import FilterView from "./FilterView";
import {DownloadPanel} from "./DownloadPanel";
export default class LayerControlPanel extends ScrollableFullScreen {
constructor(isShown: UIEventSource<boolean>) {
super(
LayerControlPanel.GenTitle,
LayerControlPanel.GeneratePanel,
"layers",
isShown
);
}
private static GenTitle(): BaseUIElement {
return Translations.t.general.layerSelection.title
.Clone()
.SetClass("text-2xl break-words font-bold p-2");
}
private static GeneratePanel(): BaseUIElement {
const elements: BaseUIElement[] = [];
if (State.state.layoutToUse.data.enableBackgroundLayerSelection) {
const backgroundSelector = new BackgroundSelector();
backgroundSelector.SetStyle("margin:1em");
backgroundSelector.onClick(() => {});
elements.push(backgroundSelector);
constructor(isShown: UIEventSource<boolean>) {
super(LayerControlPanel.GenTitle, LayerControlPanel.GeneratePanel, "layers", isShown);
}
elements.push(
new Toggle(
new FilterView(State.state.filteredLayers),
undefined,
State.state.filteredLayers.map(
(layers) => layers.length > 1 || layers[0].layerDef.filters.length > 0
)
)
);
private static GenTitle(): BaseUIElement {
return Translations.t.general.layerSelection.title
.Clone()
.SetClass("text-2xl break-words font-bold p-2");
}
private static GeneratePanel(): BaseUIElement {
const elements: BaseUIElement[] = [];
if (State.state.layoutToUse.data.enableBackgroundLayerSelection) {
const backgroundSelector = new BackgroundSelector();
backgroundSelector.SetStyle("margin:1em");
backgroundSelector.onClick(() => {
});
elements.push(backgroundSelector)
}
elements.push(
new Toggle(
new FilterView(State.state.filteredLayers),
undefined,
State.state.filteredLayers.map(
(layers) => layers.length > 1 || layers[0].layerDef.filters.length > 0
)
)
);
elements.push(new Toggle(
new DownloadPanel(),
undefined,
State.state.featureSwitchEnableExport
))
elements.push(
new Toggle(
new ExportDataButton(),
new DownloadPanel(),
undefined,
State.state.featureSwitchEnableExport
)