Finish refactoring

This commit is contained in:
Pieter Vander Vennet 2020-11-06 04:02:53 +01:00
parent dc1dde6c3d
commit b764371cce
55 changed files with 76 additions and 3201 deletions

View file

@ -7,7 +7,6 @@ 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;
@ -32,13 +31,13 @@ export default class AndOrTagInput extends InputElement<AndOrTagConfigJson> {
super();
const self = this;
this._isAndButton = new CheckBox(
new SubtleButton(Img.AsData(Svg.ampersand), null).SetClass("small-button"),
new SubtleButton(Img.AsData(Svg.or), null).SetClass("small-button"),
new SubtleButton(Svg.ampersand_ui(), null).SetClass("small-button"),
new SubtleButton(Svg.or_ui(), null).SetClass("small-button"),
this._isAnd);
this._addBlock =
new SubtleButton(Img.AsData(Svg.addSmall), "Add an and/or-expression")
new SubtleButton(Svg.addSmall_ui(), "Add an and/or-expression")
.SetClass("small-button")
.onClick(() => {self.createNewBlock()});
@ -65,7 +64,7 @@ export default class AndOrTagInput extends InputElement<AndOrTagConfigJson> {
private createDeleteButton(elementId: string): UIElement {
const self = this;
return new SubtleButton(Img.AsData(Svg.delete_icon), null).SetClass("small-button")
return new SubtleButton(Svg.delete_icon_ui(), null).SetClass("small-button")
.onClick(() => {
for (let i = 0; i < self._subAndOrs.length; i++) {
if (self._subAndOrs[i].id === elementId) {

View file

@ -3,9 +3,7 @@ import {UIEventSource} from "../../Logic/UIEventSource";
import {UIElement} from "../UIElement";
import Combine from "../Base/Combine";
import {SubtleButton} from "../Base/SubtleButton";
import {FixedUiElement} from "../Base/FixedUiElement";
import Svg from "../../Svg";
import {Img} from "../Img";
export class MultiInput<T> extends InputElement<T[]> {
@ -30,7 +28,7 @@ export class MultiInput<T> extends InputElement<T[]> {
this.ListenTo(value.map((latest : T[]) => latest.length));
this._options = options ?? {};
this.addTag = new SubtleButton(Img.AsData(Svg.addSmall), addAElement)
this.addTag = new SubtleButton(Svg.addSmall_ui(), addAElement)
.SetClass("small-button")
.onClick(() => {
this.IsSelected.setData(true);
@ -72,7 +70,7 @@ export class MultiInput<T> extends InputElement<T[]> {
this.inputELements.push(input);
input.IsSelected.addCallback(() => this.UpdateIsSelected());
const moveUpBtn = new FixedUiElement(Img.AsData(Svg.up))
const moveUpBtn = Svg.up_ui()
.onClick(() => {
const v = self._value.data[i];
self._value.data[i] = self._value.data[i - 1];