forked from MapComplete/MapComplete
Fix build
This commit is contained in:
parent
3f8b6e88d3
commit
dc1dde6c3d
8 changed files with 191 additions and 32 deletions
|
@ -6,6 +6,8 @@ import {SubtleButton} from "../Base/SubtleButton";
|
|||
import CheckBox from "./CheckBox";
|
||||
import {AndOrTagConfigJson} from "../../Customizations/JSON/TagConfigJson";
|
||||
import {MultiTagInput} from "./MultiTagInput";
|
||||
import Svg from "../../Svg";
|
||||
import {Img} from "../Img";
|
||||
|
||||
class AndOrConfig implements AndOrTagConfigJson {
|
||||
public and: (string | AndOrTagConfigJson)[] = undefined;
|
||||
|
@ -30,13 +32,13 @@ export default class AndOrTagInput extends InputElement<AndOrTagConfigJson> {
|
|||
super();
|
||||
const self = this;
|
||||
this._isAndButton = new CheckBox(
|
||||
new SubtleButton("./assets/ampersand.svg", null).SetClass("small-button"),
|
||||
new SubtleButton("./assets/or.svg", null).SetClass("small-button"),
|
||||
new SubtleButton(Img.AsData(Svg.ampersand), null).SetClass("small-button"),
|
||||
new SubtleButton(Img.AsData(Svg.or), null).SetClass("small-button"),
|
||||
this._isAnd);
|
||||
|
||||
|
||||
this._addBlock =
|
||||
new SubtleButton("./assets/addSmall.svg", "Add an and/or-expression")
|
||||
new SubtleButton(Img.AsData(Svg.addSmall), "Add an and/or-expression")
|
||||
.SetClass("small-button")
|
||||
.onClick(() => {self.createNewBlock()});
|
||||
|
||||
|
@ -63,7 +65,7 @@ export default class AndOrTagInput extends InputElement<AndOrTagConfigJson> {
|
|||
|
||||
private createDeleteButton(elementId: string): UIElement {
|
||||
const self = this;
|
||||
return new SubtleButton("./assets/delete.svg", null).SetClass("small-button")
|
||||
return new SubtleButton(Img.AsData(Svg.delete_icon), null).SetClass("small-button")
|
||||
.onClick(() => {
|
||||
for (let i = 0; i < self._subAndOrs.length; i++) {
|
||||
if (self._subAndOrs[i].id === elementId) {
|
||||
|
|
|
@ -80,7 +80,8 @@ export class MultiInput<T> extends InputElement<T[]> {
|
|||
self._value.ping();
|
||||
});
|
||||
|
||||
const moveDownBtn = new FixedUiElement("<img src='./assets/down.svg' style='max-width: 1.5em; margin-left: 5px;'>")
|
||||
const moveDownBtn =
|
||||
Svg.down_ui().SetStyle('max-width: 1.5em; margin-left: 5px;display:block;')
|
||||
.onClick(() => {
|
||||
const v = self._value.data[i];
|
||||
self._value.data[i] = self._value.data[i + 1];
|
||||
|
@ -98,7 +99,8 @@ export class MultiInput<T> extends InputElement<T[]> {
|
|||
}
|
||||
|
||||
|
||||
const deleteBtn = new FixedUiElement("<img src='./assets/delete.svg' style='max-width: 1.5em;width:1.5em; margin-left: 5px;'>")
|
||||
const deleteBtn =
|
||||
Svg.delete_icon_ui().SetStyle('max-width: 1.5em;width:1.5em; margin-left: 5px;')
|
||||
.onClick(() => {
|
||||
self._value.data.splice(i, 1);
|
||||
self._value.ping();
|
||||
|
|
|
@ -5,6 +5,7 @@ import Combine from "../../Base/Combine";
|
|||
import {Utils} from "../../../Utils";
|
||||
import {FixedUiElement} from "../../Base/FixedUiElement";
|
||||
import {VariableUiElement} from "../../Base/VariableUIElement";
|
||||
import Svg from "../../../Svg";
|
||||
|
||||
/**
|
||||
* A single opening hours range, shown on top of the OH-picker table
|
||||
|
@ -28,7 +29,8 @@ export default class OpeningHoursRange extends UIElement {
|
|||
self.InnerUpdate(el);
|
||||
})
|
||||
|
||||
this._deleteRange = new FixedUiElement("<img src='./assets/delete.svg'>")
|
||||
this._deleteRange =
|
||||
Svg.delete_icon_ui()
|
||||
.SetClass("oh-delete-range")
|
||||
.onClick(() => {
|
||||
oh.data.weekday = undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue