Fix build

This commit is contained in:
Pieter Vander Vennet 2020-11-06 03:17:27 +01:00
parent 3f8b6e88d3
commit dc1dde6c3d
8 changed files with 191 additions and 32 deletions

View file

@ -1,7 +1,7 @@
import {UIEventSource} from "../../Logic/UIEventSource";
import {UIElement} from "../UIElement";
import {FixedUiElement} from "../Base/FixedUiElement";
import Combine from "../Base/Combine";
import Svg from "../../Svg";
export class SlideShow extends UIElement {
@ -25,18 +25,17 @@ export class SlideShow extends UIElement {
this.dumbMode = false;
const self = this;
this._prev = new FixedUiElement("<div class='prev-button'>" +
"<div class='vspan'></div>" +
"<img src='assets/arrow-left-smooth.svg' alt='Prev'/>" +
"</div>")
this._prev = new Combine([
"<div class='vspan'></div>",
Svg.arrow_left_smooth_img]).SetStyle("prev-button")
.onClick(() => {
const current = self._currentSlide.data;
self.MoveTo(current - 1);
});
this._next = new FixedUiElement("<div class='next-button'>" +
"<div class='vspan'></div>" +
"<img src='assets/arrow-right-smooth.svg' alt='Next'/>" +
"</div>")
this._next = new Combine([
"<div class='vspan'></div>",
Svg.arrow_right_smooth_img])
.SetClass("next-button")
.onClick(() => {
const current = self._currentSlide.data;
self.MoveTo(current + 1);

View file

@ -1,6 +1,11 @@
export class Img {
public static runningFromConsole = false;
static AsData(source:string){
if(this.runningFromConsole){
return source;
}
return `data:image/svg+xml;base64,${(btoa(source))}`;
}

View file

@ -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) {

View file

@ -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();

View file

@ -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;